semshi icon indicating copy to clipboard operation
semshi copied to clipboard

f-strings interpolation is not highlighted as code

Open bew opened this issue 5 years ago • 3 comments

Hello, I noticed that the new format strings are not highlighted using semchi:

This is what I have using semchi: image bar is not highlighted differently from the string around it, it's not clear that there is an interpolation or not here. When the interpolation has some special words (var not defined, self, ..), it is highlighted though, but it's minimal: image

This is what I had using the plugin python-syntax only: image It's slightly better

I think the braces should be highlighted like normal parentheses, and the interpolation code like normal code if possible.


There are similar issues about incorrect highlighting offsets in f-strings, but I think this is different, it's more about the interpolation code that is highlighted like a string and not as code.

bew avatar Feb 12 '20 13:02 bew

I think this is a duplicate of #31. @numirias said it is due to a Python bug; refer to the thread for details.

wookayin avatar Mar 10 '20 02:03 wookayin

I've read #31 but I think it's different, there is no highlight in my case, and when something is highlighted there is no offset problem (unless it's in a multiline f-string, but then it's definitely #31).

bew avatar Mar 10 '20 09:03 bew

I have the same issue (not highlighting for f-strings) and agree that it is a major problem. Probably have to use python-syntax instead, even though it is generally inferior.

willir avatar Dec 25 '20 22:12 willir