racer-rust / racer Goto Github PK
View Code? Open in Web Editor NEWRust Code Completion utility
License: MIT License
Rust Code Completion utility
License: MIT License
Can't get it to build currently using rust nightly. Apparently there was a new type inference scheme merged about 8 hours ago, lol. I tried taking a look but I really don't know much rust yet, I've been distracted lately with Elixir. Was trying to figure out why atom-racer wasn't working for user's having issues and wanted to update to the latest racer to see what the problem was. Tried compiling with rust-0.11 but that didn't work out either. Thanks in advance.
rustc -O -o bin/racer src/main.rs
src/racer/nameres.rs:575:15: 575:26 error: explicit lifetime bound required
src/racer/nameres.rs:575 iter: Box<Iterator>
^~~~~~~~~~~
src/racer/util.rs:162:73: 162:84 error: explicit lifetime bound required
src/racer/util.rs:162 pub fn lazyit<T,I:Iterator>(p: proc() -> I) -> iter::FlatMap<'static,proc() -> I,option::Item<proc() -> I>,I> {
^~~~~~~~~~~
src/racer/util.rs:162:98: 162:109 error: explicit lifetime bound required
src/racer/util.rs:162 pub fn lazyit<T,I:Iterator>(p: proc() -> I) -> iter::FlatMap<'static,proc() -> I,option::Item<proc() -> I>,I> {
On my macbook, with OS X Yosemite (10.10.1) and
relrin at MacBook-Relrin in ~/racer exited 2 on git:master
=> rustc -v
rustc 0.12.0-dev
racer fails with error
relrin at MacBook-Relrin in ~/racer on git:master
=> make
rustc -O -o bin/racer src/main.rs
src/racer/nameres.rs:746:65: 746:66 error: expected item, found ;
src/racer/nameres.rs:746 thread_local!(pub static SEARCH_STACK: Vec = Vec::new());
^
make: *** [all] Error 101
Is there a recommended way of going about this? I did some poking around and saw that racer looks for lib.rs in name/lib.rs or libname/lib.rs, but not every project adheres to the same file layout so racer doesn't always pick them up(e.g, Glutin )
pub fn main() {
//{
}
struct test{
x : int,
y : int,
}
impl test{
fn poll(&self) {
self. // <-- will throw an error here
}
}
if you remove the commented out { in main it completes fine.
(first issue posted, I hope I am doing this right, constructive crit accepted)
In vim typing gd to go to definition seems to screw up any syntax highlighting, and to get it back one must restart the editor.
Interestingly if you turn the syntax off before gd you can turn it back on and all is good.
Racer does not compile with the latest rust:
src/racer/ast.rs:102:54: 102:68 error: attempted access of field `name` on type `syntax::ast::PathListItem_`, but no field with that name was found
src/racer/ast.rs:102 vv.push(token::get_ident(path.node.name).get().to_string());
^~~~~~~~~~~~~~
rustc 0.12.0-pre (f15d6d28396e8700b6c3f2704204a2769e710403 2014-07-20 22:46:29 +0000)
I can't build it ...
racer.rs:185:25: 185:41 error: type ~[&str]
does not implement any method in scope named push
racer.rs:185 c2.push(defnstr);
^~~~~~~~~~~~~~~~
error: aborting due to previous error
What version of Rust is supported? Trying to build racer on 0.11 nightly fails with type errors:
rustc -v
rustc 0.11.0-pre-nightly (0ee6a8e 2014-06-09 23:41:53 -0700)
host: x86_64-unknown-linux-gnu
make
rustc -O -o bin/racer src/main.rs
src/racer/ast.rs:45:5: 47:7 error: mismatched types: expected `std::gc::Gc<syntax::ast::Expr>` but found `@syntax::ast::Expr` (expected struct std::gc::Gc but found @-ptr)
src/racer/ast.rs:45 with_error_checking_parse(source_str, |p| {
src/racer/ast.rs:46 p.parse_expr()
src/racer/ast.rs:47 })
src/racer/ast.rs:52:5: 54:7 error: mismatched types: expected `core::option::Option<std::gc::Gc<syntax::ast::Item>>` but found `core::option::Option<@syntax::ast::Item>` (expected struct std::gc::Gc but found @-ptr)
src/racer/ast.rs:52 with_error_checking_parse(source_str, |p| {
src/racer/ast.rs:53 p.parse_item(Vec::new())
src/racer/ast.rs:54 })
src/racer/ast.rs:59:5: 61:7 error: mismatched types: expected `std::gc::Gc<syntax::codemap::Spanned<syntax::ast::Stmt_>>` but found `@syntax::codemap::Spanned<syntax::ast::Stmt_>` (expected struct std::gc::Gc but found @-ptr)
src/racer/ast.rs:59 with_error_checking_parse(source_str, |p| {
src/racer/ast.rs:60 p.parse_stmt(Vec::new())
src/racer/ast.rs:61 })
src/racer/ast.rs:272:45: 272:58 error: attempted access of field `node` on type `std::gc::Gc<syntax::ast::Expr>`, but no field with that name was found
src/racer/ast.rs:272 debug!("PHIL init node is {:?}",initexpr.node);
^~~~~~~~~~~~~
note: in expansion of format_args!
<log macros>:10:13: 11:10 note: expansion site
<log macros>:1:1: 13:2 note: in expansion of log!
<log macros>:2:46: 2:76 note: expansion site
<log macros>:1:1: 3:2 note: in expansion of debug!
src/racer/ast.rs:272:13: 272:60 note: expansion site
src/racer/ast.rs:276:26: 276:34 error: mismatched types: expected `&syntax::ast::Expr` but found `std::gc::Gc<syntax::ast::Expr>` (expected &-ptr but found struct std::gc::Gc)
src/racer/ast.rs:276 v.visit_expr(initexpr, ());
^~~~~~~~
src/racer/ast.rs:272:45: 272:58 error: cannot determine a type for this bounded type parameter: unconstrained type
src/racer/ast.rs:272 debug!("PHIL init node is {:?}",initexpr.node);
^~~~~~~~~~~~~
note: in expansion of format_args!
<log macros>:10:13: 11:10 note: expansion site
<log macros>:1:1: 13:2 note: in expansion of log!
<log macros>:2:46: 2:76 note: expansion site
<log macros>:1:1: 3:2 note: in expansion of debug!
src/racer/ast.rs:272:13: 272:60 note: expansion site
make: *** [all] Error 101
This is just a suggestion and might very well be stupid, but I feel it could be awesome to spare some HDD/SSD lifetime:
Would it be possible to request a contextual complete
(with linenum
and charnum
) but passing what is currently a temporary file (fname
) as standard input instead?
Another great enhancement could be to daemonize racer, maybe by having it detach a server component on first launch, then following calls would be simple clients hitting on that server like what gocode does. It might enable caching, even faster response time, and concur into releasing some IO stress on HDD ?
Rust source files are UTF-8 so may or may not contain a leading 3 byte BOM which seems to be ignored which means indices into the source text may be off, giving weird behavior (and sometimes crashes). The attached files are a minimal example: they are the exact same text use std::io::
but one is 16 bytes and the other is 13 bytes (no BOM). When read as text they should be strings of equal length (13), the bom should not be included one the text is off disk.
Running racer complete
on the last char of the respective files will show the problem.
Not sure what the best way to do this in Rust is, but the bom can be stripped skiping this 3 byte prefix 0xEF 0xBB 0xBF
from a byte vector, or equivalently, skipping a single codepoint U+FEFF
from the string:
return if contents.starts_with("\ufeff") {
contents.as_slice().slice_from(3)
} else {
contents.as_slice()
};
I gave this a shot but soon found the file reading/utf-8 conversion is done in many places so should probably be moved to a utility (at which point I realized I was in over my head...).
https://dl.dropboxusercontent.com/u/22904108/Attachments/source-no-bom.rs
https://dl.dropboxusercontent.com/u/22904108/Attachments/source-with-bom.rs
$ RUST_SRC_PATH=~/git/rust/src/ RUST_BACKTRACE=1 ./bin/racer complete
task '<main>' failed at 'index out of bounds: the len is 2 but the index is 2', src/main.rs:37
stack backtrace:
1: 0x7fbce9ee6c30 - rt::backtrace::imp::write::h69b6d63e163eeefckXo::v0.11.0.pre
2: 0x7fbce9eee360 - <unknown>
3: 0x7fbce9871e80 - unwind::begin_unwind_inner::h9f920bbf5beab4b1aTd::v0.11.0.pre
4: 0x7fbce9871910 - unwind::begin_unwind_fmt::h306708833178bb05CQd::v0.11.0.pre
5: 0x7fbce98718d0 - rust_begin_unwind
6: 0x7fbce98c7640 - failure::begin_unwind::hc57ffeb348bb4df7TSv::v0.11.0.pre
7: 0x7fbce98cb5d0 - failure::fail_bounds_check::h64e7b631243ad42f3Qv::v0.11.0.pre
8: 0x4d21c0 - main::h2be2ed25ba409f1081f::v0.0
9: 0x7fbcea2b6560 - <unknown>
10: 0x7fbce986ea30 - <unknown>
11: 0x7fbce98e1ce0 - rust_try
12: 0x7fbce9871470 - unwind::try::h50343a0f5b51dbaewHd::v0.11.0.pre
13: 0x7fbce986e8b0 - task::Task::run::hcf51798f50d820e9HWc::v0.11.0.pre
14: 0x7fbcea2b6160 - start::h7ceafd0571985404une::v0.11.0.pre
15: 0x7fbcea2b60d0 - lang_start::ha25c77b8bf7df823Ome::v0.11.0.pre
16: 0x7fbce9266f10 - __libc_start_main
17: 0x4054b0 - <unknown>
18: 0x0 - <unknown>
$ make
rustc -O -o bin/racer src/main.rs
src/racer/ast.rs:296:49: 296:53 error: mismatched types: expected `&syntax::ast::Path` but found `&syntax::codemap::Spanned<syntax::ast::Ident>` (expected struct syntax::ast::Path but found struct syntax::codemap::Spanned)
src/racer/ast.rs:296 let pathv = path_to_vec(path);
^~~~
src/racer/ast.rs:387:49: 387:53 error: mismatched types: expected `&syntax::ast::Path` but found `&syntax::codemap::Spanned<syntax::ast::Ident>` (expected struct syntax::ast::Path but found struct syntax::codemap::Spanned)
src/racer/ast.rs:387 let pathv = path_to_vec(path);
^~~~
error: aborting due to 2 previous errors
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 101
Version:
$ rustc -v
rustc 0.11.0 (36d7d746c8366d78b332cffdff85318e709b38ca 2014-07-04 10:16:21 +0000)
Hi,
I'm getting the following error when compiling using latest rustc.
C:\Rust\racer>rustc -O -o bin/racer src/main.rs
src\racer\codeiter.rs:22:10: 22:32 error: wrong number of type arguments: expected 0, found 1
src\racer\codeiter.rs:22 impl<'a> Iterator<(uint, uint)> for StmtIndicesIter<'a> {
RUST_SRC_PATH=C:/Users/Owner/src/rust/src
main.rs:47 let mut cwd = os::getcwd();
$ racer find-definition 47 17 src/main.rs
MATCH os,1,0,\Users\Owner\src\rust\src\libstd\os.rs,Module,\Users\Owner\src\rust\src\libstd\os.rs
Racer needs a way to pass in or set the project path. I'm currently working on an editor plugin to integrate with it, and it seems like the best/simplest strategy for dealing with files in a dirty state is to write to a tmpfile, and pass that path along with the line and column numbers to racer. The problem here is, now racer has no way to look at the other files in your project. I'm not sure if it currently even checks those, or only checks the stdlib, but regardless you will eventually want that functionality I assume.
Hi!
Since the dawn of rustup.sh and cargo becoming pretty widely adopted I'm wondering how this project can continue to work without a RUST_SRC_PATH that includes the standard library? That is, I can build racer but can't use it because I installed a nightly binary.
Any ideas? Have I missed something?
Chip
On archlinux 64bit with rust nightly
rustc -v
rustc 0.13.0-nightly (99d6956c3 2014-12-18 20:32:07 +0000)
racer fails with
rustc -O -o bin/racer src/main.rs
src/racer/typeinf.rs:45:5: 45:11 error: expected one of .
, ;
, or }
, found return
src/racer/typeinf.rs:45 return scopes::find_impl_start(msrc, m.point, 0).and_then(|start| {
^~~~~~
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 101
Example reproduce:
./bin/racer complete std::io::
...
MATCH from_errno,316,11,/home/user/src/rust/src/libstd/io/mod.rs,Function,impl IoError {
The context given is "impl IoError {" when I assume it should be the actual function context e.g,
pub fn from_errno(errno: uint, detail: bool) -> IoError {
Oddly, the line given(316) is the correct line. This appears to be happening for all impl, but I haven't done a lot of testing - it may be completely unrelated to impl.
Error message from rustc:
src/racer/ast.rs:269:19: 269:33 error: attempted access of field `parameters` on type `&syntax::ast::PathSegment`, but no field with that name was found
src/racer/ast.rs:269 for ty in seg.parameters.types().iter() {
^~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `racer`.
rustc version:
rustc 0.13.0-nightly (63c4f22f2 2014-11-05 22:31:44 +0000)
Build 4c7297c on Windows 7 (64bit) using newest Rust nightly using cargo build
. It throws the system error when running bin\racer.exe
.
This change is causing it to break on nightly.
src/ast.rs:62:34: 62:39 error: type `&@syntax::codemap::Spanned<syntax::ast::ViewPath_>` does not implement any method in scope named `len`
src/ast.rs:62 assert_eq!(paths.len(), 1);
^~~~~
src/ast.rs:63:29: 63:35 error: type `&@syntax::codemap::Spanned<syntax::ast::ViewPath_>` does not implement any method in scope named `get`
src/ast.rs:63 match paths.get(0).node {
^~~~~~
src/ast.rs:79:42: 79:51 error: failed to find an implementation of trait std::clone::Clone for [type error]
src/ast.rs:79 let mut vv = v.clone();
^~~~~~~~~
make: *** [all] Error 101
I actually managed to get it past this error and then immediately ran into another which I couldn't figure out since I just began learning.
src/racer.rs:151:13: 151:24 error: closure invocation in a `&` reference
src/racer.rs:151 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:161:13: 161:24 error: closure invocation in a `&` reference
src/racer.rs:161 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:172:17: 172:28 error: closure invocation in a `&` reference
src/racer.rs:172 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:139:13: 139:24 error: closure invocation in a `&` reference
src/racer.rs:139 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:357:21: 357:32 error: closure invocation in a `&` reference
src/racer.rs:357 (*outputfn)(Match { matchstr: letresult.name.to_owned(),
^~~~~~~~~~~
src/racer.rs:409:33: 409:44 error: closure invocation in a `&` reference
src/racer.rs:409 (*outputfn)(Match { matchstr: field.to_owned(),
^~~~~~~~~~~
src/racer.rs:443:9: 443:20 error: closure invocation in a `&` reference
src/racer.rs:443 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:474:13: 474:24 error: closure invocation in a `&` reference
src/racer.rs:474 (*outputfn)(m);
^~~~~~~~~~~
src/racer.rs:494:9: 494:20 error: closure invocation in a `&` reference
src/racer.rs:494 (*outputfn)(m);
^~~~~~~~~~~
error: aborting due to 9 previous errors
Thanks
It would be nice if line like std::io::{
would complete the same as std::io::
It would be even nicer if, for instance use std::rc::{Rc,
would recommend everything that std::rc::
recommends, except it would omit Rc
since it's already being used.
For example, racer signatureof fully::qualified::name
might print fn(int) -> Box<String>
. Would also want this to work on methods, ideally.
I use the YouCompleteMe vim plugin, but with the refactoring of the core pieces out into a server, the majority of the code can be reused. It would be neat for racer to be able to talk to the YCMD server and immediately gain the benefit of any other clients that also use the YCMD protocol.
With rustc 0.11.0-pre-nightly (90ab2f8b616634cff8e02f12c529504c088d52e8 2014-07-01 01:01:36 +0000):
rustc -O -o bin/racer src/main.rs
src/racer/ast.rs:102:33: 102:51 error: `ast::PathListIdent` does not name a structure
src/racer/ast.rs:102 ast::PathListIdent{name, ..} => {
^~~~~~~~~~~~~~~~~~
src/racer/ast.rs:107:33: 107:49 error: `ast::PathListMod` does not name a structure
src/racer/ast.rs:107 ast::PathListMod{..} => (), // TODO
^~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
make: *** [all] Error 101
Output from running rake:
rustc -o bin/racer src/main.rs
src/codeiter.rs:4:5: 4:14 error: file not found for module testutils
src/codeiter.rs:4 mod testutils;
^~~~~~~~~
make: *** [all] Error 101
➤ cargo build
Compiling racer v0.0.0 (file:/opt/src/racer)
src/racer/nameres.rs:279:18: 279:78 error: `for` loop expression does not implement the `Iterator` trait
src/racer/nameres.rs:279 for m in resolve_name(searchstr, crateroot, 0, searchtype, namespace) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/racer/nameres.rs:531:18: 531:75 error: `for` loop expression does not implement the `Iterator` trait
src/racer/nameres.rs:531 for m in resolve_path(path, filepath, pos, search_type, namespace) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/racer/matchers.rs:403:26: 403:95 error: `for` loop expression does not implement the `Iterator` trait
src/racer/matchers.rs:403 for m in resolve_path(fqn.as_slice(), filepath, 0, ExactMatch, BothNamespaces) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:57:22: 57:67 error: `for` loop expression does not implement the `Iterator` trait
src/main.rs:57 for m in racer::complete_from_file(src, &fpath, point) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
Could not execute process `rustc src/main.rs --crate-type bin --out-dir /opt/src/racer/target -L /opt/src/racer/target -L /opt/src/racer/target/deps` (status=101)
Warnings:
src/racer/mod.rs:183:3: 183:19 warning: `deriving` is deprecated; use `derive`
src/racer/mod.rs:183 #[deriving(Clone)]
^~~~~~~~~~~~~~~~
Error that kills the build:
src/racer/ast.rs:313:35: 313:44 error: type `core::option::Option<syntax::ptr::P<syntax::ast::Ty>>` cannot be dereferenced
src/racer/ast.rs:313 let mut ty = to_racer_ty(&*local.ty, &self.scope);
^~~~~~~~~
error: aborting due to previous error
rustc -O -o bin/racer src/main.rs
src/racer/nameres.rs:652:1: 652:15 error: macro undefined: 'local_data_key!'
src/racer/nameres.rs:652 local_data_key!(pub searchstack: Vec<Search>)
^~~~~~~~~~~~~~
src/racer/matchers.rs:492:1: 492:15 error: macro undefined: 'local_data_key!'
src/racer/matchers.rs:492 local_data_key!(already_globbing: bool)
^~~~~~~~~~~~~~
error: aborting due to 2 previous errors
make: *** [all] Error 101
Lots of other packages (I.e. anaconda mode, robe, tern, slime and elisp-slime-nav) use M-.
So would it be worth changing the jump to definition key default from f1 to M-.
Keeping consistent is usually good!
$ RUST_SRC_PATH=~/git/rust/src/ RUST_BACKTRACE=1 ./bin/racer complete "::" MATCH Paths,45,11,/home/hein/git/rust/src/libglob/lib.rs
MATCH glob,80,7,/home/hein/git/rust/src/libglob/lib.rs
MATCH glob_with,95,7,/home/hein/git/rust/src/libglob/lib.rs
MATCH Pattern,198,11,/home/hein/git/rust/src/libglob/lib.rs
MATCH new,245,11,/home/hein/git/rust/src/libglob/lib.rs
MATCH MatchOptions,596,11,/home/hein/git/rust/src/libglob/lib.rs
MATCH new,636,11,/home/hein/git/rust/src/libglob/lib.rs
task '<main>' failed at 'MATCHSTR is empty - waddup?', src/main.rs:26
stack backtrace:
1: 0x7f6905383c30 - rt::backtrace::imp::write::h69b6d63e163eeefckXo::v0.11.0.pre
2: 0x7f690538b360 - <unknown>
3: 0x7f6904d0ee80 - unwind::begin_unwind_inner::h9f920bbf5beab4b1aTd::v0.11.0.pre
4: 0x4c7680 - unwind::begin_unwind::h4946219792453693117::v0.0
5: 0x4d0e00 - match_fn::hcf8e9bd99ad91198oMf::v0.0
6: 0x4d1d70 - complete::closure.13519
7: 0x4cf250 - racer::do_external_search::hf33daf9b648e8c2biAf::v0.0
8: 0x4d1b60 - complete::closure.13517
9: 0x4afd90 - racer::do_file_search::h5c4affaf4576fbb4Trc::v0.0
10: 0x4d21c0 - main::h2be2ed25ba409f1081f::v0.0
11: 0x7f6905753560 - <unknown>
12: 0x7f6904d0ba30 - <unknown>
13: 0x7f6904d7ece0 - rust_try
14: 0x7f6904d0e470 - unwind::try::h50343a0f5b51dbaewHd::v0.11.0.pre
15: 0x7f6904d0b8b0 - task::Task::run::hcf51798f50d820e9HWc::v0.11.0.pre
16: 0x7f6905753160 - start::h7ceafd0571985404une::v0.11.0.pre
17: 0x7f69057530d0 - lang_start::ha25c77b8bf7df823Ome::v0.11.0.pre
18: 0x7f6904703f10 - __libc_start_main
19: 0x4054b0 - <unknown>
20: 0x0 - <unknown>
racer complete std::io::
is missing, for example print
and println
, as well as all other functions available in that namespace by means of being imported through a pub use
statement.
This was broken by 04259d9 AFAICT, since searchstr
is empty when searching through the io
namespace and thus all use
statements are ignored.
diff --git a/src/racer/matchers.rs b/src/racer/matchers.rs
index 93f04ed..02f5cab 100644
--- a/src/racer/matchers.rs
+++ b/src/racer/matchers.rs
@@ -417,14 +417,10 @@ pub fn match_use(msrc: &str, blobstart: uint, blobend: uint,
let mut out = Vec::new();
- if searchstr.len() == 0 {
- return out;
- }
-
let blob = msrc.slice(blobstart, blobend);
if ((local && blob.starts_with("use ")) || blob.starts_with("pub use ")) && txt_matches(search_type, searchstr, blob) {
- if blob.match_indices(searchstr).count() == 1 {
+ if searchstr.len() != 0 && blob.match_indices(searchstr).count() == 1 {
if blob.find_str((searchstr.to_string() + "::").as_slice()).is_some() {
// can't possible match, fail fast!
return out;
The above patch makes it find print
etc., but that's just a quick hack, I didn't check whether this preserves the correct semantics.
I compiled racer with rust nightly 64 bit/TDM gcc 64 bit, and also tried with rust nightly 32 bit/MinGW32 gcc.
On windows 8.1 racer seems to choke on certain tokens when asked for completion, while it seems to work on ubuntu.
I didn't have the time to investigate further so far, hope it helps.
Here's the command I tried:
racer complete std::comm::
and thats the ouput from gdb on my windows machine:
PS C:\Program Files\Racer> gdb --args "C:\Program Files\Racer\racer.exe" complete std::comm::
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from C:\Program Files\Racer\racer.exe...done.
(gdb) run
Starting program: C:\Program Files\Racer\racer.exe complete std::comm::
[New Thread 17720.0x3dac]
[New Thread 17720.0x2b6c]
[New Thread 17720.0x46a4]
[New Thread 17720.0x43cc]
[New Thread 17720.0x4490]
[New Thread 17720.0x235c]
[New Thread 17720.0x4470]
[New Thread 17720.0x3994]
[New Thread 17720.0x420c]
[New Thread 17720.0x53f0]
[New Thread 17720.0x5164]
[New Thread 17720.0x51a0]
[New Thread 17720.0x52a8]
[New Thread 17720.0x5160]
[New Thread 17720.0x4dbc]
[New Thread 17720.0x3074]
[New Thread 17720.0x584]
[New Thread 17720.0x3968]
[New Thread 17720.0x3d88]
[New Thread 17720.0x451c]
[New Thread 17720.0x44d8]
[New Thread 17720.0x32e4]
[New Thread 17720.0x2dc0]
[New Thread 17720.0x43d4]
[New Thread 17720.0x444c]
[New Thread 17720.0x4714]
[New Thread 17720.0x4568]
[New Thread 17720.0x39e8]
[New Thread 17720.0x44b0]
[New Thread 17720.0x4604]
[New Thread 17720.0x270c]
[New Thread 17720.0x424c]
[New Thread 17720.0x399c]
[New Thread 17720.0x38c8]
[New Thread 17720.0x31f8]
[New Thread 17720.0x457c]
[New Thread 17720.0x4308]
[New Thread 17720.0x2460]
[New Thread 17720.0x45d0]
[New Thread 17720.0x259c]
[New Thread 17720.0x26ec]
[New Thread 17720.0x3694]
[New Thread 17720.0x23ec]
[New Thread 17720.0x3248]
[New Thread 17720.0x42d4]
[New Thread 17720.0x3378]
[New Thread 17720.0x304c]
[New Thread 17720.0x2658]
[New Thread 17720.0x43d8]
[New Thread 17720.0x32fc]
[New Thread 17720.0x2e8c]
[New Thread 17720.0x44bc]
[New Thread 17720.0x4420]
[New Thread 17720.0x4414]
[New Thread 17720.0x3164]
[New Thread 17720.0x4428]
[New Thread 17720.0x2428]
[New Thread 17720.0x3418]
[New Thread 17720.0x3e70]
[New Thread 17720.0x421c]
[New Thread 17720.0x4474]
[New Thread 17720.0x3664]
[New Thread 17720.0x412c]
[New Thread 17720.0x4454]
[New Thread 17720.0x3db8]
[New Thread 17720.0x22a8]
[New Thread 17720.0x3860]
[New Thread 17720.0x41b4]
[New Thread 17720.0x3f84]
[New Thread 17720.0x3ee4]
[New Thread 17720.0x3ec4]
[New Thread 17720.0x2764]
[New Thread 17720.0x45c8]
[New Thread 17720.0x2d24]
[New Thread 17720.0x45f8]
[New Thread 17720.0x428c]
[New Thread 17720.0x371c]
[New Thread 17720.0x42c8]
[New Thread 17720.0x4718]
[New Thread 17720.0x4198]
[New Thread 17720.0x4508]
Program received signal SIGSEGV, Segmentation fault.
0x00000000005ad5e8 in main::racer::matchers::match_extern_crate (msrc=..., blobstart=864, blobend=887, searchstr=..., filepath=0x6c590e0,
search_type=ExactMatch) at src\racer/matchers.rs:82
82 let blob = msrc.slice(blobstart, blobend);
(gdb) p *filepath
$6 = {repr = {vec = {len = 44, cap = 44, ptr = 0x28241e0 "\Program Files (x86)\Rust\src\libsync\lib.rs.rs"}}, prefix = {{None}, {None, {{216,
216, 304295, 7133701809797013576}, {216}, {216, 304295}, {216, 304295, 7133701809797013576}, {216}}}}, sepidx = {{Some}, {Some, 37}}}
Trying to complete in Emacs works fine for the crates but not the methods for example:
std::io::stdin()
The error is
Company: An error occurred in auto-begin
Company: Back-end racer-company-complete error "/home/henrik/dev/rust/racer/bin/racer exited with status 101" with args (candidates )
Not sure if this is the place for this...
I have built Rust from git repo and installed it in a path outside my DYLD_LIBRARY_PATH
and had to use setenv
in my Emacs app bundle installation from http://emacsformacosx.com/ . e.g.:
(setenv "DYLD_LIBRARY_PATH"
(concat "/Users/me/Projects/Rust/build-head/lib/"
path-separator
(getenv "DYLD_LIBRARY_PATH")))
This reflects what I had to do in the Terminal for rustc
and reflects the fact that the environment I have setup in Terminal is not mirrored in app bundle Emacs automatically. I figure this may be worth noting in the Emacs integration section of your README.
I use the provided racer.vim and it fails to make semantic completion with youcompleteme.
Hello.
I compiled racer with Rust 0.12.0-dev on OS X 10.10 Beta 4. But when I run it as the README told me to do, it just crash with some strange outputs:
$ target/racer complete std::io::B
There are not many persons who know what wonders are opened to them in the
stories and visions of their youth; for when as children we listen and dream,
we think but half-formed thoughts, and when as men we try to remember, we are
dulled and prosaic with the poison of life. But some of us awake in the night
with strange phantasms of enchanted hills and gardens, of fountains that sing
in the sun, of golden cliffs overhanging murmuring seas, of plains that stretch
down to sleeping cities of bronze and stone, and of shadowy companies of heroes
that ride caparisoned white horses along the edges of thick forests; and then
we know that we have looked back through the ivory gates into that world of
wonder which was ours before we were wise and unhappy.
fatal runtime error: assertion failed: !ptr.is_null()
[1] 41441 illegal hardware instruction target/racer complete std::io::B
RUST_SRC_PATH
is the src
path of the Rust (master branch)
i just did
git clone [email protected]:phildawes/racer.git
cd racer
make
And I got an error:
rustc -O -o bin/racer src/main.rs
src/racer/ast.rs:413:13: 413:60 error: this pattern has 2 fields, but the corresponding variant has 3 fields [E0023]
src/racer/ast.rs:413 ast::ExprField(ref subexpression, spannedident) => {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Ubuntu 13.10, rustc 0.13.0-nightly
I'm getting the following error when compiling using latest Rustc.
$ make
rustc -O -o bin/racer src/main.rs
src\racer\ast.rs:668:13: 668:42 error: this pattern has 5 fields, but the corresponding variant has 4 fields [E0023]
src\racer\ast.rs:668 ast::ItemTrait(_, _, _, _, _) => {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 101
➜ rustc --version
rustc 0.13.0-dev (0b48001c2 2014-11-07 15:26:26 +0000)
➜ make
rustc -O -o bin/racer src/main.rs
src/racer/ast.rs:269:19: 269:28 error: attempted access of field types
on type &syntax::ast::PathSegment
, but no field with that name was found
src/racer/ast.rs:269 for ty in seg.types.iter() {
^~~~~~~~~
error: aborting due to previous error
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 101
On both linux and windows the tests for function resolution pass. However, on windows, if you create a file containing the source from a fn resolution test and call racer complete 6 13 tmp.rs
it does not resolve like it does on linux. Example:
The input file is
fn apple() {
}
fn main() {
let b = ap
}
On linux the output is (expected)
PREFIX 11,13,ap
MATCH apple,1,3,foo.rs,Function,fn apple() {
while on windows it responds only with
PREFIX 11,13,ap
Tested on both windows Linux on racer a97ec1a with rustc 0.13.0-nightly (fac5a0767 2014-11-26 22:37:06 +0000)
Let me know if you want me to diagnose something, provide some log output etc. under windows.
Would it be appropriate to drive 'eldoc' from racer ;
https://raw.githubusercontent.com/mooz/c-eldoc/master/images/screenshot.png
I see there's c-eldoc which in turn relies on cc-defs to generate function definitions
Even if it was imprecise (getting confused if the same method name is used differently in different traits) I think it would be better than nothing. (it could make some best guess if it can't resolve everything).
Another idea is the way that Xcode puts placeholders for arguments in the text, which it displays differently and its editing rules overwrite them
Great work on racer! This will be super useful once it is more dynamic.
https://github.com/Valloric/YouCompleteMe is a code completion plugin for Vim that is very sophisticated. It provides IDE like completion for C++ but integrates with other completers too. I use it for python, c++ and java and love it in all languages.
YCM has solved the UI problem in Vim completely, racer should be a completer for it in Vim, not a stand alone plugin.
I have a proof-of-concept for this set up in my fork, but it's only good enough to compile at this point and could probably use some additional refactoring and/or renaming.
My motivation for this is to let the library contain the bulk of the logic and heavy lifting so that multiple clients can target the same functionality. The existing racer client is nice for text editors that execute it directly, but it would be nice to have support for a client that can do things like integrate with gnome-code-assistance by communicating over DBus rather than standard output and arguments to main
, and I'm sure there are other use cases where this would be nice to have as well.
Since 2 or 3 days i can't run racer anymore with the current nightly.
It compiles fine but when i run it i get the following error:
racer: symbol lookup error: racer: undefined symbol: _ZN3vec31Vec$LT$u8$GT$.fmt..FormatWriter5write20haa3f48e79c983270kxkE
When I try use make
to build the program:
The following error happened:
-O -o bin/racer src/main.rs
src/racer/ast.rs:15:5: 15:19 error: unresolved import syntax::ptr::P
. Could not find ptr
in syntax
.
src/racer/ast.rs:15 use syntax::ptr::P;
^~~~~~~~~~~~~~
error: aborting due to previous error
make: *** [all] Error 101
Platform:
OpenSuSE 13.1(64bits)
rust v0.11(64bits)
In the unit tests, the temporary files are created in the tmpname()
function using task.name()
, which will contain '::', making it an invalid windows path. This means all tests using temp files (around half) will fail on Windows.
Could the temp files use underscore instead so they get allowed paths on all platforms? , e.g.
let s = str::replace(task::name().unwrap().as_slice(), "::", "_");
I did set my path variable, and it is correct.
When i do ./racer complete std::io::B
there is no output.
What info can i give you more?
Racer crashes using the latest x86_64 nightly.
Version info:
$ rustc --version
rustc 0.13.0-nightly (e09d98603 2014-11-18 23:51:43 +0000)
The (quite vague) crash output:
$ racer complete std::io::
task '<main>' has overflowed its stack
It should be noted that code doesn't compile on this nightly due to rust-lang/rust#18645
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.