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 {}]
(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]
"add the completion. also recursively adds the fields' completions"

View File

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