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
Nested symbol tree
Symbols nest by their written scope; out-of-line definitions appear at their lexical position with qualified names
Symbol ranges and selection ranges
The range spans the whole declaration; the selection range covers the full written name, including multi-token names like ~Widget, operator== and operator bool
Access specifier grouping
Access specifiers do not form grouping nodes in the outline yet
Anonymous and inline scopes
Anonymous namespaces, unnamed structs and unions group their members under a placeholder name; inline namespace members stay under the inline namespace node
UTF-16 position encoding
Columns after non-ASCII text count UTF-16 code units
Symbol Kinds
Core symbol kinds
Namespaces, classes, structs, unions, enums and their members, functions, variables, fields, structured bindings and lambdas all appear in the outline with a mapped LSP symbol kind
Template declarations
Class, function and variable templates carry a template detail prefix; concepts and abbreviated function templates (concept auto parameters) appear as well
Template specializations and deduction guides
Explicit and partial specializations of class and variable templates appear with their template arguments in the name; members nest under their specialization; deduction guides render their deduced signature
Type aliases
typedef, using aliases and alias templates appear in the outline with a type alias detail
Explicit instantiation directives
Class, function and variable explicit instantiations appear as childless symbols
Macro definitions
Object-like and function-like macros appear in the outline, with parameters detailed for function-like forms
Macros in the preamble region
Macros in the leading directive run are not outlined in editor requests yet
Module declarations
An interface unit's module declaration outlines the module it defines
Symbol Detail
Function signatures
Parameter and return types in the detail field disambiguate overloads; constructors drop the void return type
Variable and field types
Variable details show the declared type, while lambdas render as (lambda)
Default argument stripping
The signature is derived from the function type, so default parameter values never leak into the outline
Base classes in detail
Derived class details do not include their base classes yet
Multiline signature ranges
The symbol range starts at the beginning of the declaration and spans the full signature, so editor sticky scroll anchors correctly
Scoped types
A written class scope appears in the detail exactly once, for nested classes, template-ids, aliases and dependent names alike
Missing Symbols
Include directives
#include directives do not appear in the outline yet
Local symbols
Variables and types declared inside function bodies nest under their function
#pragma mark navigation markers
Editor section markers do not appear in the outline yet
Friend function definitions
A friend function defined inline in a class appears under that class
Symbol Tags
Deprecated tag
Deprecated symbols do not carry the LSP deprecated symbol tag yet
Access and storage indicators
Outline entries do not expose access, static, virtual or abstract modifiers yet
Location Correctness
Symbols from macro expansions
A symbol produced by a macro invocation is located at the invocation, not at the macro definition
Names spelled in macro arguments
The selection range points at the name written in the macro argument; names spelled in the macro body fall back to the invocation site
