diff --git a/Cargo.lock b/Cargo.lock index 617d9da54..1b63c0e33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1031,10 +1031,10 @@ dependencies = [ [[package]] name = "lsp-types" -version = "0.73.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2302,7 +2302,7 @@ dependencies = [ "jsonrpc 0.1.0", "jsonrpc-derive 0.1.0", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lsp-types 0.73.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lsp-types 0.74.0 (registry+https://github.com/rust-lang/crates.io-index)", "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2930,7 +2930,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum lsp-types 0.73.0 (registry+https://github.com/rust-lang/crates.io-index)" = "93d0cf64ea141b43d9e055f6b9df13f0bce32b103d84237509ce0a571ab9b159" +"checksum lsp-types 0.74.0 (registry+https://github.com/rust-lang/crates.io-index)" = "820f746e5716ab9a2d664794636188bd003023b72e55404ee27105dc22869922" "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" "checksum markup5ever 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "897636f9850c3eef4905a5540683ed53dc9393860f0846cab2c2ddf9939862ff" diff --git a/crates/texlab_completion/src/bibtex/cmd.rs b/crates/texlab_completion/src/bibtex/cmd.rs index 8591af933..9863c990a 100644 --- a/crates/texlab_completion/src/bibtex/cmd.rs +++ b/crates/texlab_completion/src/bibtex/cmd.rs @@ -52,7 +52,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::Range; + use texlab_protocol::{CompletionTextEditExt, Range}; #[tokio::test] async fn empty_latex_document() { @@ -112,6 +112,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 1, 1, 2) diff --git a/crates/texlab_completion/src/bibtex/entry_type.rs b/crates/texlab_completion/src/bibtex/entry_type.rs index f4e66f921..eef45f17c 100644 --- a/crates/texlab_completion/src/bibtex/entry_type.rs +++ b/crates/texlab_completion/src/bibtex/entry_type.rs @@ -61,6 +61,7 @@ impl BibtexEntryTypeCompletionProvider { mod tests { use super::*; use texlab_feature::FeatureTester; + use texlab_protocol::CompletionTextEditExt; #[tokio::test] async fn empty_latex_document() { @@ -112,6 +113,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 1, 0, 1) @@ -132,6 +134,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 1, 0, 4) diff --git a/crates/texlab_completion/src/bibtex/field_name.rs b/crates/texlab_completion/src/bibtex/field_name.rs index 081c42bfb..5dcfc95d7 100644 --- a/crates/texlab_completion/src/bibtex/field_name.rs +++ b/crates/texlab_completion/src/bibtex/field_name.rs @@ -65,7 +65,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::Range; + use texlab_protocol::{CompletionTextEditExt, Range}; #[tokio::test] async fn empty_latex_document() { @@ -113,6 +113,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 0, 1, 3) @@ -133,6 +134,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 27, 0, 30) @@ -161,6 +163,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 0, 1, 0) diff --git a/crates/texlab_completion/src/factory.rs b/crates/texlab_completion/src/factory.rs index eba7c4c04..aab83bf7a 100644 --- a/crates/texlab_completion/src/factory.rs +++ b/crates/texlab_completion/src/factory.rs @@ -90,7 +90,7 @@ pub fn command( kind: Some(adjust_kind(req, Structure::Command.completion_kind())), data: Some(CompletionItemData::Command.into()), documentation: image.and_then(|image| image_documentation(&req, &name, image)), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::new_simple(name, detail) } } @@ -121,7 +121,7 @@ pub fn environment( CompletionItem { kind: Some(adjust_kind(req, Structure::Environment.completion_kind())), data: Some(CompletionItemData::Environment.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::new_simple(name, component.detail()) } } @@ -158,7 +158,7 @@ pub fn label( label: name, kind: Some(adjust_kind(req, kind)), data: Some(CompletionItemData::Label.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), filter_text, detail, documentation, @@ -175,7 +175,7 @@ pub fn folder( label: path.file_name().unwrap().to_string_lossy().into_owned(), kind: Some(adjust_kind(req, Structure::Folder.completion_kind())), data: Some(CompletionItemData::Folder.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -189,7 +189,7 @@ pub fn file( label: path.file_name().unwrap().to_string_lossy().into_owned(), kind: Some(adjust_kind(req, Structure::File.completion_kind())), data: Some(CompletionItemData::File.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -203,7 +203,7 @@ pub fn pgf_library( label: name.into(), kind: Some(adjust_kind(req, Structure::PgfLibrary.completion_kind())), data: Some(CompletionItemData::PgfLibrary.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -217,7 +217,7 @@ pub fn tikz_library( label: name.into(), kind: Some(adjust_kind(req, Structure::TikzLibrary.completion_kind())), data: Some(CompletionItemData::TikzLibrary.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -231,7 +231,7 @@ pub fn color( label: name.into(), kind: Some(adjust_kind(req, Structure::Color.completion_kind())), data: Some(CompletionItemData::Color.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -245,7 +245,7 @@ pub fn color_model( label: name.into(), kind: Some(adjust_kind(req, Structure::ColorModel.completion_kind())), data: Some(CompletionItemData::ColorModel.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -259,7 +259,7 @@ pub fn package( label: name, kind: Some(adjust_kind(req, Structure::Package.completion_kind())), data: Some(CompletionItemData::Package.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -273,7 +273,7 @@ pub fn class( label: name, kind: Some(adjust_kind(req, Structure::Class.completion_kind())), data: Some(CompletionItemData::Class.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -318,7 +318,7 @@ pub fn citation( kind: Some(adjust_kind(req, kind)), filter_text: Some(filter_text), data: Some(CompletionItemData::Citation { uri, key }.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } @@ -333,7 +333,7 @@ pub fn entry_type( label: (&ty.name).into(), kind: Some(adjust_kind(req, kind)), data: Some(CompletionItemData::EntryType.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), documentation: ty.documentation.as_ref().map(|doc| { Documentation::MarkupContent(MarkupContent { kind: MarkupKind::Markdown, @@ -353,7 +353,7 @@ pub fn field_name( label: (&field.name).into(), kind: Some(adjust_kind(req, Structure::Field.completion_kind())), data: Some(CompletionItemData::FieldName.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), documentation: Some(Documentation::MarkupContent(MarkupContent { kind: MarkupKind::Markdown, value: (&field.documentation).into(), @@ -372,7 +372,7 @@ pub fn argument( label: name.into(), kind: Some(adjust_kind(req, Structure::Argument.completion_kind())), data: Some(CompletionItemData::Argument.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), documentation: image.and_then(|image| image_documentation(&req, &name, image)), ..CompletionItem::default() } @@ -387,7 +387,7 @@ pub fn glossary_entry( label, kind: Some(adjust_kind(req, Structure::GlossaryEntry.completion_kind())), data: Some(CompletionItemData::GlossaryEntry.into()), - text_edit: Some(text_edit), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), ..CompletionItem::default() } } diff --git a/crates/texlab_completion/src/latex/argument.rs b/crates/texlab_completion/src/latex/argument.rs index 3f24f980b..eaa524192 100644 --- a/crates/texlab_completion/src/latex/argument.rs +++ b/crates/texlab_completion/src/latex/argument.rs @@ -54,7 +54,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -102,6 +102,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 8, 1, 8) @@ -130,6 +131,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 8, 1, 11) diff --git a/crates/texlab_completion/src/latex/citation.rs b/crates/texlab_completion/src/latex/citation.rs index c7c311551..1a01eefa4 100644 --- a/crates/texlab_completion/src/latex/citation.rs +++ b/crates/texlab_completion/src/latex/citation.rs @@ -62,7 +62,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -114,6 +114,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 6, 1, 6) @@ -145,6 +146,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 6, 1, 6) @@ -176,6 +178,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 6, 1, 9) @@ -207,6 +210,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 10, 1, 10) diff --git a/crates/texlab_completion/src/latex/color.rs b/crates/texlab_completion/src/latex/color.rs index 16b008a93..d933f2464 100644 --- a/crates/texlab_completion/src/latex/color.rs +++ b/crates/texlab_completion/src/latex/color.rs @@ -36,7 +36,7 @@ impl FeatureProvider for LatexColorCompletionProvider { mod tests { use super::*; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -76,6 +76,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 7, 0, 7) diff --git a/crates/texlab_completion/src/latex/color_model.rs b/crates/texlab_completion/src/latex/color_model.rs index c2c828a43..ff773d515 100644 --- a/crates/texlab_completion/src/latex/color_model.rs +++ b/crates/texlab_completion/src/latex/color_model.rs @@ -41,7 +41,7 @@ impl FeatureProvider for LatexColorModelCompletionProvider { mod tests { use super::*; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -81,6 +81,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 19, 0, 19) @@ -101,6 +102,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 16, 0, 16) diff --git a/crates/texlab_completion/src/latex/component.rs b/crates/texlab_completion/src/latex/component.rs index 818b75859..cc16ba511 100644 --- a/crates/texlab_completion/src/latex/component.rs +++ b/crates/texlab_completion/src/latex/component.rs @@ -97,7 +97,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document_command() { @@ -173,6 +173,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 1, 0, 4) @@ -265,6 +266,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 7, 0, 7) @@ -285,6 +287,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 5, 0, 8) @@ -353,6 +356,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(0, 7, 0, 10) diff --git a/crates/texlab_completion/src/latex/glossary.rs b/crates/texlab_completion/src/latex/glossary.rs index d132d9fcf..518bdb1af 100644 --- a/crates/texlab_completion/src/latex/glossary.rs +++ b/crates/texlab_completion/src/latex/glossary.rs @@ -60,7 +60,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -109,6 +109,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 9, 1, 12) diff --git a/crates/texlab_completion/src/latex/theorem.rs b/crates/texlab_completion/src/latex/theorem.rs index dc6f097cc..81c2dd6f3 100644 --- a/crates/texlab_completion/src/latex/theorem.rs +++ b/crates/texlab_completion/src/latex/theorem.rs @@ -37,7 +37,7 @@ mod tests { use super::*; use indoc::indoc; use texlab_feature::FeatureTester; - use texlab_protocol::{Range, RangeExt}; + use texlab_protocol::{CompletionTextEditExt, Range, RangeExt}; #[tokio::test] async fn empty_latex_document() { @@ -86,6 +86,7 @@ mod tests { actual_items[0] .text_edit .as_ref() + .and_then(|edit| edit.text_edit()) .map(|edit| edit.range) .unwrap(), Range::new_simple(1, 7, 1, 9) diff --git a/crates/texlab_feature/src/feature.rs b/crates/texlab_feature/src/feature.rs index eeec9fc51..ecbf31290 100644 --- a/crates/texlab_feature/src/feature.rs +++ b/crates/texlab_feature/src/feature.rs @@ -333,7 +333,11 @@ impl FeatureTester { F: FeatureProvider, { let text_document = self.identifier(); - let params = DocumentLinkParams { text_document }; + let params = DocumentLinkParams { + text_document, + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), + }; let req = self.request(params).await; provider.execute(&req).await } @@ -351,6 +355,7 @@ impl FeatureTester { include_declaration: self.include_declaration, }, work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }; let req = self.request(params).await; provider.execute(&req).await @@ -377,7 +382,11 @@ impl FeatureTester { F: FeatureProvider, { let text_document = self.identifier(); - let params = DocumentSymbolParams { text_document }; + let params = DocumentSymbolParams { + text_document, + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), + }; let req = self.request(params).await; provider.execute(&req).await } diff --git a/crates/texlab_protocol/Cargo.toml b/crates/texlab_protocol/Cargo.toml index 0cea670ad..28002bb05 100644 --- a/crates/texlab_protocol/Cargo.toml +++ b/crates/texlab_protocol/Cargo.toml @@ -16,7 +16,7 @@ futures-boxed = { path = "../futures_boxed" } jsonrpc = { path = "../jsonrpc" } jsonrpc-derive = { path = "../jsonrpc_derive" } log = "0.4" -lsp-types = "0.73.0" +lsp-types = "0.74.0" nom = "5.1" serde = { version = "1.0", features = ["derive", "rc"] } serde_json = "1.0" diff --git a/crates/texlab_protocol/src/edit.rs b/crates/texlab_protocol/src/edit.rs new file mode 100644 index 000000000..9091f2d39 --- /dev/null +++ b/crates/texlab_protocol/src/edit.rs @@ -0,0 +1,12 @@ +use lsp_types::{CompletionTextEdit, TextEdit}; + +pub trait CompletionTextEditExt { + fn text_edit(&self) -> Option<&TextEdit>; +} + +impl CompletionTextEditExt for CompletionTextEdit { + fn text_edit(&self) -> Option<&TextEdit> { + let CompletionTextEdit::Edit(edit) = self; + Some(edit) + } +} diff --git a/crates/texlab_protocol/src/lib.rs b/crates/texlab_protocol/src/lib.rs index edb72d1e0..40180f3c5 100644 --- a/crates/texlab_protocol/src/lib.rs +++ b/crates/texlab_protocol/src/lib.rs @@ -1,6 +1,7 @@ mod capabilities; mod client; mod codec; +mod edit; mod options; mod range; mod uri; @@ -9,6 +10,7 @@ pub use self::{ capabilities::ClientCapabilitiesExt, client::{LatexLspClient, LspClient}, codec::LspCodec, + edit::*, options::*, range::RangeExt, uri::{AsUri, Uri}, diff --git a/crates/texlab_symbol/src/lib.rs b/crates/texlab_symbol/src/lib.rs index 0db55cde3..c17717db5 100644 --- a/crates/texlab_symbol/src/lib.rs +++ b/crates/texlab_symbol/src/lib.rs @@ -19,7 +19,8 @@ use std::{ use texlab_feature::{ConcatProvider, DocumentView, FeatureProvider, FeatureRequest, Snapshot}; use texlab_protocol::{ ClientCapabilities, ClientCapabilitiesExt, DocumentSymbolParams, DocumentSymbolResponse, - Options, SymbolInformation, TextDocumentIdentifier, Uri, WorkspaceSymbolParams, + Options, PartialResultParams, SymbolInformation, TextDocumentIdentifier, Uri, + WorkDoneProgressParams, WorkspaceSymbolParams, }; use texlab_tex::DynamicDistribution; @@ -100,6 +101,8 @@ pub async fn workspace_symbols<'a>( let req = FeatureRequest { params: DocumentSymbolParams { text_document: TextDocumentIdentifier::new(uri.clone().into()), + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }, view: DocumentView::analyze( Arc::clone(&snapshot), diff --git a/src/test/mod.rs b/src/test/mod.rs index 8cf9d1c06..3685efcad 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -387,6 +387,8 @@ impl TestBed { pub async fn document_link(&self, relative_path: &str) -> Option> { let params = DocumentLinkParams { text_document: self.identifier(relative_path), + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }; self.client.document_link(params).await.ok() } @@ -407,6 +409,7 @@ impl TestBed { include_declaration, }, work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }; self.client.references(params).await.ok() } @@ -446,6 +449,8 @@ impl TestBed { ) -> Option> { let params = DocumentSymbolParams { text_document: self.identifier(relative_path), + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }; match self.client.document_symbol(params).await.ok()? { DocumentSymbolResponse::Flat(symbols) => Some(symbols), @@ -456,6 +461,8 @@ impl TestBed { pub async fn document_symbol_nested(&self, relative_path: &str) -> Option> { let params = DocumentSymbolParams { text_document: self.identifier(relative_path), + work_done_progress_params: WorkDoneProgressParams::default(), + partial_result_params: PartialResultParams::default(), }; match self.client.document_symbol(params).await.ok()? { DocumentSymbolResponse::Flat(_) => unreachable!(), diff --git a/tests/integration/completion.rs b/tests/integration/completion.rs index 038c3e7ad..40eeec12f 100644 --- a/tests/integration/completion.rs +++ b/tests/integration/completion.rs @@ -2,7 +2,8 @@ use indoc::indoc; use itertools::Itertools; use texlab::test::{TestBed, TestBedBuilder, TestLspClient, PULL_CAPABILITIES}; use texlab_protocol::{ - CompletionItem, Documentation, MarkupContent, MarkupKind, Range, RangeExt, TextEdit, + CompletionItem, CompletionTextEdit, Documentation, MarkupContent, MarkupKind, Range, RangeExt, + TextEdit, }; async fn run_item( @@ -49,10 +50,10 @@ fn verify_text_edit( ) { assert_eq!( *item.text_edit.as_ref().unwrap(), - TextEdit::new( + CompletionTextEdit::Edit(TextEdit::new( Range::new_simple(start_line, start_character, end_line, end_character), text.into() - ) + )) ); }