~xerool/fennel-ls

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH fennel-ls 0/1] Allow configuration through initialization options

Details
Message ID
<169306140803.3527.9351588802488199675-0@git.sr.ht>
DKIM signature
missing
Download raw message
This way, we can easily ensure, that the configuration is set before
anything else happens.
https://todo.sr.ht/~xerool/fennel-ls/7#event-254114

adjuvant (1):
  Allow configuration through initialization options

 src/fennel-ls/state.fnl |  2 +-
 test/settings-test.fnl  | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

-- 
2.38.5

[PATCH fennel-ls 1/1] Allow configuration through initialization options

Details
Message ID
<169306140803.3527.9351588802488199675-1@git.sr.ht>
In-Reply-To
<169306140803.3527.9351588802488199675-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +16 -2
From: adjuvant <adjuvant@mailbox.org>

---
 src/fennel-ls/state.fnl |  2 +-
 test/settings-test.fnl  | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

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"))))
-- 
2.38.5

[fennel-ls/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CV2K73EUZW16.1WZIQA1T2F8HK@cirno2>
In-Reply-To
<169306140803.3527.9351588802488199675-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
fennel-ls/patches/.build.yml: SUCCESS in 46s

[Allow configuration through initialization options][0] from [~adjuvant][1]

[0]: https://lists.sr.ht/~xerool/fennel-ls/patches/43991
[1]: adjuvant@mailbox.org

✓ #1047727 SUCCESS fennel-ls/patches/.build.yml https://builds.sr.ht/~xerool/job/1047727

Re: [PATCH fennel-ls 0/1] Allow configuration through initialization options

Details
Message ID
<DCPqxlU5l1iqk9boUwCD0wGZkPywApq5VQupflMo5t45vF0O4NvkEzBV55sdWKe7inR10eJnGRTQ48qe2-jOAHB9ZekSpW6GTcnaZb6euDo=@protonmail.com>
In-Reply-To
<169306140803.3527.9351588802488199675-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
~adjuvant <adjuvant@git.sr.ht> wrote:

> This way, we can easily ensure, that the configuration is set before
> anything else happens.
> https://todo.sr.ht/~xerool/fennel-ls/7#event-254114

Sounds good! I've applied the patches.
Reply to thread Export thread (mbox)