Skip to content

Commit 288b1c6

Browse files
committed
feat(runtimes): add onDefinition to lsp
1 parent f66956f commit 288b1c6

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

runtimes/runtimes/base-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
267267
sendProgress: <P>(type: ProgressType<P>, token: ProgressToken, value: P) => {
268268
return lspConnection.sendProgress(type, token, value)
269269
},
270+
onDefinition: handler => lspConnection.onDefinition(handler),
270271
onHover: handler => lspConnection.onHover(handler),
271272
onSignatureHelp: handler => lspConnection.onSignatureHelp(handler),
272273
onCodeAction: handler => lspConnection.onCodeAction(handler),

runtimes/runtimes/standalone.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ export const standalone = (props: RuntimeProps) => {
408408

409409
return lspConnection.sendProgress(type, token, value)
410410
},
411+
onDefinition: handler => lspConnection.onDefinition(handler),
411412
onHover: handler => lspConnection.onHover(handler),
412413
onSignatureHelp: handler => lspConnection.onSignatureHelp(handler),
413414
onCodeAction: handler => lspConnection.onCodeAction(handler),

runtimes/server-interface/lsp.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CompletionList,
99
CompletionParams,
1010
ConfigurationOptions,
11+
DefinitionParams,
1112
DidChangeConfigurationParams,
1213
DidChangeTextDocumentParams,
1314
DidChangeWorkspaceFoldersParams,
@@ -26,6 +27,8 @@ import {
2627
InlineCompletionList,
2728
InlineCompletionListWithReferences,
2829
InlineCompletionParams,
30+
Location,
31+
LocationLink,
2932
LogInlineCompletionSessionResultsParams,
3033
NotificationHandler,
3134
ProgressToken,
@@ -133,6 +136,9 @@ export type Lsp = {
133136
onDidSaveTextDocument: (handler: NotificationHandler<DidSaveTextDocumentParams>) => void
134137
publishDiagnostics: (params: PublishDiagnosticsParams) => Promise<void>
135138
sendProgress: <P>(type: ProgressType<P>, token: ProgressToken, value: P) => Promise<void>
139+
onDefinition: (
140+
handler: RequestHandler<DefinitionParams, Location | Location[] | LocationLink[] | null | undefined, void>
141+
) => void
136142
onHover: (handler: RequestHandler<HoverParams, Hover | null | undefined, void>) => void
137143
onExecuteCommand: (handler: RequestHandler<ExecuteCommandParams, any | undefined | null, void>) => void
138144
onSemanticTokens: (handler: RequestHandler<SemanticTokensParams, SemanticTokens | null, void>) => void

0 commit comments

Comments
 (0)