Span class

Constructors

Span({int? endLine, String? file, String? kind, int? line, String? repo, String? role, num? score, String? snippet, String? symbol, String? tier})
Returns a new Span instance.

Properties

endLine ↔ int?
EndLine is the last line of the span, inclusive. It equals Line for a one-line span rather than being zero or absent.
getter/setter pair
file ↔ String?
File is the path inside the repo, relative to its root and never absolute.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
kind ↔ String?
Kind is what the indexer decided this chunk IS — "func", "method", "type", "struct", "interface", "var", "const", or "block" for a run of code that declares nothing. Absent when the chunker could not classify it.
getter/setter pair
line ↔ int?
Line is where the span starts, 1-based, as an editor counts.
getter/setter pair
repo ↔ String?
Repo is the indexed repository the span was found in, as it was indexed ("owner/name"). A search may be scoped to one repo or run across all of them, so this is how a caller tells the results apart.
getter/setter pair
role ↔ String?
context: match | definition | caller
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
score ↔ num?
Score ranks this span against the OTHERS IN THE SAME RESPONSE and means nothing across responses or between tiers: the hybrid tier's number is a reciprocal-rank fusion sum (Σ 1/(60+rank), so tenths at best), the symbol tier's is a descending position count, and the text and semantic tiers pass through bm25 and cosine. Compare within a list; never threshold on it.
getter/setter pair
snippet ↔ String?
Snippet is the code itself: a bounded excerpt on /search, the whole chunk on /context — which is why the same type serves both and why a /context span is the one an agent pastes into its window.
getter/setter pair
symbol ↔ String?
Symbol is the declared name, when the span declares one. Absent on a block.
getter/setter pair
tier ↔ String?
Tier is which retrieval produced the span: "hybrid" (the default — all three fused), "text" (trigram/FTS), "regex", "semantic" (vector), or "symbol". It is what explains a Score, so the two travel together.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Span?
Returns a new Span instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Span>
mapFromJson(dynamic json) → Map<String, Span>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Span>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.