pub struct SymbolDef {
pub id: String,
pub name: String,
pub file: u32,
pub line: u32,
pub through: u32,
pub start: u32,
pub end: u32,
pub class: Option<String>,
}Expand description
One declaration something in the change reads.
It may sit on ANY line of a file the change touches, not only one the change wrote: the commonest question a reviewer has is what a newly added call resolves to, and that is usually a helper which was already there.
Only names with exactly ONE definer appear, the same rule the class graph draws edges by — a name declared twice is ambiguous, and nothing here can say which one a reader meant.
Fields§
§id: StringDocument-local and positional, s0…sn, like h<N> and C<N>. Does not
survive regeneration.
name: String§file: u32Index into the document’s files[].
Not a path. On a change of any size this index holds thousands of rows, and a repeated path was 56% of its bytes on the validation corpus. The document already lists every file exactly once, so pointing at that list costs nothing and duplicates nothing.
It differs from hunks[].file, which is a path string and frozen that
way — the inconsistency is unavoidable, and this is the side of it where
the repetition is large enough to matter.
line: u32New-side line of the declaring token, counting from 1.
through: u32Last line of what the name declares. Equal to line where the reader
could not see an extent — a regex has no tree to ask.
start: u32Byte offsets of the token within its RAW line, before any tab expansion. A renderer that expands tabs must translate these against its own expansion rather than index its display text with them.
end: u32§class: Option<String>The shape class that introduces it, or null where the change did not
write this line — the declaration is real, it is simply not part of the
change.