-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dynamic access of CSS module classes #86
Comments
@strlns Thanks for opening the issue. I do like your ideas ,
This could be achieved through a typescript server plugin by intercepting the editor actions such as hover and definition.
This might be a littler easier to compute thus requiring less effort. I will try to resolve this sooner in the meantime if you'd like to contribute feel free to open a PR |
This turned to be quite easy to plug in. So it should be fixed by #87 In the future it might be possible to provided some nice solution to the first idea you presented. I can open a new issue by listing out various possible actions that can happen applied to dynamic selectors |
Nice! |
Is your feature request related to a problem? Please describe.
Admittedly this is an edge case and probably hard to implement, but if I do something like
, VSCode flags it as a "problem":
Describe the solution you'd like
Ideal solution:
Probably you'd need to use VSCode's TypeScript language server to try and statically analyze if the given
string corresponds to a valid selector. This might be overly expensive or hard to implement, I'm not sure.
Pragmatic solution
Detect dynamic property access and print a different or no warning in this case. Also, the warning seems to assume
size
is used as a literal property name in my example, which it definitely is not.Differentiating dynamic and static access would allow me to disable the warning for dynamic property access, but still benefit from the warning for a static selector.
Describe alternatives you've considered
Additional context

The text was updated successfully, but these errors were encountered: