Find References 请求
引用请求从客户端发送到服务器,以解析由给定文本文档位置表示的符号的项目范围引用。
客户端能力(Client capability):
- 属性路径:
textDocument.references
- 属性类型:
ReferenceClientCapabilities
, 定义如下:
export interface ReferenceClientCapabilities {
/**
* Whether references supports dynamic registration.
*/
dynamicRegistration?: boolean;
}
服务端能力(Server capability):
- 属性路径:
referencesProvider
- 属性类型:
boolean | ReferenceOptions
,ReferenceOptions
定义如下:
export interface ReferenceOptions extends WorkDoneProgressOptions {
}
注册选项(Registration Options): ReferenceRegistrationOptions
, 定义如下:
export interface ReferenceRegistrationOptions extends
TextDocumentRegistrationOptions, ReferenceOptions {
}
请求(Request):
- method: "textDocument/references"
- params:
ReferenceParams
, 定义如下:
export interface ReferenceParams extends TextDocumentPositionParams,
WorkDoneProgressParams, PartialResultParams {
context: ReferenceContext;
}
export interface ReferenceContext {
/**
* Include the declaration of the current symbol.
*/
includeDeclaration: boolean;
}
响应(Response):
- result:
Location[] | null
- partial result:
Location[]
- error:
code
和message
,以防在请求期间发生异常。