pub struct Symbol {
pub name: String,
pub kind: SymbolKind,
pub file: PathBuf,
pub line: u32,
pub signature: String,
pub token_cost: usize,
}Expand description
A symbol extracted from source code via tree-sitter.
§Examples
use std::path::PathBuf;
use argus_repomap::parser::{Symbol, SymbolKind};
let sym = Symbol {
name: "main".into(),
kind: SymbolKind::Function,
file: PathBuf::from("src/main.rs"),
line: 1,
signature: "fn main()".into(),
token_cost: 2,
};
assert_eq!(sym.kind, SymbolKind::Function);Fields§
§name: StringSymbol name (e.g. function name, struct name).
kind: SymbolKindWhat kind of symbol this is.
file: PathBufFile path (relative to repo root).
line: u32Line number where the symbol starts (1-indexed).
signature: StringHuman-readable signature (e.g. fn process(input: &str) -> Result<Output>).
token_cost: usizeEstimated token cost for including this symbol in context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnsafeUnpin for Symbol
impl UnwindSafe for Symbol
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