Skip to main content

Module lens

Module lens 

Source
Expand description

The symbol lens’s model: the names on one diff line, how far each one reaches, and every use of them on a line the diff shows. A local name reaches as far as its enclosing function; a function, method or type (a definition, a call or a type position) reaches across every file of the diff. The names come from the parse tree, so only the identifiers of the code count.

Structs§

LensData
A built lens: the line it was opened on, its names, and their uses.
LensFile
One file of the diff, as the worker reads it: both sides’ text and the line numbers the diff shows on each, a deleted line on the old side and an added or context line on the new one, so a context line counts once.
LensOrigin
The diff line the lens was opened on.
LensSymbol
LensUse
One use of a symbol on a line the diff shows.

Enums§

Reach
How far a symbol’s uses are looked for.

Constants§

MAX_SYMBOLS
The most names one line’s lens labels, one per digit key.

Functions§

compute
Build the lens for origin over files. It parses both sides of every file, so it belongs on a worker thread.
lens_files
The files of model as compute reads them.