functiongetDefinitionAt

Information

Returns the definition of the name at a position in a file as JSON, e.g. for go to definition in an editor. The names in the innermost class the position is in are looked up like in getDefUseChains, and the positions of the names are found in the file on disk.

The JSON has the file, line and column, the definition (as in getDefUseChains, without its uses) or null if there's no name at the position or it can't be looked up, the use of the name at the position or null if it's the declared name of the definition, and the candidates in the classes a replaceable class is redeclared as. The uses of the definition are returned by getDefUseChains with its name.

Inputs

TypeNameDefaultDescription
StringfileNameA file of a loaded class.
Integerline
IntegercolumnStarting at 1, counting bytes.
BooleanprettyPrintfalse

Outputs

TypeNameDefaultDescription
Stringdefinition