From 8e0147345e55334f80f0d97dcf1cc6c1af86422f Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 23 Jun 2025 15:26:59 -0700 Subject: [PATCH 1/2] feat(runtimes): add support for CodeAction --- runtimes/runtimes/base-runtime.ts | 2 ++ runtimes/runtimes/standalone.ts | 2 ++ runtimes/server-interface/lsp.ts | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/runtimes/runtimes/base-runtime.ts b/runtimes/runtimes/base-runtime.ts index 6fa3baf3..71c98a08 100644 --- a/runtimes/runtimes/base-runtime.ts +++ b/runtimes/runtimes/base-runtime.ts @@ -269,6 +269,8 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag }, onHover: handler => lspConnection.onHover(handler), onSignatureHelp: handler => lspConnection.onSignatureHelp(handler), + onCodeAction: handler => lspConnection.onCodeAction(handler), + onCodeActionResolve: handler => lspConnection.onCodeActionResolve(handler), extensions: { onGetConfigurationFromServer: lspServer.setServerConfigurationHandler, onInlineCompletionWithReferences: handler => diff --git a/runtimes/runtimes/standalone.ts b/runtimes/runtimes/standalone.ts index 53a10921..52387580 100644 --- a/runtimes/runtimes/standalone.ts +++ b/runtimes/runtimes/standalone.ts @@ -410,6 +410,8 @@ export const standalone = (props: RuntimeProps) => { }, onHover: handler => lspConnection.onHover(handler), onSignatureHelp: handler => lspConnection.onSignatureHelp(handler), + onCodeAction: handler => lspConnection.onCodeAction(handler), + onCodeActionResolve: handler => lspConnection.onCodeActionResolve(handler), extensions: { onGetConfigurationFromServer: lspServer.setServerConfigurationHandler, onInlineCompletionWithReferences: handler => diff --git a/runtimes/server-interface/lsp.ts b/runtimes/server-interface/lsp.ts index ec4ffdcf..ee91d159 100644 --- a/runtimes/server-interface/lsp.ts +++ b/runtimes/server-interface/lsp.ts @@ -48,6 +48,8 @@ import { ApplyWorkspaceEditParams, ApplyWorkspaceEditResult, DidSaveTextDocumentParams, + CodeAction, + CodeActionParams, DeleteFilesParams, CreateFilesParams, RenameFilesParams, @@ -135,6 +137,8 @@ export type Lsp = { onExecuteCommand: (handler: RequestHandler) => void onSemanticTokens: (handler: RequestHandler) => void onSignatureHelp: (handler: RequestHandler) => void + onCodeAction: (handler: RequestHandler) => void + onCodeActionResolve: (handler: RequestHandler) => void workspace: { getConfiguration: (section: string) => Promise onDidChangeWorkspaceFolders: (handler: NotificationHandler) => void From 291c405971045ed0ae8871dfa8c7b290760078f9 Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Wed, 9 Jul 2025 11:28:26 -0700 Subject: [PATCH 2/2] feat(runtimes): add onDefinition to lsp --- runtimes/runtimes/base-runtime.ts | 1 + runtimes/runtimes/standalone.ts | 1 + runtimes/server-interface/lsp.ts | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/runtimes/runtimes/base-runtime.ts b/runtimes/runtimes/base-runtime.ts index 71c98a08..66374947 100644 --- a/runtimes/runtimes/base-runtime.ts +++ b/runtimes/runtimes/base-runtime.ts @@ -267,6 +267,7 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag sendProgress:

(type: ProgressType

, token: ProgressToken, value: P) => { return lspConnection.sendProgress(type, token, value) }, + onDefinition: handler => lspConnection.onDefinition(handler), onHover: handler => lspConnection.onHover(handler), onSignatureHelp: handler => lspConnection.onSignatureHelp(handler), onCodeAction: handler => lspConnection.onCodeAction(handler), diff --git a/runtimes/runtimes/standalone.ts b/runtimes/runtimes/standalone.ts index 52387580..d199bd79 100644 --- a/runtimes/runtimes/standalone.ts +++ b/runtimes/runtimes/standalone.ts @@ -408,6 +408,7 @@ export const standalone = (props: RuntimeProps) => { return lspConnection.sendProgress(type, token, value) }, + onDefinition: handler => lspConnection.onDefinition(handler), onHover: handler => lspConnection.onHover(handler), onSignatureHelp: handler => lspConnection.onSignatureHelp(handler), onCodeAction: handler => lspConnection.onCodeAction(handler), diff --git a/runtimes/server-interface/lsp.ts b/runtimes/server-interface/lsp.ts index ee91d159..7dc86ed0 100644 --- a/runtimes/server-interface/lsp.ts +++ b/runtimes/server-interface/lsp.ts @@ -8,6 +8,7 @@ import { CompletionList, CompletionParams, ConfigurationOptions, + DefinitionParams, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidChangeWorkspaceFoldersParams, @@ -26,6 +27,8 @@ import { InlineCompletionList, InlineCompletionListWithReferences, InlineCompletionParams, + Location, + LocationLink, LogInlineCompletionSessionResultsParams, NotificationHandler, ProgressToken, @@ -133,6 +136,9 @@ export type Lsp = { onDidSaveTextDocument: (handler: NotificationHandler) => void publishDiagnostics: (params: PublishDiagnosticsParams) => Promise sendProgress:

(type: ProgressType

, token: ProgressToken, value: P) => Promise + onDefinition: ( + handler: RequestHandler + ) => void onHover: (handler: RequestHandler) => void onExecuteCommand: (handler: RequestHandler) => void onSemanticTokens: (handler: RequestHandler) => void