From bd9d7b6ad885f775df91ff3dfebd8927c8e272b2 Mon Sep 17 00:00:00 2001 From: vsrs Date: Fri, 5 Jun 2020 15:26:46 +0300 Subject: Remove hover actions heavy tests. --- crates/rust-analyzer/tests/heavy_tests/main.rs | 180 ------------------------- 1 file changed, 180 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/tests/heavy_tests/main.rs b/crates/rust-analyzer/tests/heavy_tests/main.rs index 78c6195d7..ad3476310 100644 --- a/crates/rust-analyzer/tests/heavy_tests/main.rs +++ b/crates/rust-analyzer/tests/heavy_tests/main.rs @@ -715,183 +715,3 @@ pub fn foo(_input: TokenStream) -> TokenStream { let value = res.get("contents").unwrap().get("value").unwrap().to_string(); assert_eq!(value, r#""```rust\nfoo::Bar\n```\n\n```rust\nfn bar()\n```""#) } - -#[test] -fn test_client_support_hover_actions() { - if skip_slow_tests() { - return; - } - - let server = Project::with_fixture( - r#" -//- Cargo.toml -[package] -name = "foo" -version = "0.0.0" - -//- src/lib.rs -struct Foo(u32); - -struct NoImpl(u32); - -impl Foo { - fn new() -> Self { - Self(1) - } -} -"#, - ) - .with_config(|config| { - config.client_caps.hover_actions = true; - }) - .server(); - - server.wait_until_workspace_is_loaded(); - - // has 1 implementation - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(0, 9), - ), - work_done_progress_params: Default::default(), - }, - json!({ - "actions": [{ - "commands": [{ - "arguments": [ - "file:///[..]src/lib.rs", - { - "character": 7, - "line": 0 - }, - [{ - "range": { "end": { "character": 1, "line": 8 }, "start": { "character": 0, "line": 4 } }, - "uri": "file:///[..]src/lib.rs" - }] - ], - "command": "rust-analyzer.showReferences", - "title": "1 implementation", - "tooltip": "Go to implementations" - }] - }], - "contents": { "kind": "markdown", "value": "```rust\nfoo\n```\n\n```rust\nstruct Foo\n```" }, - "range": { "end": { "character": 10, "line": 0 }, "start": { "character": 7, "line": 0 } } - }) - ); - - // no hover - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(1, 0), - ), - work_done_progress_params: Default::default(), - }, - json!(null), - ); - - // no implementations - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(2, 12), - ), - work_done_progress_params: Default::default(), - }, - json!({ - "actions": [{ - "commands": [{ - "arguments": [ - "file:///[..]src/lib.rs", - { "character": 7, "line": 2 }, - [] - ], - "command": "rust-analyzer.showReferences", - "title": "0 implementations", - "tooltip": "Go to implementations" - }] - }], - "contents": { "kind": "markdown", "value": "```rust\nfoo\n```\n\n```rust\nstruct NoImpl\n```" }, - "range": { "end": { "character": 13, "line": 2 }, "start": { "character": 7, "line": 2 } } - }) - ); -} - -#[test] -fn test_client_does_not_support_hover_actions() { - if skip_slow_tests() { - return; - } - - let server = Project::with_fixture( - r#" -//- Cargo.toml -[package] -name = "foo" -version = "0.0.0" - -//- src/lib.rs -struct Foo(u32); - -struct NoImpl(u32); - -impl Foo { - fn new() -> Self { - Self(1) - } -} -"#, - ) - .with_config(|config| { - config.client_caps.hover_actions = false; - }) - .server(); - - server.wait_until_workspace_is_loaded(); - - // has 1 implementation - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(0, 9), - ), - work_done_progress_params: Default::default(), - }, - json!({ - "contents": { "kind": "markdown", "value": "```rust\nfoo\n```\n\n```rust\nstruct Foo\n```" }, - "range": { "end": { "character": 10, "line": 0 }, "start": { "character": 7, "line": 0 } } - }) - ); - - // no hover - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(1, 0), - ), - work_done_progress_params: Default::default(), - }, - json!(null), - ); - - // no implementations - server.request::( - HoverParams { - text_document_position_params: TextDocumentPositionParams::new( - server.doc_id("src/lib.rs"), - Position::new(2, 12), - ), - work_done_progress_params: Default::default(), - }, - json!({ - "contents": { "kind": "markdown", "value": "```rust\nfoo\n```\n\n```rust\nstruct NoImpl\n```" }, - "range": { "end": { "character": 13, "line": 2 }, "start": { "character": 7, "line": 2 } } - }) - ); -} -- cgit v1.2.3