andywang425 / vscode-scriptmonkey

Userscript language support extension for vscode.
https://marketplace.visualstudio.com/items?itemName=andywang.vscode-scriptmonkey
MIT License
23 stars 3 forks source link

CSS highlight in "addStyle" #9

Closed onsamyj closed 1 year ago

onsamyj commented 1 year ago

In "addStyle" CSS doesn’t get proper syntax highlight.

I use GM_addStyle(` `), there are other ways to do that, but I have not tested them.

andywang425 commented 1 year ago

Are you looking for something like this? image That's a good idea. I'll try to implement this feature in a future release.

onsamyj commented 1 year ago

Exactly! Thank you :)

andywang425 commented 1 year ago

Finally done, though it doesn't look as good as expected:

onsamyj commented 1 year ago

Because it seems like it uses slightly different rules than regular CSS highlighting?

Code_vgVU7yXyTg ← Userscript | plain CSS →

Anyway, I like it! But feel free to tinker some more if you want :)

andywang425 commented 1 year ago

Thanks! Handling embedded languages is not easy. Maybe I will improve it in the future.
I'm glad you like it :)