@@ -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