fix the | virtual cursor character appearing in completion output

This commit is contained in:
XeroOl 2025-07-18 12:45:48 -05:00
parent 7b92d6dc2e
commit 284a760224
2 changed files with 9 additions and 1 deletions

View File

@ -62,7 +62,8 @@ is set to true and we report that we support completionItem/resolve."
seen {}] seen {}]
(fn add-completion! [name definition ?kind] (fn add-completion! [name definition ?kind]
(table.insert results (format.completion-item-format server name definition range ?kind))) (when (and symbol (not= name (tostring symbol)))
(table.insert results (format.completion-item-format server name definition range ?kind))))
(fn add-completion-recursively! [name definition] (fn add-completion-recursively! [name definition]
"add the completion. also recursively adds the fields' completions" "add the completion. also recursively adds the fields' completions"

View File

@ -290,15 +290,22 @@
nil) nil)
(fn test-no-completion [] (fn test-no-completion []
;; comment
(check "; (" (check "; ("
[] []
[:math]) [:math])
;; inside of a string
(check "\" (|\n\"" (check "\" (|\n\""
[] []
[:math]) [:math])
;; inside of a string, but the starting quote is on a different line
(check "\"\n(|\"" (check "\"\n(|\""
[] []
[:math]) [:math])
(check "(fn foo|)"
[]
["foo|"])
nil) nil)
;; ;; Future tests / features ;; ;; Future tests / features