Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Language Server Features (autocomplete & inlay hints) #306

Open
munro opened this issue Jun 20, 2024 · 2 comments
Open

Missing Language Server Features (autocomplete & inlay hints) #306

munro opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed

Comments

@munro
Copy link

munro commented Jun 20, 2024

There are a lot of things that are working, so this is a really great extension! But I noticed some helpful features are still missing.

Autocomplete on imports

It would be really nice if we could autocomplete imports from mypy!

mypy

image

pylance

image

Autocomplete on objects

This may be relayed to the previous, but also getting autocompletes on objects as well

mypy

image

pylance

image

Inlay hints

Inlay hint support would be really great too 🥲

image

mypy

(notice no inlay hints)
image

pylance

image

String interpolation shows wrong type

And this was a subtle issue I noticed, it shows the wrong type when hovering over a variable used in string interpolation.

  • (variable) foo: int is from PyLance
  • and mypy: str is from MyPy.

foo is an int, so it should show int. It appares mypy is showing the coerced type of the variable.

image
@munro munro added the bug Issue identified by VS Code Team member as probable bug label Jun 20, 2024
@munro munro changed the title Missing Language Server Features (autocomplete, inlay hints, Missing Language Server Features (autocomplete & inlay hints) Jun 20, 2024
@karthiknadig karthiknadig self-assigned this Jun 20, 2024
@karthiknadig
Copy link
Member

@munro Can you provide the list of extension that you have installed? You should be able to get a list from ~/.vscode/extensions directory or you can run "Open Extensions Folder" command from VS Code.

@Mutantpenguin
Copy link
Contributor

Mutantpenguin commented Sep 3, 2024

@munro This is the description of mypy from its website itself:

Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and compile-time type checking. Mypy type checks standard Python programs; run them using any Python VM with basically no runtime overhead.

mypy does just static type checking and is (AFAIK) not suitible as a language server so your feature requests are unsuitable for this extension.

Stay with Pylance for this and use both together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed
Projects
None yet
Development

No branches or pull requests

3 participants