Summarize the contents of a file using the embedding query
This commit is contained in:
@@ -8,8 +8,8 @@ use crate::{
|
||||
language_settings::{language_settings, LanguageSettings},
|
||||
outline::OutlineItem,
|
||||
syntax_map::{
|
||||
SyntaxLayerInfo, SyntaxMap, SyntaxMapCapture, SyntaxMapCaptures, SyntaxSnapshot,
|
||||
ToTreeSitterPoint,
|
||||
SyntaxLayerInfo, SyntaxMap, SyntaxMapCapture, SyntaxMapCaptures, SyntaxMapMatches,
|
||||
SyntaxSnapshot, ToTreeSitterPoint,
|
||||
},
|
||||
CodeLabel, LanguageScope, Outline,
|
||||
};
|
||||
@@ -2467,6 +2467,14 @@ impl BufferSnapshot {
|
||||
Some(items)
|
||||
}
|
||||
|
||||
pub fn matches(
|
||||
&self,
|
||||
range: Range<usize>,
|
||||
query: fn(&Grammar) -> Option<&tree_sitter::Query>,
|
||||
) -> SyntaxMapMatches {
|
||||
self.syntax.matches(range, self, query)
|
||||
}
|
||||
|
||||
/// Returns bracket range pairs overlapping or adjacent to `range`
|
||||
pub fn bracket_ranges<'a, T: ToOffset>(
|
||||
&'a self,
|
||||
|
||||
Reference in New Issue
Block a user