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

Resolve selectors using AST of language service #37

Closed
Viijay-Kr opened this issue Jan 12, 2023 · 0 comments · Fixed by #40
Closed

Resolve selectors using AST of language service #37

Viijay-Kr opened this issue Jan 12, 2023 · 0 comments · Fixed by #40
Labels
enhancement New feature or request
Milestone

Comments

@Viijay-Kr
Copy link
Owner

During the investigation of #18 , it's quite evident that the selectors resolution namely the suffix selectors resolution doesn't seem to be 100% bullet proof.

It encounters various issues besides the conflicting names with other selectors in the module.

Approach 1

Custom Tree traversal Algorithm

With the AST available (generated by vcode-css-langaugeservice) it should be possible to create an algorithm that traverses the AST and computes the nested selectors on every entry.

So on start up , a custom data structure that can hold the following information

  1. Selector
  2. Sibling Selectors
  3. Child Selectors: [Suffixes,Normal Selectors]
    in one single HashMap would be ideal and quick for resolution inside the tsx modules.

Challenges

To traverse the AST, there is no function/utility provided by vscode-language-service
Ideally a traverse mechanism should be written from scratch , that should also include type definitions.

@Viijay-Kr Viijay-Kr added this to the backlog milestone Jan 12, 2023
@Viijay-Kr Viijay-Kr added the enhancement New feature or request label Jan 15, 2023
Viijay-Kr added a commit that referenced this issue Jan 15, 2023
fixes - #18 
1. TSX and TS parser improvements
2. CSS parser improved by using tree traversal algorithm specified in #37
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