Open braun-steven opened 3 years ago
hey
before diving into this:
global-tags
(I think the corresponding command is xref-find-definitions
)Error code 1
is Ivy telling you that the (last) async command to fetch candidates returned non-zero (something went wrong). Unfortunately, that's not very informative, so we need to dig deeper into this together.
Thanks for the fast response!
can you provide a mvce? (check the unit tests)
I'm not familiar with elisp unit tests at all, sorry. Can you give me a head start what to look for, so I can build a mcve?
can you try global-tags (I think the corresponding command is xref-find-definitions)
Ok, I just did that. Here is an example:
$ cat hello.rb
class Hello
def hello
puts message
end
def message; 'hello, world'; end
end
$ gtags
$ ls
.rw-r--r-- 16k st 1 Dec 10:27 GPATH
.rw-r--r-- 16k st 1 Dec 10:27 GRTAGS
.rw-r--r-- 16k st 1 Dec 10:27 GTAGS
.rw-r--r-- 87 st 1 Dec 10:16 hello.rb
$ global -sx message hello.rb
message 3 hello.rb puts message
message 6 hello.rb def message; 'hello, world'; end
So gtags
seems to work as expected.
When I open the hello.rb
file in the emacs configuration as described above (including global-tags.el
now) and run xref-find-definitions
, the echo message shows
Visit tags table (default TAGS): /tmp/test/
Using one of /tmp/test/GPATH
, /tmp/test/GRTAGS
or /tmp/test/GTAGS
leads to the message
File /tmp/test/GTAGS is not a valid tags table
(same for GPATH
and GRTAGS
).
I think xref tried using "Emacs Tags" instead of "GNU Global Tags" in your latest example.
You probably missed (add-to-list 'xref-backend-functions 'global-tags-xref-backend)
? It would be worth removing any other xref backend just for doing this test: (setq xref-backend-functions '(global-tags-xref-backend))
(come to think of it, it may be worth to update global-tags
to do this automagically)
You're right, I was missing this.
Now, xref-find-apropos
with mes
as argument shows the following buffer:
hello.rb
3: puts message
6: def message; 'hello, world'; end
So that seems to work correctly.
let me try to debug it on my side (involves defining advice around counsel--async-process
).
It's going to take a few days. I personally use global-tags
+ ivy-xref
in case you want to switch to that in the meantime.
Sorry, but I have no idea about Ruby, I tried to reproduce your issue, but
$ cat hello.rb class Hello def hello puts message end def message; 'hello, world'; end end $ gtags $ ls .rw-r--r-- 16k st 1 Dec 10:27 GPATH .rw-r--r-- 16k st 1 Dec 10:27 GRTAGS .rw-r--r-- 16k st 1 Dec 10:27 GTAGS .rw-r--r-- 87 st 1 Dec 10:16 hello.rb
Up to here everything works fine.
$ global -sx message hello.rb
But here I got nothing as output. Does global needs anything special to work with ruby? I tried exactly the same example with a C and C++ code and it worked perfectly. From the terminal and with counsel-gtags...
Running in a sandboxed Emacs using only
and generating the database with
global --gtagslabel=pygments .
(andctags
,new-ctags
) as well, I end up witherror code 1
when runningcounsel-gtags-find-symbol
after typing three chars.Is there any way to look into what
error code 1
means?System Information: