Skip to content
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

Reference Provider For Selectors #74

Closed
Viijay-Kr opened this issue Feb 2, 2023 · 0 comments · Fixed by #75
Closed

Reference Provider For Selectors #74

Viijay-Kr opened this issue Feb 2, 2023 · 0 comments · Fixed by #75
Assignees
Labels
enhancement New feature or request

Comments

@Viijay-Kr
Copy link
Owner

Is your feature request related to a problem? Please describe.

Most often you end up in a css file checking your selectors in your css modules and wonder where they are being used/referenced.

One quick way to check this is by doing a search.
This does help however it cannot do anything more than what a reference provider could do.

Describe the solution you'd like

Reference Provider is the solution to this problem.

vscode-csslanguage-service offers the references of variables/mixins/and functions within the scope CSS language features

Providing references to selectors will be so much useful when dealing with large projects.
So any selector inside a module should be able to refer to its references across ts/tsx files.

In order to achieve this , there are certain things that needs to be considered before implementing this.

To be able to find all the references of a selector across all the ts/tsx modules its important to find out the files that references the entire module.

for instance

// in some_component.tsx
import styles from './some_module.css'

With this knowledge its easy to link a module with its references, there by storing the babel parser result of the referencing module (if it's not already parsed)

NOTE: Its quite critical not to have any cyclic references between a TS and CSS module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant