Closed avatar-lavventura closed 3 years ago
If you are using lsp-mode
and enable flycheck
or flymake
, the warnings/errors will be displayed. It's not related to lsp-python-ms
.
@seagle0128 I am using lsp-mode
along with flycheck
but the warning for No definitions found for: foo
does not show up. Not sure how should I make a setting for this or not?
Sorry I will close the issue here than and will ask on flycheck
since it is not related to lsp-mode
Are you using lsp-python-ms
and installed mspyls correctly?
I have installed it using which is added to my init.el
file:
(use-package lsp-python-ms
:ensure t
:init (setq lsp-python-ms-auto-install-server t)
:hook (python-mode . (lambda ()
(require 'lsp-python-ms)
(lsp)))) ; or lsp-deferred
The way I am using python-language-server
as explained as on my question, but I believe its not microsoft's.
Please see my init.el file: https://github.com/avatar-lavventura/dotfiles/blob/main/.emacs
init.el file contains only (use-package python :ensure nil)
line.
Try reinstalling mspyls
with M-x lsp-python-ms-update-server
.
I couldn't find any package called lsp-python-ms-update-server
in the M-x : package-reinstall
or package-install
I mean installing lsp server with the command M-x lsp-python-ms-update-server
. Please read the README.
@seagle0128 Thanks after installation would it show the warning messages that I asked on my question, please note that it does not?
I have been told that its not possible from many different sources: https://stackoverflow.com/q/66735243/2402577
Python really is not easy to statically analyze. I would be pretty surprised if a linter could do this for anything but the simplest cases.
So your question is for mspyls, while not for lsp-python-ms, if it works well.
Sorry I just get lost. For both lsp-python-ms
and mspyls
I was not able to find a solution.
Quick question, are you able to use mypyls for vscode to get this warning? If yes, it's an issue of lsp-python-ms
, otherwise it's for mypyls itself.
I am using lsp for Python. I was wondering for an object's function, if there is no definition for it, can
lsp
give an error/warning or underline it like flycheck does?example python code:
Since
foo()
is not an object underWorld
; I wantlsp
to give me a warning message letting me know that that function does not exist.Example configuration could be seen here: https://github.com/rksm/emacs-rust-config
Comment out the lines
9..35
and48
and add the following(use-package python :ensure nil)
save and install packages. Then open a python file, and M-x lsp to start lsp,