diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c17b114a..ef1a23716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changes to Calva. - Internal: [Handle the unknown-op status from test commands](https://github.com/BetterThanTomorrow/calva/pull/1365) - Fix: [textDocument/linkedEditingRange failed when opening files or moving cursor](https://github.com/BetterThanTomorrow/calva/issues/1374) - Fix: [paredit.spliceSexp doesn't work with set literals](https://github.com/BetterThanTomorrow/calva/issues/1395) +- Fix: [LSP code actions not working](https://github.com/BetterThanTomorrow/calva/issues/1373) ## [2.0.225] - 2021-11-10 - Revert 224 changes: [Version v2.0.224 causes problems on some machines (possibly Windows related)](https://github.com/BetterThanTomorrow/calva/issues/1379) diff --git a/package-lock.json b/package-lock.json index d6fbbee62..012b0ac03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9967,6 +9967,11 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, "engines": { "node": ">=0.10.0" } diff --git a/src/lsp/main.ts b/src/lsp/main.ts index 808e1a552..1a1a80a28 100644 --- a/src/lsp/main.ts +++ b/src/lsp/main.ts @@ -12,6 +12,7 @@ import * as path from 'path'; import * as state from '../state'; import { provideHover } from '../providers/hover'; import { provideSignatureHelp } from '../providers/signature'; +import { ProviderResult, CodeAction } from 'vscode'; const LSP_CLIENT_KEY = 'lspClient'; const RESOLVE_MACRO_AS_COMMAND = 'resolve-macro-as'; @@ -41,6 +42,14 @@ function createClient(clojureLspPath: string): LanguageClient { provideLinkedEditingRange: async (_document, _position, _token, _next): Promise => { return null; }, + async resolveCodeAction(item, token, next): Promise { + const { command } = await next(item, token); + if (command) { + sendCommandRequest(command.command, command.arguments); + return null; + } + return next(item, token); + }, handleDiagnostics(uri, diagnostics, next) { if (uri.path.endsWith(config.REPL_FILE_EXT)) { return;