Python-vscode icon indicating copy to clipboard operation
Python-vscode copied to clipboard

Syntax highlighting incorrect for methods with type hinting for complex return with this loaded.

Open bedge opened this issue 6 years ago • 13 comments

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

screen shot 2018-10-02 at 4 50 22 pm

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

bedge avatar Oct 03 '18 00:10 bedge

I believe I am having a similar issue, but it occurs for "simple" return types.

This appears to be correctly highlighted: Screen Shot 2020-08-24 at 7 55 55 PM ... then with a return type annotation, highlight does not appear correct: Screen Shot 2020-08-24 at 7 56 30 PM

thomasmatecki avatar Aug 25 '20 00:08 thomasmatecki

Same issue here, does anyone have a solution for this issue? I've uninstalled the package...

mxmaxime avatar Sep 19 '20 19:09 mxmaxime

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.

thomasmatecki avatar Sep 20 '20 02:09 thomasmatecki

I have a similar issue image

zlatko-minev avatar Oct 05 '20 02:10 zlatko-minev

Any updates on this?

Servot avatar Feb 22 '21 11:02 Servot

Have similar issue.

vkresch avatar Apr 05 '21 17:04 vkresch

+1

ikariwing avatar Mar 23 '22 10:03 ikariwing

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.

reporter123 avatar Mar 25 '22 17:03 reporter123

Thanks, @reporter123 - this just helped me. Disabled the plug in

evanstjabadi avatar Mar 28 '22 12:03 evanstjabadi

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 avatar Apr 09 '23 21:04 techfreaque

@techfreaque this bug isn't even about linting and is several years old.

reporter123 avatar Apr 10 '23 00:04 reporter123

Similar issue here. I think the bug is still not fixed. Does it means that VScode dosen't recommend us to use the annotation?

overwenyan avatar Mar 26 '24 19:03 overwenyan

Thanks @reporter123. After uninstall the outdated Python for VScode, everything is fixed.

overwenyan avatar Mar 26 '24 19:03 overwenyan