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.
Nested scopes
Namespaces, classes and their members nest in the outline as they nest in the code
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
Anonymous and inline scopes
Anonymous namespaces, structs and unions group their members under a placeholder name, and an inline namespace keeps its own node
Local symbols
Variables, types and lambdas declared in a function body nest under the function
Friend function definitions
A friend function defined inside a class lists under that class
Access sections
Members list in the order they are written; their public and private sections are no level of the outline
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.
Core symbol kinds
Namespaces, classes, unions, enums and their members, functions, variables, fields, bindings and lambdas each list with their kind
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
Specializations and deduction guides
Specializations list with their template arguments and their own members, and a deduction guide with the signature it deduces
Type aliases
typedef and using aliases and alias templates list as type aliases
Explicit instantiations
Explicit instantiations of class, function and variable templates list without members
Macros
Object-like and function-like macros list, a function-like one with its parameters as detail
Module declarations
A module unit lists the module it declares or belongs to
Include directives
#include directives do not list in the outline; their document links lead to the files they name
Pragma mark sections
#pragma mark - Name opens a section that groups the symbols after it
Namespace aliases
A namespace alias lists as a namespace, namespace alias its detail
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
Variable and field types
A variable or field shows its declared type as detail, a lambda what calling it takes and returns
Default arguments
A function's detail lists its parameters with their default values
Base classes
A derived class's detail names its base classes as written, with their access
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.
Names and extents
A symbol's extent covers its whole declaration, and its name the whole written name, ~Widget, operator== and operator bool included
Multiline signatures
A declaration spanning lines extends from its first line to its last
Symbols from macros
A symbol a macro invocation declares lists at the invocation, not at the macro's definition
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.
Deprecated symbols
A deprecated symbol carries the Deprecated tag, which editors strike through
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
