<link rel="stylesheet" href="/_merged_assets/_static/noscript.css">
Atom Community Logo Atom Community API Getting Started Toggle darkmode

Go to Definition GitHub

A replacement of the go to definition functionality from atom-ide-ui.

screenshot of definitions feature

API

Definition

Properties

language

string

language may be used by consumers to identify the source of definitions.

name

(optional)
string

Optional: name and projectRoot can be provided to display a more human-readable title inside of Hyperclick when there are multiple definitions.

path

string

Path of the file in which the definition is located.

position

Point

First character of the definition's identifier. e.g. "F" in class Foo {}

projectRoot

(optional)
string

If provided, projectRoot will be used to display a relativized version of path.

range

(optional)
Range

Optional: the range of the entire definition. e.g. "c" to "}" in class Foo {}

DefinitionPreviewProvider

Methods

getDefinitionPreview

Parameters

definition
Definition

Returns

Promise<undefined|null|
  >

DefinitionProvider

Provides definitions for a set of language grammars.

Properties

getDefinition


  

Obtains the definition in an editor at the given point. This should return null if no definition is available.

grammarScopes

readonly string[]

name

string

priority

number

If there are multiple providers for a given grammar, the one with the highest priority will be used.

wordRegExp

undefined|null|RegExp

DefinitionQueryResult

Definition queries supply a point. The returned queryRange is the range within which the returned definition is valid. Typically queryRange spans the containing identifier around the query point. (If a null queryRange is returned, the range of the word containing the point is used.)

Properties

definitions

readonly Definition[]

Must be non-empty.

queryRange

undefined|null|readonly Range[]