Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

completion fails almost always #1123

Closed pedro-esteves-pinto closed 6 years ago

pedro-esteves-pinto commented 6 years ago

Please mark appropriate

Problem description

Completion does not work

Expected behavior

I expected a list of completions.

Actual behavior

A request for completion almost always results in the following from elisp:

Company: An error occurred in auto-begin Company: backend company-rtags async timeout with args (candidates )

I have increased the timeout to 10 secs, which is much longer than what it takes for the translation unit to compile from scratch.

Environment

Feature request

Describe the feature we should add to RTags.

mkurop commented 6 years ago

I experience the same problem. Do you solved your issue? I am trying hard to solve but with no success thus far.

pedro-esteves-pinto commented 6 years ago

No, to be honest rtags completion has always been very hit or miss for me.

jwiegley commented 6 years ago

I'm seeing this same behavior. In fact, while finding symbols appears to work fine, diagnostics and completion just seem to hang at the prompt. For example:

14:42 Vulcan:ledger $ rc --list-symbols fn_amount_
fn_amount_expr
fn_amount_expr(ledger::call_scope_t &)
fn_amount_expr(ledger::call_scope_t &)::scope

This responds almost instantly. However:

rc --synchronous-completions --code-complete-at ~/Projects/ledger/src/report.cc:1365:38

This hangs indefinitely. As does rc -m --elisp.

As a result, M-. works just fine, but neither flycheck nor company work at all.

drrlvn commented 6 years ago

I can get completion to work when I install using (rtags-install) but not when I use the AUR package. The rc process hangs indefinitely in that case as previously mentioned.

myrgy commented 6 years ago

latest 2.18 rtags - completion fails almost always. During that time emacs hangs up for a while. In rc -v -g log I can see plenty of same messages about completion request without any responses.

casch-at commented 6 years ago

Related to #1103, #989, and maybe #818 too

redm123 commented 6 years ago

(adding here, as my other issue got closed as duplicate)

Just compiled a new rtags from Git and it still often fails to complete.

It seems to work pretty reliable when completing after a "." or "->" (although it seems to list private members now...). But other cases still only work sometimes. I just tried to complete a local variable after the first few chars, didn't work. Completing a vector "foo.pushb" (2nd _ is the cursor), "No completions found" ... Sometimes completion works if I indent 7, 10, 20 .. characters.

It does not hang for me though...

casch-at commented 6 years ago

Hey guys, Swassie has created a PR yesterday, with fix for completion in RTags. Can you guys try https://github.com/Andersbakken/rtags/commit/b6f578173e53df2d4c4560ae82087e377a4aa080, and check if it works now. Thanks!

redm123 commented 6 years ago

First impression: That did the trick! Cool. Should this be the first time having truly working smart completion and navigation in Emacs, after all those years fighting with Cedet and what not?! :)

casch-at commented 6 years ago

Glad to hear that. Yeah, Cedet is a bit of a pain in the ass :-), though quit useful if you are new to Emacs, and are used to an IDE.

There are some other Clang/LLVM based parsers around, like irony, ycmd, cquery...

redm123 notifications@github.com writes:

First impression: That did the trick! Cool. Should this be the first time having truly working smart completion and navigation in Emacs, after all those years fighting with Cedet and what not?! :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.