Closed arobinson closed 7 months ago
I don't see a syntax error here, are you referring to the coloring?
I believe that's handled by VS Code's TextMate grammar for Python, but I do not see this when I write the same code:
But, you're also missing any sort of coloring at all on the variables, which implies there's something else wrong.
Without bracket pair colorization:
Thanks for the report. Could you please add the information in the report as described in the troubleshooting guide?
I'll check my extensions, but in my screen shot you will see the closing parenthesis in red instead of yellow
the coloring issue is on textmate. except that, I dont see any issue on the repro code. parser is parsing the code correctly.
Resolving as a dupe of https://github.com/microsoft/vscode/issues/225179. This is the original issue, but https://github.com/microsoft/vscode/issues/225179 is being actively investigated.
python.languageServer
setting: Pylance[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
Should correctly parse f-strings with escape sequences
Actual behaviour
Shows an error with a valid f-string
Steps to reproduce:
Add this code to a py file:
In this case
{{
is the expected python escape sequence to be able to add a{
to the output, but VS code is expecting it to be a variable substitution. The code works as expected while executing through the python without errors, it is only the editor showing that the valid syntax is invalid that is the problemLogs