pub struct CodeSymbol {
pub id: SymbolId,
pub name: String,
pub kind: SymbolKind,
pub language: EditorLanguage,
pub range: Range<usize>,
pub selection_range: Range<usize>,
pub parent: Option<SymbolId>,
pub signature: Option<String>,
pub docs: Option<String>,
pub source: SymbolSource,
}Expand description
Language-neutral symbol record for one code document.
Ranges are half-open UTF-8 byte offsets. Built-in indexers keep them within the document, but this public value type performs no validation.
§Examples
use ailloli_ui_editor::{CodeSymbol, EditorLanguage, SymbolId, SymbolKind, SymbolSource};
let symbol = CodeSymbol { id: SymbolId(1), name: "run".into(), kind: SymbolKind::Function, language: EditorLanguage::Rust, range: 0..10, selection_range: 3..6, parent: None, signature: Some("fn run()".into()), docs: None, source: SymbolSource::Lexical };
assert_eq!(symbol.selection_range, 3..6);Fields§
§id: SymbolIdSummary-local identifier; zero conventionally denotes the document root.
name: StringHuman-readable symbol name.
kind: SymbolKindLanguage-neutral category.
language: EditorLanguageLanguage inherited from the indexed document.
range: Range<usize>Half-open full declaration extent in UTF-8 bytes.
selection_range: Range<usize>Half-open name/selection extent in UTF-8 bytes.
parent: Option<SymbolId>Optional containing symbol ID; None means document root.
signature: Option<String>Optional compact declaration signature.
docs: Option<String>Optional extracted documentation text.
source: SymbolSourceIndexer/enrichment provenance.
Trait Implementations§
Source§impl Clone for CodeSymbol
impl Clone for CodeSymbol
Source§fn clone(&self) -> CodeSymbol
fn clone(&self) -> CodeSymbol
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 Debug for CodeSymbol
impl Debug for CodeSymbol
Source§impl<'de> Deserialize<'de> for CodeSymbol
impl<'de> Deserialize<'de> for CodeSymbol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CodeSymbol
impl PartialEq for CodeSymbol
Source§impl Serialize for CodeSymbol
impl Serialize for CodeSymbol
impl Eq for CodeSymbol
impl StructuralPartialEq for CodeSymbol
Auto Trait Implementations§
impl Freeze for CodeSymbol
impl RefUnwindSafe for CodeSymbol
impl Send for CodeSymbol
impl Sync for CodeSymbol
impl Unpin for CodeSymbol
impl UnwindSafe for CodeSymbol
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.