[python] syntax highlighting breaks on function annotations
See original GitHub issueFrom @doug-numetric on July 3, 2018 23:7
- VSCode Version: 1.24.1
- OS Version: macOS 10.13.5
Steps to Reproduce:
- Create a new file:
test.py
- Paste in the following text:
def test() -> None:
# Broken comment highlighting
if True:
print('The if statement above isn't highlighting either. Same goes for this string')
Does this issue occur when all extensions are disabled?: Yes
Appears to be a regression of: https://github.com/Microsoft/vscode/issues/1467
Copied from original issue: Microsoft/vscode#53509
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
[python] syntax highlighting breaks on function annotations
At some point recently, Python syntax highlighting went awry: Specifically, it looks like function annotations in Python 3 mess it up.
Read more >Syntax highlighting not working for Python in VS Code with ...
Has anyone had any success with formatting Python type annotations in Visual Studio Code and what settings are you using? UPDATE: This does...
Read more >[VSCODE] Broken Syntax Highlighting When Add Func Return ...
When you write a function/method in vscode Python editor, and put arrow to mark that the function returns value -> , the arrow...
Read more >PEP 8 – Style Guide for Python Code
In Python code, it is permissible to break before or after a binary operator, as long as the convention is consistent locally. For...
Read more >Semantic Highlight Guide | Visual Studio Code Extension API
A guide to syntax highlighting. ... TextMate grammars work on a single file as input and break it up based on lexical rules...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@1st1 Sorry for the noise and thanks for the direction. I tried disabling python related extensions one by one to find what may have exposed the issue. It appears to have been caused by the
Python for VSCode 0.2.3
extension. Highlighting worked correctly after I uninstalled that.I find it strange that I still had the issue when I launched vscode with extensions disabled – but that’s another issue.
Yep. I referenced the parent Microsoft/vscode issue from a related issue in that extension’s repo: https://github.com/tht13/Python-vscode/issues/21