Skip to content

Commit c6aa457

Browse files
committed
Fix --settings option
1 parent 3c6359a commit c6aa457

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Fix --settings flag
6+
57
## 1.4.21
68

79
## 1.4.20

src/leiningen/clojure_lsp.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
(defn args
2121
[command-and-options project-settings]
2222
(cond
23-
(and (not-empty project-settings) (has-settings? command-and-options))
23+
(and (not-empty project-settings)
24+
(has-settings? command-and-options))
2425
(args-with-merged-settings command-and-options project-settings)
2526

2627
(not-empty project-settings)
27-
(concat command-and-options ["--settings" (str project-settings)])
28+
(concat command-and-options ["--settings" (str (:settings project-settings))])
2829

2930
:else
3031
command-and-options))

test/leiningen/clojure_lsp_test.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns leiningen.clojure-lsp-test
2-
(:require [clojure.test :refer :all]
3-
[leiningen.clojure-lsp :as clojure-lsp]))
2+
(:require
3+
[clojure.test :refer :all]
4+
[leiningen.clojure-lsp :as clojure-lsp]))
45

56
(deftest args-test
67
(testing "Should return the arguments when project settings is an empty map"
@@ -13,7 +14,7 @@
1314

1415
(testing "Should return the arguments when there is project settings"
1516
(is (= ["diagnostics" "--settings" "{:foo 1}"]
16-
(clojure-lsp/args ["diagnostics"] {:foo 1}))))
17+
(clojure-lsp/args ["diagnostics"] {:settings {:foo 1}}))))
1718

1819
(testing "Should return the arguments when there is settings options and also project settings"
1920
(is (= ["diagnostics" "--settings" "{:foo 1, :bar \"Test\"}"]

0 commit comments

Comments
 (0)