diff --git a/src/fennel-ls/state.fnl b/src/fennel-ls/state.fnl index c944af0..e4b158b 100644 --- a/src/fennel-ls/state.fnl +++ b/src/fennel-ls/state.fnl @@ -120,7 +120,7 @@ However, fennel-ls can fall back to positionEncoding=utf-16 (with a performance (set self.modules {}) (set self.root-uri params.rootUri) (set self.position-encoding (choose-position-encoding params)) - (set self.configuration (make-configuration))) + (set self.configuration (make-configuration (?. params :initializationOptions :fennel-ls)))) (λ write-configuration [self ?configuration] (set self.configuration (make-configuration ?configuration))) diff --git a/test/settings-test.fnl b/test/settings-test.fnl index fe28944..5f84230 100644 --- a/test/settings-test.fnl +++ b/test/settings-test.fnl @@ -3,6 +3,7 @@ (local {: view} (require :fennel)) (local {: ROOT-URI + : ROOT-PATH : create-client} (require :test.client)) (describe "settings" @@ -44,4 +45,17 @@ (is-matching responses [{:method :textDocument/publishDiagnostics :params {:diagnostics [nil]}}] - "bad")))) + "bad"))) + + (it "can be configured with initialization options" + (let [initializationOptions {:fennel-ls {:checks {:unused-definition false}}} + client (create-client {:params {: initializationOptions + :rootPath ROOT-PATH + :rootUri ROOT-URI + :workspaceFolders [{:name ROOT-PATH + :uri ROOT-URI}]}}) + responses (client:open-file! (.. ROOT-URI :/test.fnl) "(local x 10)")] + (is-matching responses + [{:method :textDocument/publishDiagnostics + :params {:diagnostics [nil]}}] + "settings should apply when set through initializationOptions"))))