monokai-pro / vscode

Issue tracking for Monokai Pro for Visual Studio Code
https://monokai.pro
327 stars 7 forks source link

String template-literal in JS files does not change its color #332

Open BarCoP opened 1 year ago

BarCoP commented 1 year ago

Hello,

I have been using the beautiful Monokai Pro (v1.2.0) and I have noticed that whenever I use string template literals in string phrases in JS files, Monokai does not color the template literal in the string in order to distinguish them from the rest of the string:

image

The phrase '${}' which contains the template literal should have a different color (usually a red color) and not be colored the same as the rest of the string (yellow).

I hope you can add an update that colors the relevant expression and distinguishes it from the rest of the string.

Thanks :)

BarCoP commented 1 year ago

I can add that if I close the .js file and reopen it, it can be seen that the '${}' is colored with another color (green in the example above) but after half of a second, Monokai Pro colors it with yellow to be the same color as the rest of the string.

the setting of my .json file is: image

template literal change its color

BarCoP commented 1 year ago

I see that this issue has been opened before: https://github.com/microsoft/vscode/issues/141321

I hope that you can add this fix, would help programs that using Monokai pro to distinguish template-literal more clearly than the current state.

BarCoP commented 1 year ago

It appears that when I wrap the expression with parentheses:

image

The dynamic expression in the template literal is colored.

However, if I use VScode with the Prettier extension (which I do),

It automatically removes the parentheses which I added to wrap the expression and causes the problem I talk about. If I disable Prettier

It solves the problem.

That behavior seems very odd to me.

BarCoP commented 1 year ago

Another progress: if I add curly braces, Monokai detects and colors the expression: image

without it, the expression is not colored: image

Hope this example will help to understand the problem here(and by the way I notice the typo I had in "transform" and "transfrom" 😁

GatinSDK commented 1 year ago

I just fix it turning on these two options image

BarCoP commented 1 year ago

Thanks a lot! I have another question: in Monokai Pro, the saved word for public library does not color in blue (such as 'console', 'Math' etc and stays in white color.

Would you happen to know how I can fix it? image