Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit b4e6c9b

Browse files
committed
Enable available diagnostic errors and warnings.
1 parent 427891b commit b4e6c9b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lsp-python-ms.el

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,24 @@ other handlers. "
192192
(concat lsp-python-ms-dir "Microsoft.Python.LanguageServer.dll")))
193193
(t (error "Could find Microsoft python language server"))))
194194

195+
196+
;; See https://github.com/microsoft/python-language-server for more diagnostics
197+
(defcustom lsp-mspyls-errors '("unknown-parameter-name"
198+
"undefined-variable"
199+
"parameter-missing"
200+
"positional-argument-after-keyword"
201+
"too-many-function-arguments"
202+
)
203+
"Microsoft Python LSP Error types.")
204+
205+
(defcustom lsp-mspyls-warnings '("unresolved-import"
206+
"parameter-already-specified"
207+
"too-many-positional-arguments-before-star")
208+
"Microsoft Python LSP Warning types.")
209+
210+
(lsp-register-custom-settings '(("python.analysis.errors" lsp-mspyls-errors)))
211+
(lsp-register-custom-settings '(("python.analysis.warnings" lsp-mspyls-warnings)))
212+
195213
(lsp-register-client
196214
(make-lsp-client
197215
:new-connection (lsp-stdio-connection 'lsp-python-ms--command-string)
@@ -204,7 +222,10 @@ other handlers. "
204222
;; TODO handle this more gracefully
205223
("python/reportProgress" 'ignore)
206224
("python/beginProgress" 'ignore)
207-
("python/endProgress" 'ignore))))
225+
("python/endProgress" 'ignore))
226+
:initialized-fn (lambda (workspace)
227+
(with-lsp-workspace workspace
228+
(lsp--set-configuration (lsp-configuration-section "python"))))))
208229

209230
(provide 'lsp-python-ms)
210231

0 commit comments

Comments
 (0)