From b6740060f60fa016ac1c3d420c9ac919d31f6997 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:15:12 +0100 Subject: Refactor --- crates/ra_lsp_server/src/main_loop/handlers.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index ae51141cb..833f31d96 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -921,7 +921,8 @@ fn to_lsp_runnable( file_id: FileId, runnable: Runnable, ) -> Result { - let args = runnable_args(world, file_id, &runnable.kind)?; + let spec: Option = CargoTargetSpec::for_file(world, file_id)?; + let args = runnable_args(spec, &runnable.kind)?; let line_index = world.analysis().file_line_index(file_id)?; let label = match &runnable.kind { RunnableKind::Test { test_id } => format!("test {}", test_id), -- cgit v1.2.3 From 1f142d79ed251db58570a5863b06c8826221f9c9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:17:47 +0100 Subject: Refactor --- crates/ra_lsp_server/src/main_loop/handlers.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 833f31d96..92f219e28 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -29,7 +29,7 @@ use serde::{Deserialize, Serialize}; use serde_json::to_value; use crate::{ - cargo_target_spec::{runnable_args, CargoTargetSpec}, + cargo_target_spec::CargoTargetSpec, conv::{ to_call_hierarchy_item, to_location, Conv, ConvWith, FoldConvCtx, MapConvWith, TryConvWith, TryConvWithToVec, @@ -921,8 +921,8 @@ fn to_lsp_runnable( file_id: FileId, runnable: Runnable, ) -> Result { - let spec: Option = CargoTargetSpec::for_file(world, file_id)?; - let args = runnable_args(spec, &runnable.kind)?; + let spec = CargoTargetSpec::for_file(world, file_id)?; + let args = CargoTargetSpec::runnable_args(spec, &runnable.kind)?; let line_index = world.analysis().file_line_index(file_id)?; let label = match &runnable.kind { RunnableKind::Test { test_id } => format!("test {}", test_id), -- cgit v1.2.3 From 4d307ff8024c8d2d533bc3ab7aac1d63ca5c5977 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:25:26 +0100 Subject: Fully document ra_lsp_server --- crates/ra_lsp_server/src/main_loop/handlers.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 92f219e28..bb7bab372 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -1,5 +1,6 @@ -//! This module is responsible for implementing handlers for Lanuage Server Protocol. -//! The majority of requests are fulfilled by calling into the `ra_ide` crate. +//! This module is responsible for implementing handlers for Language Server +//! Protocol. The majority of requests are fulfilled by calling into the +//! `ra_ide` crate. use std::{ collections::hash_map::Entry, -- cgit v1.2.3