aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tham2021-10-29 03:00:18 +0000
committerGitHub2021-10-29 03:00:18 +0000
commit49f6c2623fbda5ff4be86e5e7d773bf900d9c75c (patch)
tree68e7a96a0693005f8ec27dff8e9faa5b5fd178f9
parentcec0cfdaecdb9b3e7fdf3ae3bb3252ba3f2f2752 (diff)
Bump lsp-types to 0.91.0 (#932)
-rw-r--r--Cargo.lock4
-rw-r--r--helix-lsp/Cargo.toml2
-rw-r--r--helix-lsp/src/client.rs7
-rw-r--r--helix-term/src/application.rs9
-rw-r--r--helix-term/src/ui/completion.rs51
5 files changed, 38 insertions, 35 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 45a8f5da..8af5c45c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -584,9 +584,9 @@ dependencies = [
[[package]]
name = "lsp-types"
-version = "0.90.1"
+version = "0.91.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f3734ab1d7d157fc0c45110e06b587c31cd82bea2ccfd6b563cbff0aaeeb1d3"
+checksum = "be7801b458592d0998af808d97f6a85a6057af3aaf2a2a5c3c677702bbeb4ed7"
dependencies = [
"bitflags",
"serde",
diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml
index f9910cc0..8cbff41d 100644
--- a/helix-lsp/Cargo.toml
+++ b/helix-lsp/Cargo.toml
@@ -19,7 +19,7 @@ futures-executor = "0.3"
futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }
jsonrpc-core = { version = "18.0", default-features = false } # don't pull in all of futures
log = "0.4"
-lsp-types = { version = "0.90", features = ["proposed"] }
+lsp-types = { version = "0.91", features = ["proposed"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 4068ae1f..b810feef 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -461,7 +461,7 @@ impl Client {
};
let changes = match sync_capabilities {
- lsp::TextDocumentSyncKind::Full => {
+ lsp::TextDocumentSyncKind::FULL => {
vec![lsp::TextDocumentContentChangeEvent {
// range = None -> whole document
range: None, //Some(Range)
@@ -469,10 +469,11 @@ impl Client {
text: new_text.to_string(),
}]
}
- lsp::TextDocumentSyncKind::Incremental => {
+ lsp::TextDocumentSyncKind::INCREMENTAL => {
Self::changeset_to_changes(old_text, new_text, changes, self.offset_encoding)
}
- lsp::TextDocumentSyncKind::None => return None,
+ lsp::TextDocumentSyncKind::NONE => return None,
+ kind => unimplemented!("{:?}", kind),
};
Some(self.notify::<lsp::notification::DidChangeTextDocument>(
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 55b12c5a..6037148f 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -389,10 +389,11 @@ impl Application {
message: diagnostic.message,
severity: diagnostic.severity.map(
|severity| match severity {
- DiagnosticSeverity::Error => Error,
- DiagnosticSeverity::Warning => Warning,
- DiagnosticSeverity::Information => Info,
- DiagnosticSeverity::Hint => Hint,
+ DiagnosticSeverity::ERROR => Error,
+ DiagnosticSeverity::WARNING => Warning,
+ DiagnosticSeverity::INFORMATION => Info,
+ DiagnosticSeverity::HINT => Hint,
+ severity => unimplemented!("{:?}", severity),
},
),
// code
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs
index a893e70b..dcb2bfd8 100644
--- a/helix-term/src/ui/completion.rs
+++ b/helix-term/src/ui/completion.rs
@@ -30,31 +30,32 @@ impl menu::Item for CompletionItem {
menu::Row::new(vec![
menu::Cell::from(self.label.as_str()),
menu::Cell::from(match self.kind {
- Some(lsp::CompletionItemKind::Text) => "text",
- Some(lsp::CompletionItemKind::Method) => "method",
- Some(lsp::CompletionItemKind::Function) => "function",
- Some(lsp::CompletionItemKind::Constructor) => "constructor",
- Some(lsp::CompletionItemKind::Field) => "field",
- Some(lsp::CompletionItemKind::Variable) => "variable",
- Some(lsp::CompletionItemKind::Class) => "class",
- Some(lsp::CompletionItemKind::Interface) => "interface",
- Some(lsp::CompletionItemKind::Module) => "module",
- Some(lsp::CompletionItemKind::Property) => "property",
- Some(lsp::CompletionItemKind::Unit) => "unit",
- Some(lsp::CompletionItemKind::Value) => "value",
- Some(lsp::CompletionItemKind::Enum) => "enum",
- Some(lsp::CompletionItemKind::Keyword) => "keyword",
- Some(lsp::CompletionItemKind::Snippet) => "snippet",
- Some(lsp::CompletionItemKind::Color) => "color",
- Some(lsp::CompletionItemKind::File) => "file",
- Some(lsp::CompletionItemKind::Reference) => "reference",
- Some(lsp::CompletionItemKind::Folder) => "folder",
- Some(lsp::CompletionItemKind::EnumMember) => "enum_member",
- Some(lsp::CompletionItemKind::Constant) => "constant",
- Some(lsp::CompletionItemKind::Struct) => "struct",
- Some(lsp::CompletionItemKind::Event) => "event",
- Some(lsp::CompletionItemKind::Operator) => "operator",
- Some(lsp::CompletionItemKind::TypeParameter) => "type_param",
+ Some(lsp::CompletionItemKind::TEXT) => "text",
+ Some(lsp::CompletionItemKind::METHOD) => "method",
+ Some(lsp::CompletionItemKind::FUNCTION) => "function",
+ Some(lsp::CompletionItemKind::CONSTRUCTOR) => "constructor",
+ Some(lsp::CompletionItemKind::FIELD) => "field",
+ Some(lsp::CompletionItemKind::VARIABLE) => "variable",
+ Some(lsp::CompletionItemKind::CLASS) => "class",
+ Some(lsp::CompletionItemKind::INTERFACE) => "interface",
+ Some(lsp::CompletionItemKind::MODULE) => "module",
+ Some(lsp::CompletionItemKind::PROPERTY) => "property",
+ Some(lsp::CompletionItemKind::UNIT) => "unit",
+ Some(lsp::CompletionItemKind::VALUE) => "value",
+ Some(lsp::CompletionItemKind::ENUM) => "enum",
+ Some(lsp::CompletionItemKind::KEYWORD) => "keyword",
+ Some(lsp::CompletionItemKind::SNIPPET) => "snippet",
+ Some(lsp::CompletionItemKind::COLOR) => "color",
+ Some(lsp::CompletionItemKind::FILE) => "file",
+ Some(lsp::CompletionItemKind::REFERENCE) => "reference",
+ Some(lsp::CompletionItemKind::FOLDER) => "folder",
+ Some(lsp::CompletionItemKind::ENUM_MEMBER) => "enum_member",
+ Some(lsp::CompletionItemKind::CONSTANT) => "constant",
+ Some(lsp::CompletionItemKind::STRUCT) => "struct",
+ Some(lsp::CompletionItemKind::EVENT) => "event",
+ Some(lsp::CompletionItemKind::OPERATOR) => "operator",
+ Some(lsp::CompletionItemKind::TYPE_PARAMETER) => "type_param",
+ Some(kind) => unimplemented!("{:?}", kind),
None => "",
}),
// self.detail.as_deref().unwrap_or("")