Skip to main content
The Navigation API provides features for navigating TypeScript code: go to definition, find references, find implementations, and more. These power the core navigation features in editors.

Overview

Navigation features help users understand and traverse code:

Go to Definition

Jump to where a symbol is defined

Find References

Find all usages of a symbol

Go to Implementation

Find concrete implementations

Go to Type Definition

Jump to type declarations

getDefinitionAtPosition

Finds the definition(s) of a symbol at a specific position.

Signature

fileName
string
required
Path to the source file.
position
number
required
Zero-based character offset where the cursor is positioned.

Return Value

Example: Go to Definition

Go to Definition

getDefinitionAndBoundSpan

Gets definitions and the identifier span at the cursor position.

Signature

Return Value

Example

Definition with Span

getTypeDefinitionAtPosition

Finds the type definition of a symbol (useful for navigating to interfaces).

Signature

Example: Go to Type Definition

Go to Type

getReferencesAtPosition

Finds all references to a symbol.

Signature

Return Value

Example: Find All References

Find References

findReferences

Finds references grouped by definition.

Signature

Return Value

Example: Grouped References

Find References Grouped

getImplementationAtPosition

Finds implementations of an interface or abstract class.

Signature

Return Value

Example: Find Implementations

Find Implementations

Document Highlights

Highlights all occurrences of a symbol in a file.

Signature

Return Value

Example: Highlight Occurrences

Highlight Occurrences
Gets a tree structure of all declarations in a file.

Signature

Return Value

Example: File Outline

Navigation Tree

Real-World Integration

Complete Navigation Provider

See Also

Language Service API

Main Language Service reference

Completions

Code completion API

Diagnostics

Error reporting and diagnostics

Language Service Overview

Language Service architecture