Goto Implementation 请求
从版本 3.6.0 开始
转到实现请求从客户端发送到服务器,以解析给定文本文档位置的符号的实现位置。
结果类型 LocationLink[]
是在 3.14.0 版本中引入的,它依赖于相应的客户端功能 textDocument.implementation.linkSupport
。
客户端能力(Client capability):
- 属性路径:
textDocument.implementation
- 属性类型:
ImplementationClientCapabilities
, 定义如下:
export interface ImplementationClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to
* `true` the client supports the new `ImplementationRegistrationOptions`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The client supports additional metadata in the form of definition links.
*
* @since 3.14.0
*/
linkSupport?: boolean;
}
服务端能力(Server capability):
- 属性路径:
implementationProvider
- 属性类型:
boolean | ImplementationOptions | ImplementationRegistrationOptions
,ImplementationOptions
定义如下:
export interface ImplementationOptions extends WorkDoneProgressOptions {
}
注册选项(Registration Options): ImplementationRegistrationOptions
定义如下:
export interface ImplementationRegistrationOptions extends
TextDocumentRegistrationOptions, ImplementationOptions,
StaticRegistrationOptions {
}
请求(Request):
- method: "textDocument/implementation"
- params:
ImplementationParams
, 定义如下:
export interface ImplementationParams extends TextDocumentPositionParams,
WorkDoneProgressParams, PartialResultParams {
}
响应(Response):
- result:
Location | Location[] | LocationLink[] | null
- partial result:
Location[] | LocationLink[]
- error:
code
和message
,以防在请求期间发生异常。