Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] new support for Python f-strings breaks with multi-line f-strings #4601

Open
2 tasks
dylanscott opened this issue Jul 12, 2024 · 3 comments
Open
2 tasks

Comments

@dylanscott
Copy link

dylanscott commented Jul 12, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Link

CleanShot 2024-07-12 at 11 08 38@2x

Monaco Editor Playground Code

single_line_f_string f'''nothing {'to see'} here'''

multi_line_f_string = f"""first line looks fine
{'uh oh'}
now the highlighting is broken down here :(
"""

also = "it's broken highlighting for everything after"
four = 2 + 2

Reproduction Steps

  1. Configure an editor using the built-in python language
  2. Enter a multi-line f-string which has an expression after the 1st line

Actual (Problematic) Behavior

The portion of the f-string after the expression is highlighted as python code instead of a string, and then the closing f-string delimiter causes code after that to be highlighted as if it were a string

Expected Behavior

Self evident

Additional Context

I believe this was added with #4401, which notably does not have multi-line f-strings in its test coverage.

@ivanksh
Copy link

ivanksh commented Aug 16, 2024

It is reproducible for me too

@rubenfiszel
Copy link

Reproducible for us too at windmill.dev, it seems a pretty severe bug for the editing experience

@PaGrom
Copy link

PaGrom commented Oct 22, 2024

Affects me too.

anton-gogolev added a commit to anton-gogolev/monaco-editor that referenced this issue Oct 25, 2024
Initial support for f-strings was added in
microsoft#4401, but it didn't
support multiline f-strings, as reported in
microsoft#4601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants