[SOLVED] Syntax highlighting for python "fstrings"


#1

Hi guys

i’m just playing around with python 3.6 “fstrings” and noticed that they will not get highlighted correctly
ex.

x=99
print(f"foo {x}")

i’ve installed MagicPython and got this now:
fstring

while this is better than the default highlighting package (it now highlights the brackets) it does still not highlight the leading “f”.

Anyone found another package or tweak for this?

greetings mosss


#2

Hello.

It is identified correctly, just not coloured with an individual colouring.
Try the following in your style sheet (styles.less) -

.syntax--storage.syntax--type.syntax--string.syntax--python.string.syntax--quoted.syntax--single.syntax--python.string.syntax--interpolated.syntax--python {
  color: yellow
}

image

BR


#3

Did you notify the authors of those highlighting package of the change?


#4

To whom did you direct this question to?

From my side I should mention that my suggestion was directed to the custom user style sheet and not to the one in the package. I should not have assumed that the topic starter would know that this is what I aimed for.

The MagicPython package already identify the syntax. It is the theme that needs to make provision for this change “new” syntax addition.


#5

worked perfectly ty! :slight_smile:


#6

am i blind or is there really no “accept answer” / “close topic”-like function on this Forum? :smile:


#7

Your ‘eye-sight’ is 20:20.
You could change the title of the topic. Perhaps add (Solved) to the title.