Closed tsoernes closed 7 years ago
Hm, that doesn't happen locally for me, try deleting the hscope binary and running the haskell-vim-now installer again. Maybe it will pull a more recent hscope where the problem will be fixed.
@tsoernes any luck with the hscope issue after re-running the installer?
I have the same issue (running lts-9.0)
@patriques82 You might try following begriffs suggestion and deleting the hscope binary in ~/.local/bin
and reinstalling. You might try both installing using the global resolver and if that doesn't work then delete it again and try with the project resolver, if different. I can't remember whether I resolved this issue or not as I do not use HVN anymore.
Just tried it again, and still not able to reproduce. On a new machine of Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64) I do this as root:
apt-get update
curl -sSL https://get.haskellstack.org/ | sh
export PATH="/root/.local/bin:$PATH"
curl -L https://git.io/haskell-vim-now > /tmp/haskell-vim-now.sh
bash /tmp/haskell-vim-now.sh
Then clone and build a project as a test:
git clone https://github.com/janrain/riak-haskell-client.git
cd riak-haskell-client/
stack init
stack build
vim src/Network/Riak.hs
The editor starts up fine. Then I press ,tg
to generate tags, and subsequently am able to find uses of symbols with hscope by pressing C-\
. Also pressing ,hc
brings up a window of compiler warnings.
So maybe tell me more about your OS version and what project you're trying to build.
I just followed the steps you provided on my Ubuntu 16.04.2 LTS. And everything installs fine - as the first time I installed haskell-vim-now - no error messages. I can do everything except find usages with hscope, when it complains with "E567: no cscope connection".
I can do everything except find usages with hscope, when it complains with "E567: no cscope connection".
Have you verified that you ran ",tg" in the project to generate tags? It should create an "hscope.out" file in your project directory. Whenever vim loads a Haskell file in a buffer it will search for he hscope file and will use it as the cscope database. This comes from line 64 in the vimrc.haskell file of haskell-vim-now:
function! LoadHscope() let db = findfile("hscope.out", ".;") if (!empty(db)) let path = strpart(db, 0, match(db, "/hscope.out$")) set nocscopeverbose " suppress 'duplicate connection' error exe "cs add " . db . " " . path set cscopeverbose endif endfunction au BufEnter /*.hs call LoadHscope()
Did this suggestion help?
Hi Joe, sorry for my late reply. When I ran ,tg only a codex.tags where generated. So that is the problem probably.
OK, I'll close this issue.
Hi Joe, Thank you for maintaining this useful Haskell resource. This is a bit of a "meta", but despite my searching around, I can't seem to figure out the following. What is the relationship between
hscope
(a cscope
alternative) and codex
(a tag generator)? Do they work sequentially to generate a tag file?
Several years ago I gave this talk about how the tools relate to one another - https://begriffs.com/posts/2015-07-27-haskell-source-navigation.html
(about 5:00 in I give a demo of the codex internals)
I recall watching (and rewatching) the video a few months ago. I'll take another look. Thank you!
My specific question is given the following:
codex
generates the codex.tags
file using hasktags
(set in my global .codex
config)hscope
generates the hscope.out
file (a scope alternative for Haskell)vim/nvim
has the ability to reference
hasktags
located in codex.tags
file using the set tags
register
points the user from a symbol to the symbol's definition
hscope
db located in hscope.out
using the cscope :cs add
command
points the user from a symbol to all uses of that symbol
csto
registerTo build each of the files we have the following:
codex
-> codex update
hscope
-> git ls-files | grep hs$ | xargs hscope -b "$@"
|| aka thanks to HVN git-hscope -X TemplateHaskell
?... where can I track when/and how the updates to the codex.tags
and hscope.out
are taking place?
Hey, sorry I'm not going to invest time looking into it for free. I set myself a new personal policy.
HVN is a great contribution. Thank you for that. I understand and appreciate your position.
When opening a new file or doing
,hl
I get:Here's the output from installing HVN
Hscope seems to be present:
The global stack resolver set in
.stack/global-project/stack.yaml
is lts-8.5