python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

Support python2 style type hints for intellisense

Open qu1ck opened this issue 6 years ago • 5 comments

Issue Type: Feature Request

Intellisense for python is able to understand python3 style inline type hints but not python2 style comment type hints.

Extension version: 2019.10.44104 VS Code version: Code 1.40.1 (8795a9889db74563ddd43eb0a897a2384129a619, 2019-11-13T16:49:30.162Z) OS version: Linux x64 4.19.67-2rodete2-amd64

Here are screenshots for the problem. Type hints not working:

img

Type hints working: img

qu1ck avatar Nov 18 '19 00:11 qu1ck

@qu1ck Are you using jedi or Language Server? Check your settings and see if jediEnabled is set.

karthiknadig avatar Nov 18 '19 20:11 karthiknadig

@karthiknadig I'm not using jedi.

qu1ck avatar Nov 22 '19 23:11 qu1ck

This would be 💯. Unfortunately my company still has a bunch of legacy code in Python 2, and although we try to use type comments wherever I always get sad when I switch over to one of these projects and lose autocomplete/jump-to-def (I use https://github.com/emacs-lsp/lsp-python-ms/)

jdormit avatar Sep 22 '20 20:09 jdormit

This is unlikely to happen. We are mostly working on Pylance LS (which does not support Python 2) and Python 2 is at the end of life. For Python 2 Jedi is the option.

MikhailArkhipov avatar Sep 22 '20 20:09 MikhailArkhipov

Feasibly you can run pyright (the core of pylance) in emacs, as it supports these sorts of annotations as of last month, but that's not really a supported method.

jakebailey avatar Sep 22 '20 20:09 jakebailey