From 894ac9a923d874b5b1746fa82bce044a85ffd3d0 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Tue, 16 Jul 2024 18:56:01 -0400 Subject: [PATCH] Inform LSP of supported code lenses Provide the LSP with a mapping of supported code lenses to commands. SourceKit-LSP will provide code lenses for running and debugging applications with a @main function only when we configure the commands we support. Blocked by https://github.com/swiftlang/sourcekit-lsp/pull/1556 --- src/sourcekit-lsp/LanguageClientManager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sourcekit-lsp/LanguageClientManager.ts b/src/sourcekit-lsp/LanguageClientManager.ts index a2eff1e45..0c5aad963 100644 --- a/src/sourcekit-lsp/LanguageClientManager.ts +++ b/src/sourcekit-lsp/LanguageClientManager.ts @@ -566,6 +566,12 @@ export class LanguageClientManager { errorHandler: new SourceKitLSPErrorHandler(5), initializationOptions: { "workspace/peekDocuments": true, // workaround for client capability to handle `PeekDocumentsRequest` + "textDocument/codeLens": { + supportedCommands: { + "swift.run": "swift.run", + "swift.debug": "swift.debug", + }, + }, }, };