begriffs / haskell-vim-now

One-line Haskell Vim install
MIT License
988 stars 100 forks source link

Still hscope troubles with LTS-8.5 #244

Closed tsoernes closed 7 years ago

tsoernes commented 7 years ago

When opening a new file or doing ,hl I get:

Error detected while processing function LoadHscope:
cs_read_prompt EOF: success
E609: Cscope error: p-course does not exist

Here's the output from installing HVN

ENV: [HVN_INSTALL_BASIC=]
ENV: [HVN_GENERATE_HOOGLE_DB=y]
--> Existing Haskell-Vim-Now installation detected at /home/torstein/.config/haskell-vim-now.
--- Syncing Haskell-Vim-Now with upstream...
Current branch master is up to date.
--- Installing system packages [libcurl-devel zlib-devel powerline] using [DNF]...
--- Installing with DNF...
Package libcurl-devel-7.51.0-6.fc25.x86_64 is already installed, skipping.
Package zlib-devel-1.2.8-10.fc24.x86_64 is already installed, skipping.
Package powerline-2.5-3.fc25.x86_64 is already installed, skipping.
--- Checking ctags' exuberance...
--- Setting git to use fully-pathed vim for messages...
--- Testing for broken Ruby interface in vim...
--- Test passed. Ruby interface is OK.
--- Backing up current vim config using timestamp 20170424_151200...
    /home/torstein/.config/haskell-vim-now/backup/.vim.20170424_151200
    /home/torstein/.config/haskell-vim-now/backup/.vimrc.20170424_151200
--- Creating vim config symlinks
    ~/.vimrc -> /home/torstein/.config/haskell-vim-now/.vimrc
    ~/.vim   -> /home/torstein/.config/haskell-vim-now/.vim
--- Installing plugins using vim-plug...

--- <---- HASKELL VIM NOW installation successfully finished ---->

Hscope seems to be present:

ls ~/.local/bin
codex  ghc-mod  ghc-modi  hasktags  hlint  hoogle  hscope  pointfree  pointful  refactor

The global stack resolver set in .stack/global-project/stack.yaml is lts-8.5

begriffs commented 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.

begriffs commented 7 years ago

@tsoernes any luck with the hscope issue after re-running the installer?

patriques82 commented 7 years ago

I have the same issue (running lts-9.0)

tsoernes commented 7 years ago

@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.

begriffs commented 7 years ago

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.

patriques82 commented 7 years ago

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".

begriffs commented 7 years ago

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()

begriffs commented 7 years ago

Did this suggestion help?

patriques82 commented 7 years ago

Hi Joe, sorry for my late reply. When I ran ,tg only a codex.tags where generated. So that is the problem probably.

begriffs commented 7 years ago

OK, I'll close this issue.

EdmundsEcho commented 6 years ago

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?

begriffs commented 6 years ago

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)

EdmundsEcho commented 6 years ago

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:

To build each of the files we have the following:

... where can I track when/and how the updates to the codex.tags and hscope.out are taking place?

begriffs commented 6 years ago

Hey, sorry I'm not going to invest time looking into it for free. I set myself a new personal policy.

EdmundsEcho commented 6 years ago

HVN is a great contribution. Thank you for that. I understand and appreciate your position.