diff options
author | Aleksey Kladov <[email protected]> | 2018-08-27 20:52:43 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-27 20:52:43 +0100 |
commit | 422efe59afe333a8371afe6f9fb45f159a6fb07f (patch) | |
tree | cfdc2a4209419e690257cff2235b3fd3f75fe53d /crates | |
parent | 57518153147ad53639f16cc940d219dc582c550a (diff) |
you better run
Diffstat (limited to 'crates')
-rw-r--r-- | crates/server/src/main_loop/handlers.rs | 42 | ||||
-rw-r--r-- | crates/server/src/req.rs | 2 | ||||
-rw-r--r-- | crates/tools/src/main.rs | 2 |
3 files changed, 2 insertions, 44 deletions
diff --git a/crates/server/src/main_loop/handlers.rs b/crates/server/src/main_loop/handlers.rs index 583af0900..ee4072084 100644 --- a/crates/server/src/main_loop/handlers.rs +++ b/crates/server/src/main_loop/handlers.rs | |||
@@ -135,48 +135,6 @@ pub fn handle_code_action( | |||
135 | res.push(cmd); | 135 | res.push(cmd); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | for runnable in libeditor::runnables(&file) { | ||
139 | if !contains_offset_nonstrict(runnable.range, offset) { | ||
140 | continue; | ||
141 | } | ||
142 | |||
143 | #[derive(Serialize)] | ||
144 | struct ProcessSpec { | ||
145 | bin: String, | ||
146 | args: Vec<String>, | ||
147 | env: HashMap<String, String>, | ||
148 | } | ||
149 | |||
150 | let spec = ProcessSpec { | ||
151 | bin: "cargo".to_string(), | ||
152 | args: match runnable.kind { | ||
153 | libeditor::RunnableKind::Test { name } => { | ||
154 | vec![ | ||
155 | "test".to_string(), | ||
156 | "--".to_string(), | ||
157 | name, | ||
158 | "--nocapture".to_string(), | ||
159 | ] | ||
160 | } | ||
161 | libeditor::RunnableKind::Bin => vec!["run".to_string()] | ||
162 | }, | ||
163 | env: { | ||
164 | let mut m = HashMap::new(); | ||
165 | m.insert( | ||
166 | "RUST_BACKTRACE".to_string(), | ||
167 | "short".to_string(), | ||
168 | ); | ||
169 | m | ||
170 | } | ||
171 | }; | ||
172 | |||
173 | let cmd = Command { | ||
174 | title: "Run ...".to_string(), | ||
175 | command: "libsyntax-rust.run".to_string(), | ||
176 | arguments: Some(vec![to_value(spec).unwrap()]), | ||
177 | }; | ||
178 | res.push(cmd); | ||
179 | } | ||
180 | 138 | ||
181 | for (diag, quick_fix) in world.analysis().diagnostics(file_id)? { | 139 | for (diag, quick_fix) in world.analysis().diagnostics(file_id)? { |
182 | let quick_fix = match quick_fix { | 140 | let quick_fix = match quick_fix { |
diff --git a/crates/server/src/req.rs b/crates/server/src/req.rs index e4138abba..269246dff 100644 --- a/crates/server/src/req.rs +++ b/crates/server/src/req.rs | |||
@@ -142,7 +142,7 @@ pub enum Runnables {} | |||
142 | impl Request for Runnables { | 142 | impl Request for Runnables { |
143 | type Params = RunnablesParams; | 143 | type Params = RunnablesParams; |
144 | type Result = Vec<Runnable>; | 144 | type Result = Vec<Runnable>; |
145 | const METHOD: &'static str = "m/joinLines"; | 145 | const METHOD: &'static str = "m/runnables"; |
146 | } | 146 | } |
147 | 147 | ||
148 | #[derive(Deserialize, Debug)] | 148 | #[derive(Deserialize, Debug)] |
diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index 289ad6e3c..d7f34d757 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs | |||
@@ -204,7 +204,7 @@ cd code | |||
204 | execute!( | 204 | execute!( |
205 | r" | 205 | r" |
206 | cd code | 206 | cd code |
207 | code --install-extension ./libsyntax-rust-0.0.1.vsix | 207 | code --install-extension ./rcf-lsp-0.0.1.vsix |
208 | " | 208 | " |
209 | )?; | 209 | )?; |
210 | Ok(()) | 210 | Ok(()) |