refactoring and starting to implement settings

This commit is contained in:
XeroOl 2022-09-21 21:26:55 -05:00
parent cd4358a4b7
commit 566b475ff8
No known key found for this signature in database
GPG Key ID: 9DD4B4B4DAED0322
3 changed files with 11 additions and 8 deletions

View File

@ -158,6 +158,10 @@ Every time the client sends a message, it gets handled by a function in the corr
(local file (state.get-by-uri self uri))
(set file.open? false))
(λ notifications.workspace/didChangeConfiguration [self send params]
(set self.settings params.fennel-ls))
;; TODO respect the settings
(λ requests.shutdown [self send]
"The server still needs to respond to this request, so the program can't close yet. Just wait until notifications.exit"
nil)

View File

@ -18,7 +18,7 @@
(let [response (dispatch.handle* state (completion-at filename line col))
seen (collect [_ suggestion (ipairs (. response 1 :result))]
suggestion.label suggestion.label)]
(if (= (type expected) :table)
(if expected
(each [_ exp (ipairs expected)]
(is.truthy (. seen exp) (.. exp " was not suggested, but should be"))))
(if ?unexpected
@ -33,7 +33,6 @@
{:jsonrpc "2.0" :id id :result nil}
"there shouldn't be a result")))
(describe "completions"
(it "suggests globals"
(check-completion "(" 0 1 [:_G :debug :table :io :getmetatable :setmetatable :_VERSION :ipairs :pairs :next]))