From c92ea1c3ca87a56fb0630f17666665605cc28515 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Thu, 28 Mar 2024 22:37:10 -0500 Subject: [PATCH] fix recovery from empty () call, because it didn't work --- src/fennel-ls/compiler.fnl | 2 +- src/fennel-ls/handlers.fnl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fennel-ls/compiler.fnl b/src/fennel-ls/compiler.fnl index f39edb7..6ee7172 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -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))) diff --git a/src/fennel-ls/handlers.fnl b/src/fennel-ls/handlers.fnl index 255f4ee..b9bf6d5 100644 --- a/src/fennel-ls/handlers.fnl +++ b/src/fennel-ls/handlers.fnl @@ -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?