Skip to content

Document Symbols ​

Provides the file outline and breadcrumb navigation via textDocument/documentSymbol: a nested symbol tree with ranges, selection ranges and a detail field that disambiguates overloads and shows declared types.

Symbol Hierarchy ​

Symbols nest in the outline as they nest in the code: a member under its class, a local under its function.

Supported

Nested scopes

Namespaces, classes and their members nest in the outline as they nest in the code

Supported

Out-of-line definitions

An out-of-line definition lists where it is written, under its qualified name, and a reopened namespace lists once per opening

Supported

Anonymous and inline scopes

Anonymous namespaces, structs and unions group their members under a placeholder name, and an inline namespace keeps its own node

Supportedclangd#616

Local symbols

Variables, types and lambdas declared in a function body nest under the function

Supported

Friend function definitions

A friend function defined inside a class lists under that class

Supported

Access sections

Members list in the order they are written; their public and private sections are no level of the outline

Supportedclangd#500

Members a macro declares

What one macro invocation declares under names written nowhere lists under the invocation, with what it names in its arguments: a test macro's test, the members a class macro adds; an invocation that declares only names its arguments write lists them as written

Symbol Kinds ​

Each symbol lists with its kind, from namespaces and classes to macros and module declarations.

Supported

Core symbol kinds

Namespaces, classes, unions, enums and their members, functions, variables, fields, bindings and lambdas each list with their kind

Supported

Templates

Class, function and variable templates read template in their detail, and their extent starts at the template keyword; concepts and abbreviated templates list too

Supported

Specializations and deduction guides

Specializations list with their template arguments and their own members, and a deduction guide with the signature it deduces

Supported

Type aliases

typedef and using aliases and alias templates list as type aliases

Supported

Explicit instantiations

Explicit instantiations of class, function and variable templates list without members

Supportedclangd#1744

Macros

Object-like and function-like macros list, a function-like one with its parameters as detail

Supported

Module declarations

A module unit lists the module it declares or belongs to

Supported

Include directives

#include directives do not list in the outline; their document links lead to the files they name

Supported

Pragma mark sections

#pragma mark - Name opens a section that groups the symbols after it

Supported

Namespace aliases

A namespace alias lists as a namespace, namespace alias its detail

Supported

Include guards

An include guard's macro does not list: the #ifndef and #define that wrap the whole header

Symbol Detail ​

The detail beside a name tells overloads apart and shows a variable's declared type.

Function signatures

The detail field shows a function's parameters, names included, and its return type, which tells overloads apart; constructors show no return type

Supported

Variable and field types

A variable or field shows its declared type as detail, a lambda what calling it takes and returns

Supported

Default arguments

A function's detail lists its parameters with their default values

Supportedclangd#601

Base classes

A derived class's detail names its base classes as written, with their access

Supported

Scoped types

A type written with its class scope keeps that scope once in the detail, dependent names included

Symbol Ranges ​

Each symbol carries the extent of its whole declaration and the range of its name, which the editor selects when you pick it.

Supported

Names and extents

A symbol's extent covers its whole declaration, and its name the whole written name, ~Widget, operator== and operator bool included

Supportedclangd#2221

Multiline signatures

A declaration spanning lines extends from its first line to its last

Supportedclangd#475

Symbols from macros

A symbol a macro invocation declares lists at the invocation, not at the macro's definition

Supportedclangd#1941

Names in macro arguments

A name written in a macro's arguments is the symbol's name; one written in the macro's body falls back to the invocation

Symbol Tags ​

Tags mark a symbol as deprecated; what else a member is, its detail says.

Supported

Deprecated symbols

A deprecated symbol carries the Deprecated tag, which editors strike through

Supported

Member markers

A member's detail says static, virtual and = 0 where the member is so; the protocol's tags carry only deprecation, and access is not shown