ruben2020 / codequery

A code-understanding, code-browsing or code-search tool. This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and ctags, and provides a nice GUI tool.
https://ruben2020.github.io/codequery/
Mozilla Public License 2.0
685 stars 86 forks source link

Unable to get codequery on go project to cover all files #85

Closed nbasker closed 4 years ago

nbasker commented 4 years ago

I am trying to get CodeQuery and vim/codequery work for browsing on a go project. Did all the steps mentioned in https://github.com/ruben2020/codequery/blob/master/doc/HOWTO-LINUX.md#how-to-use-codequery-with-ruby-go-and-javascript-code

Executed the above commands from the root of the project to build the codequery db. But for many functions and symbols buried in the directories the database is not disiplaying them. In vim/codequery Callers and Callee are not working.

Installed ctags, starscope and codequery fresh the versions are below. The system is Mac OS.

Is there something that i am missing, any pointer would be very helpful

/usr/local/bin/ctags --version Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert Compiled: Oct 6 2019, 20:31:35 Addresses: dhiebert@users.sourceforge.net, http://ctags.sourceforge.net Optional compiled features: +wildcards, +regex

starscope --version warning: parser/current is loading parser/ruby26, which recognizes warning: 2.6.6-compliant syntax, but you are running 2.6.3. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. 1.5.7

cqmakedb -v CodeQuery 0.23.0 Copyright (C) 2013-2020 ruben2020 https://github.com/ruben2020/

ruben2020 commented 4 years ago

Hi @nbasker , I just noticed a mistake in the documentation. These lines should be:

find . -iname "*.rb"    > ./cscope.files
find . -iname "*.go"    >> ./cscope.files
find . -iname "*.js"    >> ./cscope.files

Please try that.

nbasker commented 4 years ago

Actually there are only go files in the project (am looking at hyperledger fabric)...

Is it possible the starscope is not picking it up when creating cscope.out

/Documents/github.com/nbasker/fabric$ find . -iname ".rb" /Documents/github.com/nbasker/fabric$ find . -iname ".js" /Documents/github.com/nbasker/fabric$ find . -iname ".go" | wc 3655 3655 177627 /Documents/github.com/nbasker/fabric$ find . -iname ".go" | grep genesisconfig ./internal/configtxgen/genesisconfig/config.go ./internal/configtxgen/genesisconfig/config_test.go

The cscope has those files /Documents/github.com/nbasker/fabric$ grep genesisconfig cscope.files ./internal/configtxgen/genesisconfig/config.go ./internal/configtxgen/genesisconfig/config_test.go

/Documents/github.com/nbasker/fabric$ starscope -e cscope warning: parser/current is loading parser/ruby26, which recognizes warning: 2.6.6-compliant syntax, but you are running 2.6.3. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. No changes detected. Exporting to 'cscope.out' in format 'cscope'... Export complete. /Documents/github.com/nbasker/fabric$ grep genesisconfig cscope.out /Documents/github.com/nbasker/fabric$ grep completeInitialization cscope.out /Documents/github.com/nbasker/fabric$

nbasker commented 4 years ago

Figured that the ctags and cscope.out generated by starscope was not complete. By doing "starscope --force-update -e ctags -e cscope" and clearing up git workspace of unwanted files was able to correct the issue. Then things worked, closing this issue.