diff --git a/src/fennel-ls/compiler.fnl b/src/fennel-ls/compiler.fnl index ee411bf..b3d21d6 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -263,7 +263,6 @@ identifiers are declared / referenced in which places." (table.insert defer #(tset ?ast 1 old)) true)))) - (λ on-compile-error [_ msg ast call-me-to-reset-the-compiler] (let [range (or (message.ast->range self file ast) (line+byte->range self file 1 1))] @@ -344,6 +343,7 @@ identifiers are declared / referenced in which places." (λ parsed [ast] "runs on every ast tree that was parsed" ;; TODO in fennel 1.5+, bug fennel#221 will be fixed, and all syms in the ast should have a bytestart + ;; the extra check can be removed (if (and (sym? ast) ast.bytestart) (case (values (tostring ast) (file.text:sub ast.bytestart ast.bytestart)) (where (:hashfn "#")) diff --git a/src/fennel-ls/state.fnl b/src/fennel-ls/state.fnl index 3b4449b..8ce6751 100644 --- a/src/fennel-ls/state.fnl +++ b/src/fennel-ls/state.fnl @@ -1,7 +1,8 @@ "State -This module keeps track of the state of the language server. -There are helpers to get files (get-by functions are all for -getting files), and there's stuff for configuration options. +This module keeps track of the state of the language server: +* Settings +* Loaded files + There is no global state in this project: all state is stored in the \"self\" object. Pretty much every \"self\" in the entire fennel-ls project is referring to the same object." @@ -137,6 +138,7 @@ However, when not an option, fennel-ls will fall back to positionEncoding=\"utf- (set self.EGLOT_COMPLETION_QUIRK_MODE (= (?. params :clientInfo :name) :Eglot))) (λ write-configuration [self ?configuration] + "This is where we can put anything that needs to react to config changes" (set self.configuration (make-configuration ?configuration))) {: flush-uri