Skip to content

Add tree-sitter-highlight-name command - #8170

Merged
pascalkuthe merged 7 commits into
helix-editor:masterfrom
LukeHalasy:add-treesitter-highlight-name-command
Sep 10, 2023
Merged

Add tree-sitter-highlight-name command#8170
pascalkuthe merged 7 commits into
helix-editor:masterfrom
LukeHalasy:add-treesitter-highlight-name-command

Conversation

@LukeHalasy

@LukeHalasy LukeHalasy commented Sep 4, 2023

Copy link
Copy Markdown
Contributor

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

@the-mikedavis the-mikedavis left a comment

Copy link
Copy Markdown
Member

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

Comment thread helix-term/src/commands/typed.rs Outdated
Comment thread helix-core/src/syntax.rs Outdated
Comment thread helix-core/src/syntax.rs Outdated
Comment thread helix-term/src/commands/typed.rs Outdated
Comment thread helix-term/src/commands/typed.rs Outdated
@LukeHalasy

Copy link
Copy Markdown
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).

Comment thread helix-view/src/theme.rs Outdated
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-command Area: Commands labels Sep 6, 2023
@frou

frou commented Sep 9, 2023

Copy link
Copy Markdown

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
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
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 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
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 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