Python-vscode
Python-vscode copied to clipboard
Syntax highlighting incorrect for methods with type hinting for complex return with this loaded.
With this extension loaded, the syntax highlighting breaks for methods with a non-scalar type-annotated ret val.
I disabled all extensions one at a time and confirmed that this is the one triggering the behavior.
The problem does not occur with this extension disabled.
VS Code version: Version 1.28.0-insider (1.28.0-insider) vsc python Extension version: 2018.8.0 vsc magicpython Extension version: 1.0.12 vsc Python for VSCode Extension version: 0.2.3 OS and version: MacOS High Sierra 10.13.6 (17G65) Python version (& distribution if applicable, e.g. Anaconda): Virtualenv 3.6 Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
Expected behavior get_args method comment, and string should be formatted as they are in get_args_no_hints
Steps to reproduce: Add type hints to method. The return value of anything other than a simple scalar causes this.
Microsoft/vscode-python#2768 https://github.com/MagicStack/MagicPython/issues/162
I believe I am having a similar issue, but it occurs for "simple" return types.
This appears to be correctly highlighted:
... then with a return type annotation, highlight does not appear correct:
Same issue here, does anyone have a solution for this issue? I've uninstalled the package...
I haven't dug too far into the weeds on this, but the after disabling the Python for VS Code extension, the issue is gone for me.
It is not obvious to me why this would interfere with syntax highlighting provided by the Python or MagicPython extensions.
I have a similar issue
Any updates on this?
Have similar issue.
+1
Python for VS Code tries to ship its own syntax highlighting which happens to override syntax files provided by other extensions if they load first. Syntax file in Python for VS Code should be removed or updated to match upstream.
Thanks, @reporter123 - this just helped me. Disabled the plug in
I still have the issue. I disabled all extension and resetted to defaults. Linting doesnt work for imports (local and installed packages) and class methods
@techfreaque this bug isn't even about linting and is several years old.
Similar issue here. I think the bug is still not fixed. Does it means that VScode dosen't recommend us to use the annotation?
Thanks @reporter123. After uninstall the outdated Python for VScode
, everything is fixed.