completions on multisyms

This commit is contained in:
XeroOl 2023-05-27 21:28:42 -05:00
parent 7f8942fde6
commit a1169308d3
2 changed files with 9 additions and 3 deletions

View File

@ -174,7 +174,10 @@ later by fennel-ls.language to answer requests from the client."
(where [(= -fn-)])
(define-function ast scope)
(where [(= -require-) _modname])
(tset require-calls ast true)))
(tset require-calls ast true)
;; fennel expands multisym calls into the `:` special, so we need to reference the symbol while we still can
(where [sym] (multisym? sym) (: (tostring sym) :find ":"))
(reference sym scope)))
(λ recoverable? [msg]
(or (= 1 (msg:find "unknown identifier"))

View File

@ -111,10 +111,13 @@
"(let [foo (require :foo)]\n foo.)))"
1 6
[:my-export :constant]
[:_G :local :doto :1]))) ;; no globals, specials, macros, or others
[:_G :local :doto :1])) ;; no globals, specials, macros, or others
;; (it "suggests fields of strings"))
;; (it "suggests known fn fields of tables when using a method call multisym")
(it "suggests known fn fields of tables when using a method call multisym"
(check-completion "(local x {:field (fn [])})\n(x:fi" 1 5 [:field])))
;; (it "suggests known fn keys when using the `:` special")
;; (it "suggests known keys when using the `.` special")
;; (it "suggests known module names in `require` and `include` and `import-macros` and `require-macros` and friends")