Skip to content

Commit 42b0e44

Browse files
committed
treewide: do not overwrite lsp-client-settings changed by user
If a user has set a setting inside `lsp-client-settings`, changing its value will result in a silent bug in user configuration, that looks like a regression from `lsp-mode` mode update. Let's avoid that by adding a new function `lsp-register-new-settings` that avoids overwritting whatever was set by user and make use of it treewide. While at it, prohibit `lsp-register-custom-settings` from internal use for all the same reasons. Fixes: #4420
1 parent 5b01984 commit 42b0e44

35 files changed

+65
-39
lines changed

clients/lsp-ansible.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Python virtual environment."
188188
'(:npm :package "@ansible/ansible-language-server"
189189
:path "ansible-language-server"))
190190

191-
(lsp-register-custom-settings
191+
(lsp-register-new-settings
192192
'(("ansible.ansible.path" lsp-ansible-ansible-path)
193193
("ansible.ansible.useFullyQualifiedCollectionNames" lsp-ansible-use-fully-qualified-collection-names t)
194194
("ansible.validation.enabled" lsp-ansible-validation-enabled t)

clients/lsp-css.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ server."
198198
(const "messages")
199199
(const "verbose")))
200200

201-
(lsp-register-custom-settings
201+
(lsp-register-new-settings
202202
'(("css.trace.server" lsp-css-trace-server)
203203
("css.lint.unknownAtRules" lsp-css-lint-unknown-at-rules)
204204
("css.lint.idSelector" lsp-css-lint-id-selector)

clients/lsp-elixir.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ be available here: https://github.com/elixir-lsp/elixir-ls/releases/"
169169
:binary-path lsp-elixir-server-command
170170
:set-executable? t))
171171

172-
(lsp-register-custom-settings
172+
(lsp-register-new-settings
173173
'(("elixirLS.dialyzerEnabled" lsp-elixir-dialyzer-enabled t)
174174
("elixirLS.dialyzerWarnOpts" lsp-elixir-dialyzer-warn-opts)
175175
("elixirLS.dialyzerFormat" lsp-elixir-dialyzer-format)

clients/lsp-fsharp.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ available, else the globally installed tool."
249249
(push '(:AutomaticWorkspaceInit . t) opts)
250250
opts)))
251251

252-
(lsp-register-custom-settings
252+
(lsp-register-new-settings
253253
`(("FSharp.KeywordsAutocomplete" lsp-fsharp-keywords-autocomplete t)
254254
("FSharp.ExternalAutocomplete" lsp-fsharp-external-autocomplete t)
255255
("FSharp.Linter" lsp-fsharp-linter t)

clients/lsp-go.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ $GOPATH/pkg/mod along with the value of
301301
:risky t
302302
:package-version '(lsp-mode "8.0.0"))
303303

304-
(lsp-register-custom-settings
304+
(lsp-register-new-settings
305305
'(("gopls.usePlaceholders" lsp-go-use-placeholders t)
306306
("gopls.hoverKind" lsp-go-hover-kind)
307307
("gopls.buildFlags" lsp-go-build-flags)

clients/lsp-groovy.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
:risky t
4949
:type 'lsp-string-vector)
5050

51-
(lsp-register-custom-settings
51+
(lsp-register-new-settings
5252
'(("groovy.classpath" lsp-groovy-classpath)))
5353

5454
(lsp-register-client

clients/lsp-haxe.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
:type 'string
171171
:group 'lsp-haxe)
172172

173-
(lsp-register-custom-settings
173+
(lsp-register-new-settings
174174
'(("haxe.hxml" lsp-haxe-hxml)
175175
("haxe.postfixCompletion" lsp-haxe-postfix-completion)
176176
("haxe.exclude" lsp-haxe-exclude)

clients/lsp-html.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ styles."
159159
:group 'lsp-html
160160
:package-version '(lsp-mode . "6.1"))
161161

162-
(lsp-register-custom-settings
162+
(lsp-register-new-settings
163163
'(("html.trace.server" lsp-html-trace-server)
164164
("html.autoClosingTags" lsp-html-auto-closing-tags t)
165165
("html.validate.styles" lsp-html-validate-styles t)

clients/lsp-idris.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
:type '(choice (:tag "off" "messages" "verbose"))
4949
:package-version '(lsp-mode . "9.0.0"))
5050

51-
(lsp-register-custom-settings
51+
(lsp-register-new-settings
5252
'(("idris2-lsp.trace.server" lsp-idris2-lsp-trace-server)
5353
("idris2-lsp.path" lsp-idris2-lsp-path)))
5454

clients/lsp-javascript.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ name (e.g. `data' variable passed as `data' parameter)."
648648
:type 'boolean
649649
:package-version '(lsp-mode . "9.0.0"))
650650

651-
(lsp-register-custom-settings
651+
(lsp-register-new-settings
652652
'(("javascript.autoClosingTags" lsp-javascript-auto-closing-tags t)
653653
("javascript.implicitProjectConfig.checkJs" lsp-javascript-implicit-project-config-check-js t)
654654
("javascript.implicitProjectConfig.experimentalDecorators" lsp-javascript-implicit-project-config-experimental-decorators t)

0 commit comments

Comments
 (0)