chore: Bump lsp-types to 0.97.0 (#12928)
This also includes https://github.com/gluon-lang/lsp-types/pull/287, which should significantly reduce the time it takes for us to deserialize completion lists. Release Notes: - N/A
This commit is contained in:
parent
21764c38dd
commit
7798f64d1b
22 changed files with 344 additions and 191 deletions
|
@ -344,7 +344,7 @@ async fn test_collaborating_with_completion(cx_a: &mut TestAppContext, cx_b: &mu
|
|||
.handle_request::<lsp::request::Completion, _, _>(|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document_position.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(
|
||||
params.text_document_position.position,
|
||||
|
@ -461,7 +461,7 @@ async fn test_collaborating_with_completion(cx_a: &mut TestAppContext, cx_b: &mu
|
|||
.handle_request::<lsp::request::Completion, _, _>(|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document_position.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(
|
||||
params.text_document_position.position,
|
||||
|
@ -585,7 +585,7 @@ async fn test_collaborating_with_code_actions(
|
|||
.handle_request::<lsp::request::CodeActionRequest, _, _>(|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(params.range.start, lsp::Position::new(0, 0));
|
||||
assert_eq!(params.range.end, lsp::Position::new(0, 0));
|
||||
|
@ -607,7 +607,7 @@ async fn test_collaborating_with_code_actions(
|
|||
.handle_request::<lsp::request::CodeActionRequest, _, _>(|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(params.range.start, lsp::Position::new(1, 31));
|
||||
assert_eq!(params.range.end, lsp::Position::new(1, 31));
|
||||
|
@ -619,7 +619,7 @@ async fn test_collaborating_with_code_actions(
|
|||
changes: Some(
|
||||
[
|
||||
(
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
vec![lsp::TextEdit::new(
|
||||
lsp::Range::new(
|
||||
lsp::Position::new(1, 22),
|
||||
|
@ -629,7 +629,7 @@ async fn test_collaborating_with_code_actions(
|
|||
)],
|
||||
),
|
||||
(
|
||||
lsp::Url::from_file_path("/a/other.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/other.rs").unwrap().into(),
|
||||
vec![lsp::TextEdit::new(
|
||||
lsp::Range::new(
|
||||
lsp::Position::new(0, 0),
|
||||
|
@ -689,7 +689,7 @@ async fn test_collaborating_with_code_actions(
|
|||
changes: Some(
|
||||
[
|
||||
(
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
vec![lsp::TextEdit::new(
|
||||
lsp::Range::new(
|
||||
lsp::Position::new(1, 22),
|
||||
|
@ -699,7 +699,7 @@ async fn test_collaborating_with_code_actions(
|
|||
)],
|
||||
),
|
||||
(
|
||||
lsp::Url::from_file_path("/a/other.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/other.rs").unwrap().into(),
|
||||
vec![lsp::TextEdit::new(
|
||||
lsp::Range::new(
|
||||
lsp::Position::new(0, 0),
|
||||
|
@ -897,14 +897,14 @@ async fn test_collaborating_with_renames(cx_a: &mut TestAppContext, cx_b: &mut T
|
|||
changes: Some(
|
||||
[
|
||||
(
|
||||
lsp::Url::from_file_path("/dir/one.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/dir/one.rs").unwrap().into(),
|
||||
vec![lsp::TextEdit::new(
|
||||
lsp::Range::new(lsp::Position::new(0, 6), lsp::Position::new(0, 9)),
|
||||
"THREE".to_string(),
|
||||
)],
|
||||
),
|
||||
(
|
||||
lsp::Url::from_file_path("/dir/two.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/dir/two.rs").unwrap().into(),
|
||||
vec![
|
||||
lsp::TextEdit::new(
|
||||
lsp::Range::new(
|
||||
|
@ -1313,7 +1313,7 @@ async fn test_on_input_format_from_host_to_guest(
|
|||
|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document_position.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(
|
||||
params.text_document_position.position,
|
||||
|
@ -1441,7 +1441,7 @@ async fn test_on_input_format_from_guest_to_host(
|
|||
.handle_request::<lsp::request::OnTypeFormatting, _, _>(|params, _| async move {
|
||||
assert_eq!(
|
||||
params.text_document_position.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
assert_eq!(
|
||||
params.text_document_position.position,
|
||||
|
@ -1610,7 +1610,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
|
|||
async move {
|
||||
assert_eq!(
|
||||
params.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
let edits_made = task_edits_made.load(atomic::Ordering::Acquire);
|
||||
Ok(Some(vec![lsp::InlayHint {
|
||||
|
@ -1873,7 +1873,7 @@ async fn test_inlay_hint_refresh_is_forwarded(
|
|||
async move {
|
||||
assert_eq!(
|
||||
params.text_document.uri,
|
||||
lsp::Url::from_file_path("/a/main.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/a/main.rs").unwrap().into(),
|
||||
);
|
||||
let other_hints = task_other_hints.load(atomic::Ordering::Acquire);
|
||||
let character = if other_hints { 0 } else { 2 };
|
||||
|
|
|
@ -3897,7 +3897,7 @@ async fn test_collaborating_with_diagnostics(
|
|||
.await;
|
||||
fake_language_server.notify::<lsp::notification::PublishDiagnostics>(
|
||||
lsp::PublishDiagnosticsParams {
|
||||
uri: lsp::Url::from_file_path("/a/a.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/a/a.rs").unwrap().into(),
|
||||
version: None,
|
||||
diagnostics: vec![lsp::Diagnostic {
|
||||
severity: Some(lsp::DiagnosticSeverity::WARNING),
|
||||
|
@ -3917,7 +3917,7 @@ async fn test_collaborating_with_diagnostics(
|
|||
.unwrap();
|
||||
fake_language_server.notify::<lsp::notification::PublishDiagnostics>(
|
||||
lsp::PublishDiagnosticsParams {
|
||||
uri: lsp::Url::from_file_path("/a/a.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/a/a.rs").unwrap().into(),
|
||||
version: None,
|
||||
diagnostics: vec![lsp::Diagnostic {
|
||||
severity: Some(lsp::DiagnosticSeverity::ERROR),
|
||||
|
@ -3991,7 +3991,7 @@ async fn test_collaborating_with_diagnostics(
|
|||
// Simulate a language server reporting more errors for a file.
|
||||
fake_language_server.notify::<lsp::notification::PublishDiagnostics>(
|
||||
lsp::PublishDiagnosticsParams {
|
||||
uri: lsp::Url::from_file_path("/a/a.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/a/a.rs").unwrap().into(),
|
||||
version: None,
|
||||
diagnostics: vec![
|
||||
lsp::Diagnostic {
|
||||
|
@ -4085,7 +4085,7 @@ async fn test_collaborating_with_diagnostics(
|
|||
// Simulate a language server reporting no errors for a file.
|
||||
fake_language_server.notify::<lsp::notification::PublishDiagnostics>(
|
||||
lsp::PublishDiagnosticsParams {
|
||||
uri: lsp::Url::from_file_path("/a/a.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/a/a.rs").unwrap().into(),
|
||||
version: None,
|
||||
diagnostics: vec![],
|
||||
},
|
||||
|
@ -4189,7 +4189,9 @@ async fn test_collaborating_with_lsp_progress_updates_and_diagnostics_ordering(
|
|||
for file_name in file_names {
|
||||
fake_language_server.notify::<lsp::notification::PublishDiagnostics>(
|
||||
lsp::PublishDiagnosticsParams {
|
||||
uri: lsp::Url::from_file_path(Path::new("/test").join(file_name)).unwrap(),
|
||||
uri: lsp::Uri::from_file_path(Path::new("/test").join(file_name))
|
||||
.unwrap()
|
||||
.into(),
|
||||
version: None,
|
||||
diagnostics: vec![lsp::Diagnostic {
|
||||
severity: Some(lsp::DiagnosticSeverity::WARNING),
|
||||
|
@ -4607,7 +4609,7 @@ async fn test_definition(
|
|||
fake_language_server.handle_request::<lsp::request::GotoDefinition, _, _>(|_, _| async move {
|
||||
Ok(Some(lsp::GotoDefinitionResponse::Scalar(
|
||||
lsp::Location::new(
|
||||
lsp::Url::from_file_path("/root/dir-2/b.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/root/dir-2/b.rs").unwrap().into(),
|
||||
lsp::Range::new(lsp::Position::new(0, 6), lsp::Position::new(0, 9)),
|
||||
),
|
||||
)))
|
||||
|
@ -4636,7 +4638,7 @@ async fn test_definition(
|
|||
fake_language_server.handle_request::<lsp::request::GotoDefinition, _, _>(|_, _| async move {
|
||||
Ok(Some(lsp::GotoDefinitionResponse::Scalar(
|
||||
lsp::Location::new(
|
||||
lsp::Url::from_file_path("/root/dir-2/b.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/root/dir-2/b.rs").unwrap().into(),
|
||||
lsp::Range::new(lsp::Position::new(1, 6), lsp::Position::new(1, 11)),
|
||||
),
|
||||
)))
|
||||
|
@ -4672,7 +4674,7 @@ async fn test_definition(
|
|||
);
|
||||
Ok(Some(lsp::GotoDefinitionResponse::Scalar(
|
||||
lsp::Location::new(
|
||||
lsp::Url::from_file_path("/root/dir-2/c.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/root/dir-2/c.rs").unwrap().into(),
|
||||
lsp::Range::new(lsp::Position::new(0, 5), lsp::Position::new(0, 7)),
|
||||
),
|
||||
)))
|
||||
|
@ -4784,15 +4786,21 @@ async fn test_references(
|
|||
lsp_response_tx
|
||||
.unbounded_send(Ok(Some(vec![
|
||||
lsp::Location {
|
||||
uri: lsp::Url::from_file_path("/root/dir-1/two.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/root/dir-1/two.rs")
|
||||
.unwrap()
|
||||
.into(),
|
||||
range: lsp::Range::new(lsp::Position::new(0, 24), lsp::Position::new(0, 27)),
|
||||
},
|
||||
lsp::Location {
|
||||
uri: lsp::Url::from_file_path("/root/dir-1/two.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/root/dir-1/two.rs")
|
||||
.unwrap()
|
||||
.into(),
|
||||
range: lsp::Range::new(lsp::Position::new(0, 35), lsp::Position::new(0, 38)),
|
||||
},
|
||||
lsp::Location {
|
||||
uri: lsp::Url::from_file_path("/root/dir-2/three.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/root/dir-2/three.rs")
|
||||
.unwrap()
|
||||
.into(),
|
||||
range: lsp::Range::new(lsp::Position::new(0, 37), lsp::Position::new(0, 40)),
|
||||
},
|
||||
])))
|
||||
|
@ -5292,7 +5300,9 @@ async fn test_project_symbols(
|
|||
lsp::SymbolInformation {
|
||||
name: "TWO".into(),
|
||||
location: lsp::Location {
|
||||
uri: lsp::Url::from_file_path("/code/crate-2/two.rs").unwrap(),
|
||||
uri: lsp::Uri::from_file_path("/code/crate-2/two.rs")
|
||||
.unwrap()
|
||||
.into(),
|
||||
range: lsp::Range::new(lsp::Position::new(0, 6), lsp::Position::new(0, 9)),
|
||||
},
|
||||
kind: lsp::SymbolKind::CONSTANT,
|
||||
|
@ -5382,7 +5392,7 @@ async fn test_open_buffer_while_getting_definition_pointing_to_it(
|
|||
fake_language_server.handle_request::<lsp::request::GotoDefinition, _, _>(|_, _| async move {
|
||||
Ok(Some(lsp::GotoDefinitionResponse::Scalar(
|
||||
lsp::Location::new(
|
||||
lsp::Url::from_file_path("/root/b.rs").unwrap(),
|
||||
lsp::Uri::from_file_path("/root/b.rs").unwrap().into(),
|
||||
lsp::Range::new(lsp::Position::new(0, 6), lsp::Position::new(0, 9)),
|
||||
),
|
||||
)))
|
||||
|
|
|
@ -1099,7 +1099,7 @@ impl RandomizedTest for ProjectCollaborationTest {
|
|||
files
|
||||
.into_iter()
|
||||
.map(|file| lsp::Location {
|
||||
uri: lsp::Url::from_file_path(file).unwrap(),
|
||||
uri: lsp::Uri::from_file_path(file).unwrap().into(),
|
||||
range: Default::default(),
|
||||
})
|
||||
.collect(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue