diff options
author | Aleksey Kladov <[email protected]> | 2019-01-10 17:13:08 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-10 21:51:34 +0000 |
commit | e8923713c51bc3484bd98085ad620713959bbc0d (patch) | |
tree | d7146aa1dac0e3d056daacf47770a239cf1f62c6 /crates/ra_lsp_server/tests/heavy_tests | |
parent | b6bc55f542c88b1b0789435219f9dbf38c110f47 (diff) |
add sysroot boilerplate
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/main.rs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs index 9eaf46ac8..927664ffb 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/main.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs | |||
@@ -4,7 +4,7 @@ use languageserver_types::{ | |||
4 | CodeActionContext, DocumentFormattingParams, FormattingOptions, Position, Range, | 4 | CodeActionContext, DocumentFormattingParams, FormattingOptions, Position, Range, |
5 | }; | 5 | }; |
6 | use ra_lsp_server::req::{ | 6 | use ra_lsp_server::req::{ |
7 | CodeActionParams, CodeActionRequest, Formatting, Runnables, RunnablesParams, | 7 | CodeActionParams, CodeActionRequest, Formatting, Runnables, RunnablesParams, CompletionParams, Completion, |
8 | }; | 8 | }; |
9 | use serde_json::json; | 9 | use serde_json::json; |
10 | 10 | ||
@@ -13,6 +13,45 @@ use crate::support::project; | |||
13 | const LOG: &'static str = ""; | 13 | const LOG: &'static str = ""; |
14 | 14 | ||
15 | #[test] | 15 | #[test] |
16 | fn completes_items_from_standard_library() { | ||
17 | let server = project( | ||
18 | r#" | ||
19 | //- Cargo.toml | ||
20 | [package] | ||
21 | name = "foo" | ||
22 | version = "0.0.0" | ||
23 | |||
24 | //- src/lib.rs | ||
25 | use std::collections::; | ||
26 | "#, | ||
27 | ); | ||
28 | server.wait_for_feedback("workspace loaded"); | ||
29 | server.request::<Completion>( | ||
30 | CompletionParams { | ||
31 | text_document: server.doc_id("src/lib.rs"), | ||
32 | context: None, | ||
33 | position: Position::new(0, 22), | ||
34 | }, | ||
35 | json!([ | ||
36 | { | ||
37 | "filterText": "self", | ||
38 | "insertText": "self", | ||
39 | "insertTextFormat": 1, | ||
40 | "kind": 14, | ||
41 | "label": "self" | ||
42 | }, | ||
43 | { | ||
44 | "filterText": "super", | ||
45 | "insertText": "super", | ||
46 | "insertTextFormat": 1, | ||
47 | "kind": 14, | ||
48 | "label": "super" | ||
49 | } | ||
50 | ]), | ||
51 | ); | ||
52 | } | ||
53 | |||
54 | #[test] | ||
16 | fn test_runnables_no_project() { | 55 | fn test_runnables_no_project() { |
17 | let server = project( | 56 | let server = project( |
18 | r" | 57 | r" |