Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
use cargo check via API
Browse files Browse the repository at this point in the history
requires rust-lang/cargo#3427

closes #82

cc #90
  • Loading branch information
nrc committed Dec 19, 2016
1 parent 6f46a9f commit aaeec56
Show file tree
Hide file tree
Showing 8 changed files with 648 additions and 242 deletions.
489 changes: 438 additions & 51 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["Jonathan Turner <jturner@mozilla.com>"]

[dependencies]
cargo = { path = "../cargo" }
log = "0.3"
racer = { git = "https://github.com/phildawes/racer" }
rls-analysis = { git = "https://github.com/nrc/rls-analysis" }
Expand Down
2 changes: 1 addition & 1 deletion src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ActionHandler {
pub fn build(&self, project_path: &Path, priority: BuildPriority, out: &Output) {
out.notify("textDocument/diagnosticsBegin");

println!("build {:?}", project_path);
debug!("build {:?}", project_path);
let result = self.build_queue.request_build(project_path, priority);
match result {
BuildResult::Success(ref x) | BuildResult::Failure(ref x) => {
Expand Down
388 changes: 205 additions & 183 deletions src/build.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#![feature(rustc_private)]
#![feature(proc_macro)]

extern crate cargo;
#[macro_use]
extern crate derive_new;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl LsService {
Method::ReformatRange(params) => {
// FIXME reformats the whole file, not just a range.
// FIXME take account of options.
trace!("command(reformat): {:?}", params);
trace!("command(reformat range): {:?}", params);
this.handler.reformat(id, params.text_document, &*this.output);
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,6 @@ impl ls_server::MessageReader for MockRawMsgReader {
let message = &self.messages[self.cur.load(Ordering::SeqCst)];
self.cur.fetch_add(1, Ordering::SeqCst);

//let params = message.params.iter().map(|&(k, ref v)| format!("\"{}\":{}", k, v)).collect::<Vec<String>>().join(",");
// TODO don't hardcode the id, we should use fresh ids and use them to look up responses
//let result = format!("{{\"method\":\"{}\",\"id\":42,\"params\":{{{}}}}}", message.method, params);
// println!("read_message: `{}`", result);

Some(message.clone())
}
}
Expand Down
2 changes: 1 addition & 1 deletion test_data/hello/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
pub fn main() {
let world = "world";
println!("Hello, {}!", world);
}

0 comments on commit aaeec56

Please sign in to comment.