From d1a67c1174abfb99b67b8db89c9f27c741e85057 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 28 Jan 2019 14:43:07 +0300 Subject: align command naming --- crates/ra_lsp_server/src/main_loop/handlers.rs | 4 ++-- crates/ra_lsp_server/src/req.rs | 22 +++++++++++----------- crates/ra_lsp_server/tests/heavy_tests/main.rs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index ace3da020..9478ebfb8 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -581,7 +581,7 @@ pub fn handle_code_action( let edit = source_edit.try_conv_with(&world)?; let cmd = Command { title, - command: "ra-lsp.applySourceChange".to_string(), + command: "rust-analyzer.applySourceChange".to_string(), arguments: Some(vec![to_value(edit).unwrap()]), }; res.push(cmd); @@ -623,7 +623,7 @@ pub fn handle_code_lens( range, command: Some(Command { title: title.into(), - command: "ra-lsp.run-single".into(), + command: "rust-analyzer.runSingle".into(), arguments: Some(vec![to_value(r).unwrap()]), }), data: None, diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 5968e592b..a4d890755 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs @@ -16,7 +16,7 @@ pub enum AnalyzerStatus {} impl Request for AnalyzerStatus { type Params = (); type Result = String; - const METHOD: &'static str = "ra/analyzerStatus"; + const METHOD: &'static str = "rust-analyzer/analyzerStatus"; } pub enum CollectGarbage {} @@ -24,7 +24,7 @@ pub enum CollectGarbage {} impl Request for CollectGarbage { type Params = (); type Result = (); - const METHOD: &'static str = "ra/collectGarbage"; + const METHOD: &'static str = "rust-analyzer/collectGarbage"; } pub enum SyntaxTree {} @@ -32,7 +32,7 @@ pub enum SyntaxTree {} impl Request for SyntaxTree { type Params = SyntaxTreeParams; type Result = String; - const METHOD: &'static str = "m/syntaxTree"; + const METHOD: &'static str = "rust-analyzer/syntaxTree"; } #[derive(Deserialize, Debug)] @@ -46,7 +46,7 @@ pub enum ExtendSelection {} impl Request for ExtendSelection { type Params = ExtendSelectionParams; type Result = ExtendSelectionResult; - const METHOD: &'static str = "m/extendSelection"; + const METHOD: &'static str = "rust-analyzer/extendSelection"; } #[derive(Deserialize, Debug)] @@ -67,7 +67,7 @@ pub enum FindMatchingBrace {} impl Request for FindMatchingBrace { type Params = FindMatchingBraceParams; type Result = Vec; - const METHOD: &'static str = "m/findMatchingBrace"; + const METHOD: &'static str = "rust-analyzer/findMatchingBrace"; } #[derive(Deserialize, Debug)] @@ -82,14 +82,14 @@ pub enum DecorationsRequest {} impl Request for DecorationsRequest { type Params = TextDocumentIdentifier; type Result = Vec; - const METHOD: &'static str = "m/decorationsRequest"; + const METHOD: &'static str = "rust-analyzer/decorationsRequest"; } pub enum PublishDecorations {} impl Notification for PublishDecorations { type Params = PublishDecorationsParams; - const METHOD: &'static str = "m/publishDecorations"; + const METHOD: &'static str = "rust-analyzer/publishDecorations"; } #[derive(Serialize, Debug)] @@ -112,7 +112,7 @@ pub enum ParentModule {} impl Request for ParentModule { type Params = TextDocumentPositionParams; type Result = Vec; - const METHOD: &'static str = "m/parentModule"; + const METHOD: &'static str = "rust-analyzer/parentModule"; } pub enum JoinLines {} @@ -120,7 +120,7 @@ pub enum JoinLines {} impl Request for JoinLines { type Params = JoinLinesParams; type Result = SourceChange; - const METHOD: &'static str = "m/joinLines"; + const METHOD: &'static str = "rust-analyzer/joinLines"; } #[derive(Deserialize, Debug)] @@ -135,7 +135,7 @@ pub enum OnEnter {} impl Request for OnEnter { type Params = TextDocumentPositionParams; type Result = Option; - const METHOD: &'static str = "m/onEnter"; + const METHOD: &'static str = "rust-analyzer/onEnter"; } pub enum Runnables {} @@ -143,7 +143,7 @@ pub enum Runnables {} impl Request for Runnables { type Params = RunnablesParams; type Result = Vec; - const METHOD: &'static str = "m/runnables"; + const METHOD: &'static str = "rust-analyzer/runnables"; } #[derive(Serialize, Deserialize, Debug)] diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs index 8b5c43a09..bfb0645a8 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/main.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs @@ -246,7 +246,7 @@ fn main() {} "label": "create module" } ], - "command": "ra-lsp.applySourceChange", + "command": "rust-analyzer.applySourceChange", "title": "create module" } ]), -- cgit v1.2.3