|
|
@ -7,8 +7,9 @@ use crate::{
|
|
|
|
use helix_core::{find_workspace, path, syntax::LanguageServerFeature, ChangeSet, Rope};
|
|
|
|
use helix_core::{find_workspace, path, syntax::LanguageServerFeature, ChangeSet, Rope};
|
|
|
|
use helix_loader::{self, VERSION_AND_GIT_HASH};
|
|
|
|
use helix_loader::{self, VERSION_AND_GIT_HASH};
|
|
|
|
use lsp::{
|
|
|
|
use lsp::{
|
|
|
|
notification::DidChangeWorkspaceFolders, DidChangeWorkspaceFoldersParams, OneOf,
|
|
|
|
notification::DidChangeWorkspaceFolders, CodeActionCapabilityResolveSupport,
|
|
|
|
PositionEncodingKind, WorkspaceFolder, WorkspaceFoldersChangeEvent,
|
|
|
|
DidChangeWorkspaceFoldersParams, OneOf, PositionEncodingKind, WorkspaceFolder,
|
|
|
|
|
|
|
|
WorkspaceFoldersChangeEvent,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
use lsp_types as lsp;
|
|
|
|
use lsp_types as lsp;
|
|
|
|
use parking_lot::Mutex;
|
|
|
|
use parking_lot::Mutex;
|
|
|
@ -609,6 +610,12 @@ impl Client {
|
|
|
|
.collect(),
|
|
|
|
.collect(),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
is_preferred_support: Some(true),
|
|
|
|
|
|
|
|
disabled_support: Some(true),
|
|
|
|
|
|
|
|
data_support: Some(true),
|
|
|
|
|
|
|
|
resolve_support: Some(CodeActionCapabilityResolveSupport {
|
|
|
|
|
|
|
|
properties: vec!["edit".to_owned(), "command".to_owned()],
|
|
|
|
|
|
|
|
}),
|
|
|
|
..Default::default()
|
|
|
|
..Default::default()
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
|
|
|
|
publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
|
|
|
@ -954,6 +961,24 @@ impl Client {
|
|
|
|
Some(self.call::<lsp::request::ResolveCompletionItem>(completion_item))
|
|
|
|
Some(self.call::<lsp::request::ResolveCompletionItem>(completion_item))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn resolve_code_action(
|
|
|
|
|
|
|
|
&self,
|
|
|
|
|
|
|
|
code_action: lsp::CodeAction,
|
|
|
|
|
|
|
|
) -> Option<impl Future<Output = Result<Value>>> {
|
|
|
|
|
|
|
|
let capabilities = self.capabilities.get().unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return early if the server does not support resolving code action.
|
|
|
|
|
|
|
|
match capabilities.completion_provider {
|
|
|
|
|
|
|
|
Some(lsp::CompletionOptions {
|
|
|
|
|
|
|
|
resolve_provider: Some(true),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
}) => (),
|
|
|
|
|
|
|
|
_ => return None,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Some(self.call::<lsp::request::CodeActionResolveRequest>(code_action))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn text_document_signature_help(
|
|
|
|
pub fn text_document_signature_help(
|
|
|
|
&self,
|
|
|
|
&self,
|
|
|
|
text_document: lsp::TextDocumentIdentifier,
|
|
|
|
text_document: lsp::TextDocumentIdentifier,
|
|
|
|