aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests/heavy_tests/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests/main.rs')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs41
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};
6use ra_lsp_server::req::{ 6use ra_lsp_server::req::{
7 CodeActionParams, CodeActionRequest, Formatting, Runnables, RunnablesParams, 7 CodeActionParams, CodeActionRequest, Formatting, Runnables, RunnablesParams, CompletionParams, Completion,
8}; 8};
9use serde_json::json; 9use serde_json::json;
10 10
@@ -13,6 +13,45 @@ use crate::support::project;
13const LOG: &'static str = ""; 13const LOG: &'static str = "";
14 14
15#[test] 15#[test]
16fn completes_items_from_standard_library() {
17 let server = project(
18 r#"
19//- Cargo.toml
20[package]
21name = "foo"
22version = "0.0.0"
23
24//- src/lib.rs
25use 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]
16fn test_runnables_no_project() { 55fn test_runnables_no_project() {
17 let server = project( 56 let server = project(
18 r" 57 r"