eslint / eslint/code-explorer

Suggestion: Code Explorer AST view should filter nodes matching the ESQuery selector

Open
#473 2 comments 0 reactions 1 assignee Claimed by @DMartens View on GitHub
enhancement
Dominant language
TypeScript
Stars
61
Forks
23
Avg merge
2d 19h
Merged PRs (30d)
24

Description

### What problem do you want to solve?

Currently the ESQuery selector above the editor highlights the text of the matching nodes but the matched nodes may be hard to find in the AST view.

### What do you think is the correct solution?

I think the ESQuery selector should also be used to filter the AST view only showing matching nodes similar to the [typescript-eslint playground](https://typescript-eslint.io/play/#ts=5.9.2&showAST=es&fileType=.tsx&esQuery=N4IgZglgNgLgpgJxALhAMQK4DsDGMID2WAInDlAIYIX5EgA0IAznFGTAUsqDAJ4AOcFCAgATOFnyREDEADcKUDENSZctEmUrUNIAL56gA&code=GYVwdgxgLglg9mABMMAKAlIg3ogvgKHw0QF4A%2BbPIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false).
This could be done either automatically in the "Tree" view if the selector is set or by an additional AST view (current AST views are "Tree" and "JSON").

### Participation

- [x] I am willing to submit a pull request for this change.

### AI acknowledgment

- [x] I did not use AI to generate this issue report.
- [ ] (If the above is not checked) I have reviewed the AI-generated content before submitting.

### Additional comments

The idea came from testing the markdown parser with selector `:not([position])` to find nodes without location information. The problem is they cannot be highlighted because of the missing location information. This means even if #64 (going to node by clicking on the respective code) is resolved, it would not help in this situation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.