gustavo-hms / peneira

A fuzzy finder crafted for Kakoune
GNU Lesser General Public License v2.1
35 stars 6 forks source link

Can't make symbols research through ctags working on Linux #7

Closed SilverBzH closed 3 years ago

SilverBzH commented 3 years ago

Hello,

I'm having trouble to make the Symbols research working on my machine. I'm on the Debian 11 Linux and ctags is up to date with json option enabled.

$ ctags --list-features
#NAME             DESCRIPTION
gnulib_regex      linked with the Gnulib regular expression library
iconv             can convert input/output encodings
interactive       accepts source code from stdin
json              supports json format output
option-directory  TO BE WRITTEN
optscript         can use the interpreter
packcc            has peg based parser(s)
regex             can use regular expression based pattern matching
sandbox           linked with code for system call level sandbox
wildcards         can use glob matching
xpath             linked with library for parsing xml input
yaml              linked with library for parsing yaml input

The things is ctags is trying to open the kakoune's scratch buffer, here is the debug buffer output:

ctags: Warning: cannot open input file "*scratch*": No such file or directory

It's only a warning but can't get anything from the research

In my kakrc here is how it's written:

plug "gustavo-hms/luar" %{
  plug "gustavo-hms/peneira" %{
    require-module peneira
  }
}
set-option global peneira_files_command "rg --files"
map global normal <c-p> ': peneira-files<ret>'
map global normal <c-l> ': peneira-symbols<ret>'

Am I missing something ?

Thanks :)

gustavo-hms commented 3 years ago

Hi, @SilverBzH!

ctags: Warning: cannot open input file "scratch": No such file or directory

Judging by this error message, it seems you are trying to execute peneira-symbols in the *scratch* buffer instead of a buffer associated with a file in your disk. If that's the case, then the error makes sense. That's because peneira-symbols calls ctags passing to it the name of the file, not its content. It's ctags' responsibility to read the file and generate the tags information peneira-symbols then parses. So, if you call peneira-symbols on the *scratch* buffer, ctags will try to extract the tags from a file called *scratch* , and will fail to find such a file, causing it to print the above error message.

Please, try to call peneira-symbols on a buffer associated with a file and tell me if the error persists. If so, I'll take a closer look to the issue.

SilverBzH commented 3 years ago

Hey,

Indeed it's working when I am not in the scratch buffer.

I've misunderstood how it's works, I thought it will search for symbol throughout the whole directory and not the current buffer

Thanks for the reply ! I will close the issue.

And awesome tool btw, I'm using it daily :) !!