@@ -7,8 +7,9 @@ use crate::{
7use helix_core::{find_workspace, path, syntax::LanguageServerFeature, ChangeSet, Rope};
7use helix_core::{find_workspace, path, syntax::LanguageServerFeature, ChangeSet, Rope};
8use helix_loader::{self, VERSION_AND_GIT_HASH};
8use helix_loader::{self, VERSION_AND_GIT_HASH};
10− notification::DidChangeWorkspaceFolders, DidChangeWorkspaceFoldersParams, OneOf,
10+ notification::DidChangeWorkspaceFolders, CodeActionCapabilityResolveSupport,
11+ DidChangeWorkspaceFoldersParams, OneOf, PositionEncodingKind, WorkspaceFolder,
11− PositionEncodingKind, WorkspaceFolder, WorkspaceFoldersChangeEvent,
12+ WorkspaceFoldersChangeEvent,
13use lsp_types as lsp;
14use lsp_types as lsp;
14use parking_lot::Mutex;
15use parking_lot::Mutex;
@@ -609,6 +610,12 @@ impl Client {
609 .collect(),
610 .collect(),
613+ is_preferred_support: Some(true),
614+ disabled_support: Some(true),
615+ data_support: Some(true),
616+ resolve_support: Some(CodeActionCapabilityResolveSupport {
617+ properties: vec!["edit".to_owned(), "command".to_owned()],
612 ..Default::default()
619 ..Default::default()
614 publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
621 publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
@@ -954,6 +961,24 @@ impl Client {
954 Some(self.call::<lsp::request::ResolveCompletionItem>(completion_item))
961 Some(self.call::<lsp::request::ResolveCompletionItem>(completion_item))
964+ pub fn resolve_code_action(
966+ code_action: lsp::CodeAction,
967+ ) -> Option<impl Future<Output = Result<Value>>> {
968+ let capabilities = self.capabilities.get().unwrap();
970+ // Return early if the server does not support resolving code action.
971+ match capabilities.completion_provider {
972+ Some(lsp::CompletionOptions {
973+ resolve_provider: Some(true),
979+ Some(self.call::<lsp::request::CodeActionResolveRequest>(code_action))
957 pub fn text_document_signature_help(
982 pub fn text_document_signature_help(
959 text_document: lsp::TextDocumentIdentifier,
984 text_document: lsp::TextDocumentIdentifier,