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

Add tree-sitter-highlight-name command #8170

Conversation

LukeHalasy
Copy link
Contributor

@LukeHalasy LukeHalasy commented Sep 4, 2023

Closes #8123.

Add a command, tree-sitter-highlight-name, that outputs the name of the theming scope needed to modify the look of the node at the cursor's location.

Note: The ``json part that appears in the screenshots below has been addressed
result_1
result_2
result_3

@LukeHalasy LukeHalasy force-pushed the add-treesitter-highlight-name-command branch from 10b933f to 7f53da5 Compare September 4, 2023 19:49
@LukeHalasy LukeHalasy changed the title adds treesitter-highlight-name command Add treesitter-highlight-name command Sep 4, 2023
@LukeHalasy LukeHalasy changed the title Add treesitter-highlight-name command Add tree-sitter-highlight-name command Sep 4, 2023
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm liking the approach here, it just needs a few tweaks

helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
helix-core/src/syntax.rs Outdated Show resolved Hide resolved
helix-core/src/syntax.rs Outdated Show resolved Hide resolved
helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
@LukeHalasy
Copy link
Contributor Author

I'm liking the approach here, it just needs a few tweaks

Appreciate the review! Have implemented all suggested tweaks (The ? operator is awesome).

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Sep 6, 2023
@frou
Copy link

frou commented Sep 9, 2023

Thanks so much for implementing this. Without it, it is really laborious to tweak one's custom theme to get things looking just right.

@pascalkuthe pascalkuthe merged commit b959162 into helix-editor:master Sep 10, 2023
6 checks passed
acristoffers pushed a commit to acristoffers/helix that referenced this pull request Nov 18, 2023
* adds treesitter-highlight-name command

* commit documentation changes

* moves the get_highlight_name function into core/syntax

* rename get_highlight_name function to get_highlight_for_node_at_position

* addresses pr comments: moves fn into helper fn, simplifies a lot

* commit updated documentation changes

* changes scope method to return &str so that callers can decide whether or not to own
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
* adds treesitter-highlight-name command

* commit documentation changes

* moves the get_highlight_name function into core/syntax

* rename get_highlight_name function to get_highlight_for_node_at_position

* addresses pr comments: moves fn into helper fn, simplifies a lot

* commit updated documentation changes

* changes scope method to return &str so that callers can decide whether or not to own
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tree-sitter-highlight-name command for viewing highlight name of node at the cursor's location
4 participants