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

Syntax highlighting breaks down if you line break at curly bracket in f-strings #5791

Open
fireattack opened this issue Apr 23, 2024 · 2 comments
Assignees

Comments

@fireattack
Copy link

fireattack commented Apr 23, 2024

Environment data

  • Language Server version: 2024.4.1 (pyright version 1.1.356, commit 6652c4a8)
  • OS and version: Win 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.12

Code Snippet

name = "John"
print(f"My name is {name}, nice to meet you!")

# Syntax highlighting breaks down if you line-break at {
print(f"My name is {
    name}, nice to meet you!")

Repro Steps

  1. Copy the above code into a script file.

Actual behavior

image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Apr 23, 2024
@debonte debonte added textmate bug and removed needs repro Issue has not been reproduced yet labels Apr 23, 2024
@rndninja
Copy link

Any updates on this issue? This is annoying since auto-formatters often line break at the curly braces in f-strings but this messes up the syntax highlighting!

@rchiodo
Copy link
Contributor

rchiodo commented Jan 6, 2025

VS code uses something called Textmate to provide the default colorization of text. It doesn't handle the line feed here. We have plans to replace the use of Textmate, but that's pending VS code providing a new way to provide colorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants