aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorLuke Halasy2023-09-10 12:57:44 +0000
committerGitHub2023-09-10 12:57:44 +0000
commitb959162ceb41d891c8b5fad6145ca5d1a4964a54 (patch)
treeef8f3d0d09c74d8999cd67935845b99f027f3b01 /helix-view/src
parent528a5e3aff011f652b0f3ac3bff61de41a9e05b2 (diff)
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
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/theme.rs5
1 files changed, 5 insertions, 0 deletions
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
}