fix recovery from empty () call, because it didn't work

This commit is contained in:
XeroOl 2024-03-28 22:37:10 -05:00
parent a1c4e84910
commit c92ea1c3ca
2 changed files with 7 additions and 2 deletions

View File

@ -247,7 +247,7 @@ identifiers are declared / referenced in which places."
(table.insert ?ast (sym :nil))
true)
(when (and (= 1 (msg:find "expected a function, macro, or special to call"))
(sequence? ?ast)
(list? ?ast)
(= (length ?ast) 0))
(table.insert ?ast (sym :do))
true)))

View File

@ -142,7 +142,12 @@ Every time the client sends a message, it gets handled by a function in the corr
file.scope)
?parent (. parents 1)
result []
in-call-position? (and (fennel.list? ?parent) (= ?symbol (. ?parent 1)))]
in-call-position? (and (fennel.list? ?parent)
(or (= ?symbol (. ?parent 1))
;; so, this is unfortunate
(and (= ?symbol nil)
(fennel.sym? (. ?parent 1) :do)
(= (. ?parent 1 :bytestart) nil))))]
(collect-scope scope :manglings #(doto (make-completion-item self file $ scope) (tset :kind kinds.Variable)) result)
(when in-call-position?