EvgeniyPeshkov / syntax-highlighter

Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.
https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter
MIT License
210 stars 43 forks source link

Problems with Python highlighting #31

Closed chinalufei closed 3 years ago

chinalufei commented 5 years ago

If my code contains the following code snippets print(f"{aa:#x}") It seems that Python 3.6 f-string is not well supported

EvgeniyPeshkov commented 5 years ago

Hello @chinalufei , You are right, tree-sitter-python currently has a problem with f-strings, even in latest version from npm. The good news is this PR seems to fix it. It's not in package registry yet, I'll try to build parser from master. If it really helps, I'll update and upload new version of extension.

EvgeniyPeshkov commented 5 years ago

Unfortunately, no luck. The latest master version cannot handle such expression either. The problem is # inside interpolation is not treated properly. I've submitted corresponding issue to tree-sitter-python.