mrcjkb / haskell-tools.nvim

🦥 Supercharge your Haskell experience in neovim!
GNU General Public License v2.0
432 stars 18 forks source link

when no project root is found, haskell-tools.nvim doesn't start hls #346

Closed MangoIV closed 5 months ago

MangoIV commented 5 months ago

Neovim version (nvim -v)

v0.9.5

Operating system/version

nixos 24.05

Output of :checkhealth haskell-tools

==============================================================================
haskell-tools: require("haskell-tools.health").check()

Checking for Lua dependencies ~
- OK [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) installed.

Checking external dependencies ~
- OK haskell-language-server: found haskell-language-server version: 2.5.0.0 (GHC: 9.4.8) (PATH: /nix/store/icf1i9cg9xl8lh3y0rkwyb364cw436yj-haskell-language-server-2.5.0.0/bin/haskell-language-server-wrapper)
- OK hoogle: found Hoogle 5.0.18.3, https://hoogle.haskell.org/
- WARNING       fast-tags: not found.
  Install [fast-tags](https://hackage.haskell.org/package/fast-tags) for extended capabilities.
  Optional, for generating tags as a `tagfunc` fallback.

- OK curl: found curl 8.6.0 (x86_64-pc-linux-gnu) libcurl/8.6.0 OpenSSL/3.0.13 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.59.0
- OK haskell-debug-adapter: found haskell-debug-adapter-0.0.39.0
- WARNING       ghci-dap: not found.
  Install [ghci-dap](https://github.com/phoityne/ghci-dap) for extended capabilities.
  Optional, for `dap` support.

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

How to reproduce the issue

just have a haskell file, but no cabal or stack projct

Expected behaviour

hls starts as normal

Actual behaviour

hls does fishy stuff. the log just shows "no project root found" warning but in lsp.log it prints some stuff from .../lean which is a completely unrelated directory...

image

Log files

No response

The minimal config used to reproduce this issue.

n/a
mrcjkb commented 5 months ago

Hey Mango :smile:

I tried the following steps, and couldn't reproduce:

mkdir /tmp/foo
cd /tmp/foo
nix shell "nixpkgs#haskell-language-server"
nvim Test.hs

The LSP client started up normally and added a code lens suggesting a module name.

in lsp.log it prints some stuff from .../lean which is a completely unrelated directory...

Do you have any cabal or stack project files in a parent directory? If so, then haskell-tools is probably picking them up as the project root.

MangoIV commented 5 months ago

Thank you! Well good it’s not a bug and again just me. Wrt the project files I don’t think so. I also have this on two systems. Perhaps it’s related to my setup. Again I’m too stupid to debug this :3

I’ll see what goes on. Thanks for testing this :)

mrcjkb commented 5 months ago

Let me know if you find anything :smile:

MangoIV commented 5 months ago

Alright <3