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/server/src/main_loop | |
parent | 57518153147ad53639f16cc940d219dc582c550a (diff) |
you better run
Diffstat (limited to 'crates/server/src/main_loop')
-rw-r--r-- | crates/server/src/main_loop/handlers.rs | 42 |
1 files changed, 0 insertions, 42 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 { |