diff options
-rw-r--r-- | Cargo.lock | 10 | ||||
-rw-r--r-- | crates/gen_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 23 |
4 files changed, 19 insertions, 18 deletions
diff --git a/Cargo.lock b/Cargo.lock index eea206f99..a1bb96535 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -541,7 +541,7 @@ dependencies = [ | |||
541 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 541 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
542 | "flexi_logger 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", | 542 | "flexi_logger 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", |
543 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", | 543 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", |
544 | "lsp-types 0.58.1 (git+https://github.com/kjeremy/languageserver-types?branch=flatten)", | 544 | "lsp-types 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", |
545 | "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", | 545 | "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", |
546 | "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", | 546 | "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", |
547 | ] | 547 | ] |
@@ -774,8 +774,8 @@ dependencies = [ | |||
774 | 774 | ||
775 | [[package]] | 775 | [[package]] |
776 | name = "lsp-types" | 776 | name = "lsp-types" |
777 | version = "0.58.1" | 777 | version = "0.59.0" |
778 | source = "git+https://github.com/kjeremy/languageserver-types?branch=flatten#f3f793173bb1461602dabf83d324b638b3e6ec61" | 778 | source = "registry+https://github.com/rust-lang/crates.io-index" |
779 | dependencies = [ | 779 | dependencies = [ |
780 | "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 780 | "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
781 | "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", | 781 | "num-derive 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1200,7 +1200,7 @@ dependencies = [ | |||
1200 | "flexi_logger 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1200 | "flexi_logger 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1201 | "gen_lsp_server 0.2.0", | 1201 | "gen_lsp_server 0.2.0", |
1202 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", | 1202 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", |
1203 | "lsp-types 0.58.1 (git+https://github.com/kjeremy/languageserver-types?branch=flatten)", | 1203 | "lsp-types 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1204 | "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1204 | "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1205 | "ra_arena 0.1.0", | 1205 | "ra_arena 0.1.0", |
1206 | "ra_ide_api 0.1.0", | 1206 | "ra_ide_api 0.1.0", |
@@ -2201,7 +2201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2201 | "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" | 2201 | "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" |
2202 | "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" | 2202 | "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" |
2203 | "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" | 2203 | "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" |
2204 | "checksum lsp-types 0.58.1 (git+https://github.com/kjeremy/languageserver-types?branch=flatten)" = "<none>" | 2204 | "checksum lsp-types 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8961cde7f6f856771910edf37ff0729e59e02d2a8592a94c27495b746320e6ed" |
2205 | "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" | 2205 | "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" |
2206 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 2206 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
2207 | "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" | 2207 | "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" |
diff --git a/crates/gen_lsp_server/Cargo.toml b/crates/gen_lsp_server/Cargo.toml index 46b02a459..36a29265c 100644 --- a/crates/gen_lsp_server/Cargo.toml +++ b/crates/gen_lsp_server/Cargo.toml | |||
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
8 | description = "Generic LSP server scaffold." | 8 | description = "Generic LSP server scaffold." |
9 | 9 | ||
10 | [dependencies] | 10 | [dependencies] |
11 | lsp-types = { git = "https://github.com/kjeremy/languageserver-types", branch = "flatten" } | 11 | lsp-types = "0.59.0" |
12 | log = "0.4.3" | 12 | log = "0.4.3" |
13 | serde_json = "1.0.34" | 13 | serde_json = "1.0.34" |
14 | serde = { version = "1.0.83", features = ["derive"] } | 14 | serde = { version = "1.0.83", features = ["derive"] } |
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 9c9dda01f..50bc8111b 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -13,7 +13,7 @@ crossbeam-channel = "0.3.5" | |||
13 | flexi_logger = "0.13.0" | 13 | flexi_logger = "0.13.0" |
14 | log = "0.4.3" | 14 | log = "0.4.3" |
15 | url_serde = "0.2.0" | 15 | url_serde = "0.2.0" |
16 | lsp-types = { git = "https://github.com/kjeremy/languageserver-types", branch = "flatten", features = ["proposed"] } | 16 | lsp-types = { version = "0.59.0", features = ["proposed"] } |
17 | rustc-hash = "1.0" | 17 | rustc-hash = "1.0" |
18 | parking_lot = "0.8.0" | 18 | parking_lot = "0.8.0" |
19 | 19 | ||
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 6b407cb0c..62c8cbf71 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -2,11 +2,11 @@ use std::{fmt::Write as _, io::Write as _}; | |||
2 | 2 | ||
3 | use gen_lsp_server::ErrorCode; | 3 | use gen_lsp_server::ErrorCode; |
4 | use lsp_types::{ | 4 | use lsp_types::{ |
5 | CodeAction, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity, | 5 | CodeAction, CodeActionResponse, CodeLens, Command, CompletionItem, Diagnostic, |
6 | DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeKind, | 6 | DiagnosticSeverity, DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, |
7 | FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, | 7 | FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, |
8 | PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier, | 8 | MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation, |
9 | TextEdit, WorkspaceEdit, | 9 | TextDocumentIdentifier, TextEdit, WorkspaceEdit, |
10 | }; | 10 | }; |
11 | use ra_ide_api::{ | 11 | use ra_ide_api::{ |
12 | AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, | 12 | AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, |
@@ -212,7 +212,7 @@ pub fn handle_document_symbol( | |||
212 | } | 212 | } |
213 | } | 213 | } |
214 | 214 | ||
215 | Ok(Some(req::DocumentSymbolResponse::Nested(res))) | 215 | Ok(Some(res.into())) |
216 | } | 216 | } |
217 | 217 | ||
218 | pub fn handle_workspace_symbol( | 218 | pub fn handle_workspace_symbol( |
@@ -275,7 +275,7 @@ pub fn handle_goto_definition( | |||
275 | .map(|nav| RangeInfo::new(nav_range, nav)) | 275 | .map(|nav| RangeInfo::new(nav_range, nav)) |
276 | .map(|nav| to_location_link(&nav, &world, &line_index)) | 276 | .map(|nav| to_location_link(&nav, &world, &line_index)) |
277 | .collect::<Result<Vec<_>>>()?; | 277 | .collect::<Result<Vec<_>>>()?; |
278 | Ok(Some(req::GotoDefinitionResponse::Link(res))) | 278 | Ok(Some(res.into())) |
279 | } | 279 | } |
280 | 280 | ||
281 | pub fn handle_goto_implementation( | 281 | pub fn handle_goto_implementation( |
@@ -295,7 +295,7 @@ pub fn handle_goto_implementation( | |||
295 | .map(|nav| RangeInfo::new(nav_range, nav)) | 295 | .map(|nav| RangeInfo::new(nav_range, nav)) |
296 | .map(|nav| to_location_link(&nav, &world, &line_index)) | 296 | .map(|nav| to_location_link(&nav, &world, &line_index)) |
297 | .collect::<Result<Vec<_>>>()?; | 297 | .collect::<Result<Vec<_>>>()?; |
298 | Ok(Some(req::GotoDefinitionResponse::Link(res))) | 298 | Ok(Some(res.into())) |
299 | } | 299 | } |
300 | 300 | ||
301 | pub fn handle_goto_type_definition( | 301 | pub fn handle_goto_type_definition( |
@@ -315,7 +315,7 @@ pub fn handle_goto_type_definition( | |||
315 | .map(|nav| RangeInfo::new(nav_range, nav)) | 315 | .map(|nav| RangeInfo::new(nav_range, nav)) |
316 | .map(|nav| to_location_link(&nav, &world, &line_index)) | 316 | .map(|nav| to_location_link(&nav, &world, &line_index)) |
317 | .collect::<Result<Vec<_>>>()?; | 317 | .collect::<Result<Vec<_>>>()?; |
318 | Ok(Some(req::GotoDefinitionResponse::Link(res))) | 318 | Ok(Some(res.into())) |
319 | } | 319 | } |
320 | 320 | ||
321 | pub fn handle_parent_module( | 321 | pub fn handle_parent_module( |
@@ -433,9 +433,10 @@ pub fn handle_completion( | |||
433 | Some(items) => items, | 433 | Some(items) => items, |
434 | }; | 434 | }; |
435 | let line_index = world.analysis().file_line_index(position.file_id); | 435 | let line_index = world.analysis().file_line_index(position.file_id); |
436 | let items = items.into_iter().map(|item| item.conv_with(&line_index)).collect(); | 436 | let items: Vec<CompletionItem> = |
437 | items.into_iter().map(|item| item.conv_with(&line_index)).collect(); | ||
437 | 438 | ||
438 | Ok(Some(req::CompletionResponse::Array(items))) | 439 | Ok(Some(items.into())) |
439 | } | 440 | } |
440 | 441 | ||
441 | pub fn handle_folding_range( | 442 | pub fn handle_folding_range( |