pub struct CodeChunk {
pub file_path: String,
pub name: String,
pub kind: String,
pub content_kind: ContentKind,
pub start_line: usize,
pub end_line: usize,
pub symbol_line: usize,
pub content: String,
pub enriched_content: String,
pub qualified_name: Option<String>,
}Expand description
A semantic chunk extracted from a source file.
Fields§
§file_path: StringPath to the source file.
name: StringName of the definition (function name, class name, etc.).
kind: StringKind of syntax node (e.g., function_item, class_definition).
For chunks emitted from the dense.rs semble path, this is the
LSP SymbolKind numeric value serialized as a string (e.g., "12" for
Function). For chunks emitted from chunk.rs’s query-based path, this
is the raw tree-sitter node kind string. Downstream consumers should
call crate::languages::lsp_symbol_kind_for_node_kind to normalize.
content_kind: ContentKindHigh-level content category derived from the file extension.
Set by the chunker at emission time. Downstream filters (e.g.,
find_duplicates, get_repo_map) use this to exclude
ContentKind::Meta files from code-centric queries by default.
start_line: usize1-based start line number (first line of the chunk, which may be a doc-comment line preceding the symbol’s identifier).
end_line: usize1-based end line number.
symbol_line: usize1-based line number of the symbol’s name-identifier token within this
chunk. For tree-sitter query-based chunks (chunk_file), this is the
exact line where the @name capture appears, so LSP tools that jump to
lsp_location.start_line land on the identifier rather than on a
preceding doc-comment line.
Defaults to start_line for chunks produced by the sliding-window
fallback, the semble/dense path, and RDF-block paths, where the
name-identifier line is not separately tracked.
Convention matches start_line: 1-based, relative to the file’s first
line.
content: StringSource text of the chunk (raw code for display).
enriched_content: StringEnriched content with scope chain and signature metadata for embedding.
Falls back to content if metadata would exceed chunk size limits.
qualified_name: Option<String>Optional language-specific composite identifier that disambiguates a
symbol whose bare name is shared across many declarations.
For HCL: resource "aws_iam_role" "loader" { ... } ships
name = "loader" and qualified_name = Some("aws_iam_role.loader").
Each local.X = ... extracted as its own chunk ships
qualified_name = Some("local.X"). Workspace symbol consumers
surface qualified_name when set so a query for the composite form
finds the right resource on corpora that reuse names like loader
across many resource types (R1, R6, Wave 3).
None for all non-HCL chunks today; reserved for future
language-specific composite naming.
Trait Implementations§
Source§impl Archive for CodeChunk
impl Archive for CodeChunk
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedCodeChunk
type Archived = ArchivedCodeChunk
Source§type Resolver = CodeChunkResolver
type Resolver = CodeChunkResolver
Source§impl<__D: Fallible + ?Sized> Deserialize<CodeChunk, __D> for Archived<CodeChunk>where
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
ContentKind: Archive,
<ContentKind as Archive>::Archived: Deserialize<ContentKind, __D>,
usize: Archive,
<usize as Archive>::Archived: Deserialize<usize, __D>,
Option<String>: Archive,
<Option<String> as Archive>::Archived: Deserialize<Option<String>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<CodeChunk, __D> for Archived<CodeChunk>where
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
ContentKind: Archive,
<ContentKind as Archive>::Archived: Deserialize<ContentKind, __D>,
usize: Archive,
<usize as Archive>::Archived: Deserialize<usize, __D>,
Option<String>: Archive,
<Option<String> as Archive>::Archived: Deserialize<Option<String>, __D>,
impl<'__de> Decode<'__de> for CodeChunkwhere
'__de:,
impl Encode for CodeChunk
Auto Trait Implementations§
impl Freeze for CodeChunk
impl RefUnwindSafe for CodeChunk
impl Send for CodeChunk
impl Sync for CodeChunk
impl Unpin for CodeChunk
impl UnsafeUnpin for CodeChunk
impl UnwindSafe for CodeChunk
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.