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:
Piotr Osiewicz 2024-06-13 13:48:12 +02:00 committed by GitHub
parent 21764c38dd
commit 7798f64d1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 344 additions and 191 deletions

View file

@ -185,7 +185,7 @@ impl LspCommand for PrepareRename {
) -> lsp::TextDocumentPositionParams {
lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
}
@ -309,7 +309,7 @@ impl LspCommand for PerformRename {
lsp::RenameParams {
text_document_position: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -428,7 +428,7 @@ impl LspCommand for GetDefinition {
lsp::GotoDefinitionParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -521,7 +521,7 @@ impl LspCommand for GetImplementation {
lsp::GotoImplementationParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -622,7 +622,7 @@ impl LspCommand for GetTypeDefinition {
lsp::GotoTypeDefinitionParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -818,7 +818,7 @@ async fn location_links_from_lsp(
let target_buffer_handle = project
.update(&mut cx, |this, cx| {
this.open_local_buffer_via_lsp(
target_uri,
target_uri.into(),
language_server.server_id(),
lsp_adapter.name.clone(),
cx,
@ -925,7 +925,7 @@ impl LspCommand for GetReferences {
lsp::ReferenceParams {
text_document_position: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -954,7 +954,7 @@ impl LspCommand for GetReferences {
let target_buffer_handle = project
.update(&mut cx, |this, cx| {
this.open_local_buffer_via_lsp(
lsp_location.uri,
lsp_location.uri.into(),
language_server.server_id(),
lsp_adapter.name.clone(),
cx,
@ -1092,7 +1092,7 @@ impl LspCommand for GetDocumentHighlights {
lsp::DocumentHighlightParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -1239,7 +1239,7 @@ impl LspCommand for GetHover {
lsp::HoverParams {
text_document_position_params: lsp::TextDocumentPositionParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
position: point_to_lsp(self.position),
},
@ -1461,7 +1461,7 @@ impl LspCommand for GetCompletions {
) -> lsp::CompletionParams {
lsp::CompletionParams {
text_document_position: lsp::TextDocumentPositionParams::new(
lsp::TextDocumentIdentifier::new(lsp::Url::from_file_path(path).unwrap()),
lsp::TextDocumentIdentifier::new(lsp::Uri::from_file_path(path).unwrap().into()),
point_to_lsp(self.position),
),
context: Default::default(),
@ -1760,7 +1760,7 @@ impl LspCommand for GetCodeActions {
lsp::CodeActionParams {
text_document: lsp::TextDocumentIdentifier::new(
lsp::Url::from_file_path(path).unwrap(),
lsp::Uri::from_file_path(path).unwrap().into(),
),
range: range_to_lsp(self.range.to_point_utf16(buffer)),
work_done_progress_params: Default::default(),
@ -1932,7 +1932,7 @@ impl LspCommand for OnTypeFormatting {
) -> lsp::DocumentOnTypeFormattingParams {
lsp::DocumentOnTypeFormattingParams {
text_document_position: lsp::TextDocumentPositionParams::new(
lsp::TextDocumentIdentifier::new(lsp::Url::from_file_path(path).unwrap()),
lsp::TextDocumentIdentifier::new(lsp::Uri::from_file_path(path).unwrap().into()),
point_to_lsp(self.position),
),
ch: self.trigger.clone(),
@ -2274,8 +2274,9 @@ impl InlayHints {
Some(((uri, range), server_id)) => Some((
LanguageServerId(server_id as usize),
lsp::Location {
uri: lsp::Url::parse(&uri)
.context("invalid uri in hint part {part:?}")?,
uri: lsp::Uri::from_file_path(&uri)
.context("invalid uri in hint part {part:?}")?
.into(),
range: lsp::Range::new(
point_to_lsp(PointUtf16::new(
range.start.row,
@ -2435,7 +2436,7 @@ impl LspCommand for InlayHints {
) -> lsp::InlayHintParams {
lsp::InlayHintParams {
text_document: lsp::TextDocumentIdentifier {
uri: lsp::Url::from_file_path(path).unwrap(),
uri: lsp::Uri::from_file_path(path).unwrap().into(),
},
range: range_to_lsp(self.range.to_point_utf16(buffer)),
work_done_progress_params: Default::default(),
@ -2591,7 +2592,7 @@ impl LspCommand for LinkedEditingRange {
let position = self.position.to_point_utf16(&buffer.snapshot());
lsp::LinkedEditingRangeParams {
text_document_position_params: lsp::TextDocumentPositionParams::new(
lsp::TextDocumentIdentifier::new(lsp::Url::from_file_path(path).unwrap()),
lsp::TextDocumentIdentifier::new(lsp::Uri::from_file_path(path).unwrap().into()),
point_to_lsp(position),
),
work_done_progress_params: Default::default(),