From b959162ceb41d891c8b5fad6145ca5d1a4964a54 Mon Sep 17 00:00:00 2001 From: Luke Halasy Date: Sun, 10 Sep 2023 08:57:44 -0400 Subject: Add tree-sitter-highlight-name command (#8170) * 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--- helix-view/src/theme.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index a288ae9a..4acc5664 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -297,6 +297,11 @@ impl Theme { self.highlights[index] } + #[inline] + pub fn scope(&self, index: usize) -> &str { + &self.scopes[index] + } + pub fn name(&self) -> &str { &self.name } -- cgit v1.2.3-70-g09d2