-
Couldn't load subscription status.
- Fork 274
LSP Extensions
Aside from definitions/references/workspace symbol, ccls provides some LSP extensions that find base/derived classes/methods, vars of a type, callers of a function.
It can be seen as a specialized textDocument/references. It finds all variables when the cursor is at a type of a variable (the type of the variable will be used). Whether local variables/parameters/struct members are returned can be specified with kind.
- params:
TextDocumentPositionParamsextended withkind - return:
Location[]
Find callers (callee: false, default) or callees (callee: true) when the cursor is at a function.
The method returns either a flattened Location[], or a hierarchical type.
- params:
TextDocumentPositionParamsextended withcallee, callType - return:
Location[]
- initial params:
TextDocumentPositionParamsextended withcallee, callType. The result includesidandkindwhich are used to expand a node. - params:
id, kind, callee, callType
Optional levels and qualified can be used to customize the hierarchy.
Find base classes (derived: false, default) or derived classes (derived: true).
It can also used to jump between the primary template and partial specializations.
- params:
TextDocumentPositionParamsextended withderived - return:
Location[]
- initial params:
TextDocumentPositionParamsextended withderived. The result includesidandkindwhich are used to expand a node. - params:
id, kind, derived
Optional levels and qualified can be used to customize the hierarchy.
Find member variables/functions/types when the cursor is at a class/struct/union or a variable (the type of which will be used). Find local variables when the cursor is at a function.
-
kind: 4(default), member variables are returned. -
kind: 3, member functions are returned. -
kind: 2, member types are returned.
- params:
TextDocumentPositionParamsextended withderived - return:
Location[]
- initial params:
TextDocumentPositionParamsextended withderived. The result includesidandkindwhich are used to expand a node. - params:
id, kind, derived
Returned nodes can be furthe expanded if kind: 4.
Optional levels and qualified can be used to customize the hierarchy.
Semantic movement among declarations.
- params:
TextDocumentPositionParamsextended withdirection. The allowed values ofdirection:-
"U": parent -
"D": first child -
"L": left sibling -
"R": right sibling
-
- return:
Location[]