vscode-styled-components
vscode-styled-components copied to clipboard
[Feature Request] - Syntax highlighting for custom tags
Basically an extension of this issue: https://github.com/styled-components/vscode-styled-components/issues/224
Apparently the intellisense is with the TS compiler and can be configured there, but the syntax highlighting is handled by this plugin so setting custom tags in tsconfig.json has no effect on the syntax highlighting.
Is there a reason for this? Can we not just add a VS Code setting or whatever that allows you to set custom tags? Seems like a much better way of doing it than hard-coding tag names for every styled-components-style library under the sun (there are so many now!)
@acnebs it may be possible with https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide
would you be interested in investigating that? It won’t be something I’ll ever get round to doing
@acnebs
It looks like you could just modify the first part of this regex, you can see where it spells out "styled":
https://github.com/styled-components/vscode-styled-components/blob/master/syntaxes/styled-components.json
Should be easy to generate that portion of the regex from a list of keywords but not sure how much work making a settings page that writes to this JSON is.
@acnebs It looks like you could just modify the first part of this regex, you can see where it spells out "styled":
https://github.com/styled-components/vscode-styled-components/blob/master/syntaxes/styled-components.json
Should be easy to generate that portion of the regex from a list of keywords but not sure how much work making a settings page that writes to this JSON is.
That is a static file which is written and compiled ahead of time. It can’t be modified on the fly depending on the users settings. So that idea won’t work