Struct zed2::languages::BufferSnapshot
source · pub struct BufferSnapshot {
pub git_diff: BufferDiff,
/* private fields */
}
Fields§
§git_diff: BufferDiff
Implementations§
source§impl BufferSnapshot
impl BufferSnapshot
pub fn indent_size_for_line(&self, row: u32) -> IndentSize
pub fn language_indent_size_at<T>( &self, position: T, cx: &AppContext ) -> IndentSizewhere T: ToOffset,
pub fn suggested_indents( &self, rows: impl Iterator<Item = u32>, single_indent_size: IndentSize ) -> BTreeMap<u32, IndentSize, Global>
pub fn chunks<T>( &self, range: Range<T>, language_aware: bool ) -> BufferChunks<'_> ⓘwhere T: ToOffset,
pub fn for_each_line( &self, range: Range<Point>, callback: impl FnMut(u32, &str) )
pub fn syntax_layers(&self) -> impl Iterator<Item = SyntaxLayerInfo<'_>>
pub fn syntax_layer_at<D>(&self, position: D) -> Option<SyntaxLayerInfo<'_>>where D: ToOffset,
pub fn language_at<D>(&self, position: D) -> Option<&Arc<Language, Global>>where D: ToOffset,
pub fn settings_at<D, 'a>( &self, position: D, cx: &'a AppContext ) -> &'a LanguageSettingswhere D: ToOffset,
pub fn language_scope_at<D>(&self, position: D) -> Option<LanguageScope>where D: ToOffset,
pub fn surrounding_word<T>(&self, start: T) -> (Range<usize>, Option<CharKind>)where T: ToOffset,
pub fn range_for_syntax_ancestor<T>( &self, range: Range<T> ) -> Option<Range<usize>>where T: ToOffset,
pub fn outline(&self, theme: Option<&SyntaxTheme>) -> Option<Outline<Anchor>>
pub fn symbols_containing<T>( &self, position: T, theme: Option<&SyntaxTheme> ) -> Option<Vec<OutlineItem<Anchor>, Global>>where T: ToOffset,
pub fn matches( &self, range: Range<usize>, query: fn(_: &Grammar) -> Option<&Query> ) -> SyntaxMapMatches<'_>
sourcepub fn bracket_ranges<T, 'a>(
&'a self,
range: Range<T>
) -> impl Iterator<Item = (Range<usize>, Range<usize>)> + 'awhere
T: ToOffset,
pub fn bracket_ranges<T, 'a>( &'a self, range: Range<T> ) -> impl Iterator<Item = (Range<usize>, Range<usize>)> + 'awhere T: ToOffset,
Returns bracket range pairs overlapping or adjacent to range
pub fn remote_selections_in_range( &self, range: Range<Anchor> ) -> impl Iterator<Item = (u16, bool, CursorShape, impl Iterator<Item = &Selection<Anchor>>)>
pub fn git_diff_hunks_in_row_range<'a>( &'a self, range: Range<u32> ) -> impl Iterator<Item = DiffHunk<u32>> + 'a
pub fn git_diff_hunks_intersecting_range<'a>( &'a self, range: Range<Anchor> ) -> impl Iterator<Item = DiffHunk<u32>> + 'a
pub fn git_diff_hunks_intersecting_range_rev<'a>( &'a self, range: Range<Anchor> ) -> impl Iterator<Item = DiffHunk<u32>> + 'a
pub fn diagnostics_in_range<'a, T, O>( &'a self, search_range: Range<T>, reversed: bool ) -> impl Iterator<Item = DiagnosticEntry<O>> + 'awhere T: 'a + Clone + ToOffset, O: 'a + FromAnchor + Ord,
pub fn diagnostic_groups( &self, language_server_id: Option<LanguageServerId> ) -> Vec<(LanguageServerId, DiagnosticGroup<Anchor>), Global>
pub fn diagnostic_group<'a, O>( &'a self, group_id: usize ) -> impl Iterator<Item = DiagnosticEntry<O>> + 'awhere O: 'a + FromAnchor,
pub fn diagnostics_update_count(&self) -> usize
pub fn parse_count(&self) -> usize
pub fn selections_update_count(&self) -> usize
pub fn file(&self) -> Option<&Arc<dyn File, Global>>
pub fn resolve_file_path( &self, cx: &AppContext, include_root: bool ) -> Option<PathBuf>
pub fn file_update_count(&self) -> usize
pub fn git_diff_update_count(&self) -> usize
Methods from Deref<Target = BufferSnapshot>§
pub fn as_rope(&self) -> &Rope
pub fn remote_id(&self) -> u64
pub fn replica_id(&self) -> u16
pub fn row_count(&self) -> u32
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn chars(&self) -> impl Iterator<Item = char>
pub fn chars_for_range<T>(&self, range: Range<T>) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chars_for_range<T>( &self, range: Range<T> ) -> impl Iterator<Item = char>where T: ToOffset,
pub fn contains_str_at<T>(&self, position: T, needle: &str) -> boolwhere T: ToOffset,
pub fn common_prefix_at<T>(&self, position: T, needle: &str) -> Range<T>where T: ToOffset + TextDimension,
pub fn text(&self) -> String
pub fn line_ending(&self) -> LineEnding
pub fn deleted_text(&self) -> String
pub fn fragments(&self) -> impl Iterator<Item = &Fragment>
pub fn text_summary(&self) -> TextSummary
pub fn max_point(&self) -> Point
pub fn max_point_utf16(&self) -> PointUtf16
pub fn point_to_offset(&self, point: Point) -> usize
pub fn point_utf16_to_offset(&self, point: PointUtf16) -> usize
pub fn unclipped_point_utf16_to_offset( &self, point: Unclipped<PointUtf16> ) -> usize
pub fn unclipped_point_utf16_to_point( &self, point: Unclipped<PointUtf16> ) -> Point
pub fn offset_utf16_to_offset(&self, offset: OffsetUtf16) -> usize
pub fn offset_to_offset_utf16(&self, offset: usize) -> OffsetUtf16
pub fn offset_to_point(&self, offset: usize) -> Point
pub fn offset_to_point_utf16(&self, offset: usize) -> PointUtf16
pub fn point_to_point_utf16(&self, point: Point) -> PointUtf16
pub fn version(&self) -> &Global
pub fn chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chars_at<T>(&self, position: T) -> impl Iterator<Item = char>where T: ToOffset,
pub fn reversed_chunks_in_range<T>(&self, range: Range<T>) -> Chunks<'_> ⓘwhere T: ToOffset,
pub fn bytes_in_range<T>(&self, range: Range<T>) -> Bytes<'_> ⓘwhere T: ToOffset,
pub fn reversed_bytes_in_range<T>(&self, range: Range<T>) -> Bytes<'_> ⓘwhere T: ToOffset,
pub fn text_for_range<T>(&self, range: Range<T>) -> Chunks<'_> ⓘwhere T: ToOffset,
pub fn line_len(&self, row: u32) -> u32
pub fn is_line_blank(&self, row: u32) -> bool
pub fn text_summary_for_range<D, O>(&self, range: Range<O>) -> Dwhere O: ToOffset, D: TextDimension,
pub fn summaries_for_anchors<'a, D, A>( &'a self, anchors: A ) -> impl Iterator<Item = D> + 'awhere D: 'a + TextDimension, A: 'a + IntoIterator<Item = &'a Anchor>,
pub fn summaries_for_anchors_with_payload<'a, D, A, T>( &'a self, anchors: A ) -> impl Iterator<Item = (D, T)> + 'awhere D: 'a + TextDimension, A: 'a + IntoIterator<Item = (&'a Anchor, T)>,
pub fn anchor_before<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_after<T>(&self, position: T) -> Anchorwhere T: ToOffset,
pub fn anchor_at<T>(&self, position: T, bias: Bias) -> Anchorwhere T: ToOffset,
pub fn can_resolve(&self, anchor: &Anchor) -> bool
pub fn clip_offset(&self, offset: usize, bias: Bias) -> usize
pub fn clip_point(&self, point: Point, bias: Bias) -> Point
pub fn clip_offset_utf16(&self, offset: OffsetUtf16, bias: Bias) -> OffsetUtf16
pub fn clip_point_utf16( &self, point: Unclipped<PointUtf16>, bias: Bias ) -> PointUtf16
pub fn edits_since<D, 'a>( &'a self, since: &'a Global ) -> impl Iterator<Item = Edit<D>> + 'awhere D: TextDimension + Ord,
pub fn anchored_edits_since<D, 'a>( &'a self, since: &'a Global ) -> impl Iterator<Item = (Edit<D>, Range<Anchor>)> + 'awhere D: TextDimension + Ord,
pub fn edits_since_in_range<D, 'a>( &'a self, since: &'a Global, range: Range<Anchor> ) -> impl Iterator<Item = Edit<D>> + 'awhere D: TextDimension + Ord,
pub fn anchored_edits_since_in_range<D, 'a>( &'a self, since: &'a Global, range: Range<Anchor> ) -> impl Iterator<Item = (Edit<D>, Range<Anchor>)> + 'awhere D: TextDimension + Ord,
Trait Implementations§
source§impl Clone for BufferSnapshot
impl Clone for BufferSnapshot
source§fn clone(&self) -> BufferSnapshot
fn clone(&self) -> BufferSnapshot
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Deref for BufferSnapshot
impl Deref for BufferSnapshot
§type Target = BufferSnapshot
type Target = BufferSnapshot
The resulting type after dereferencing.
Auto Trait Implementations§
impl !RefUnwindSafe for BufferSnapshot
impl Send for BufferSnapshot
impl Sync for BufferSnapshot
impl Unpin for BufferSnapshot
impl !UnwindSafe for BufferSnapshot
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more