emacs-lsp / lsp-python-ms

lsp-mode :heart: Microsoft's python language server
https://emacs-lsp.github.io/lsp-python-ms
BSD 3-Clause "New" or "Revised" License
189 stars 41 forks source link

All symbols in file called "Variable" in completions #116

Closed jsigman closed 4 years ago

jsigman commented 4 years ago

This is very snappy and almost a great replacement for pyls, however there are still some ways that I need to fix my configuration of this package.

Right now, all symbols in the python file I'm editing show as "Variable". This happens whether I use capf backend of company-lsp backend to company. Clearly, the server can see that Foo is a class, and not a variable, because it outputs information. See screenshots below.

Screen Shot 2020-07-23 at 10 21 36 PM Screen Shot 2020-07-23 at 10 21 02 PM
jsigman commented 4 years ago

It is clear that the server and company-backend are capable of identifying methods, classes, etc. It just never assigns these labels for the source files that I'm editing...

Screen Shot 2020-07-24 at 10 38 27 AM

seagle0128 commented 4 years ago

I think it's the behavior of mspyls itself.

jsigman commented 4 years ago

Right... do you know why that would be, is mypyls misconfigured? In VSCode, it would correctly identify these things

seagle0128 commented 4 years ago

Did you try with VSCode? It's same in my env.

jsigman commented 4 years ago

In this simple example, VSCode is capable of distinguishing different entities. classes, variables, and methods

Screen Shot 2020-07-24 at 11 14 55 AM

Screen Shot 2020-07-24 at 11 15 03 AM

Screen Shot 2020-07-24 at 11 15 12 AM

jsigman commented 4 years ago

This is quite a strange issue, and seems to be quite a breaking issue. Generally, I want intelligent completions from the source files I'm editing, and not merely the packages in my virtual environment. I don't know why it would treat these two things differently

seagle0128 commented 4 years ago

It may be a configuration issue but not very sure. I am looking into it.

BTW, we are working on the new client https://github.com/emacs-lsp/lsp-pyright, which is a better choice in future.

jsigman commented 4 years ago

Awesome. Thanks for all that you do. I think that actually it's still quite workable how it is. I'll look into pyright.