-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve scripts for haskell-language-server and ghci #2990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Seems to work as well as with what I previously used, after setting up direnv (and I imagine I won't have to regenerate it).
However, I still get hover not found
for all symbols in
[...]Restore.hs
[...]local-cluster.hs
[...]exe/cardano-wallet.hs
lib/core/test/bench/db/Main.hs
🙁
E.g. with the following output
Found "/Users/anviking/IOHK/cardano-wallet/hie.yaml" for "/Users/anviking/IOHK/cardano-wallet/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0, Git revision 253547816ee216c53ee7dacc0ad3cac43e863d30 (dirty) x86_64 ghc-8.10.4
Current directory: /Users/anviking/IOHK/cardano-wallet
Operating system: darwin
Arguments: ["--lsp"]
Cradle directory: /Users/anviking/IOHK/cardano-wallet
Cradle type: Bios
Tool versions found on the $PATH
cabal: 3.4.0.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/Users/anviking/.ghcup/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.4.0.0 (GHC: 8.10.7) (PATH: /Users/anviking/.ghcup/bin/haskell-language-server-8.10.7~1.4.0) (GIT hash: 253547816ee216c53ee7dacc0ad3cac43e863d30)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /Users/anviking/IOHK/cardano-wallet
Starting LSP server...
If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option!
Started LSP server in 0.00s
setInitialDynFlags cradle: Cradle {cradleRootDir = "/Users/anviking/IOHK/cardano-wallet", cradleOptsProg = CradleAction: Cabal}
2021-10-22 15:31:49.650343 [ThreadId 5] INFO hls: Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 7699462648287052475 "file:///Users/anviking/IOHK/cardano-wallet"], clientSettings = hashed (Just (Object (fromList [])))}
2021-10-22 15:31:49.684715 [ThreadId 84] INFO hls: Consulting the cradle for "lib/core/test/bench/db/Main.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/anviking/IOHK/cardano-wallet", cradleOptsProg = CradleAction: Bios}
2021-10-22 15:31:49.708169 [ThreadId 94] INFO hie-bios: Generating /private/tmp/nvimTPZXrR/HIE_BIOS_OUTPUT86709-0 for source file lib/core/test/bench/db/Main.hs.
2021-10-22 15:31:50.199913 [ThreadId 94] INFO hie-bios: Finished.
2021-10-22 15:31:50.412493 [ThreadId 84] INFO hls: Using interface files cache dir: /Users/anviking/.cache/ghcide/main-c8474e8495c9d1cd314726e560828967a4513812
2021-10-22 15:31:50.412938 [ThreadId 84] INFO hls: Making new HscEnv[main]
haskell-language-server-8.10.7: loadArchive: Neither an archive, nor a fat archive: `/nix/store/3ssw9vhdymjwhxjaa4kzxcf40lbkczvx-clang-wrapper-7.1.0/bin/clang++'
haskell-language-server-8.10.7: loadArchive: Neither an archive, nor a fat archive: `/nix/store/3ssw9vhdymjwhxjaa4kzxcf40lbkczvx-clang-wrapper-7.1.0/bin/clang++'
2021-10-22 15:32:14.959867 [ThreadId 4882] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 20.36s)
haskell-language-server-8.10.7: loadArchive: Neither an archive, nor a fat archive: `/nix/store/3ssw9vhdymjwhxjaa4kzxcf40lbkczvx-clang-wrapper-7.1.0/bin/clang++'
haskell-language-server-8.10.7: loadArchive: Neither an archive, nor a fat archive: `/nix/store/3ssw9vhdymjwhxjaa4kzxcf40lbkczvx-clang-wrapper-7.1.0/bin/clang++'
2021-10-22 15:32:30.139963 [ThreadId 5951] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 0.00s)
2021-10-22 15:32:31.313371 [ThreadId 5967] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 0.00s)
2021-10-22 15:32:32.049401 [ThreadId 5983] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 0.00s)
2021-10-22 15:32:32.926618 [ThreadId 5999] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 0.00s)
2021-10-22 15:32:34.369133 [ThreadId 6015] INFO hls: finish: Wingman.getMetaprogramsAtSpan.TypeCheck (took 0.00s)
I wondered if it could be related to haskell/haskell-language-server#1684, however it works in non-Main modules, and using a non-nix clang++ didn't seem to help either.
If it worked for you the reason would probably be macOS specific, though?
bors r+ |
2990: Improve scripts for haskell-language-server and ghci r=Anviking a=rvl It now generates a custom HLS config on the fly. Instructions are in `hie-direnv.yaml`. ### Issue Number ADP-1229 Co-authored-by: Rodney Lorrimar <[email protected]>
Build failed: |
It's just a symlink to haskell-language-server, but should prevent the wrong hls build being used if the user has their editor configured to use haskell-language-server-wrapper.
This tool can be used for debugging the haskell-language-server environment.
8f299f4
to
2af712a
Compare
Thanks @Anviking, from that log it looks like your editor is picking up the wrong build of haskell-language-server. This may explain the I added a In the comments of Here's what I get:
|
Thanks @rvl, it works now!! ✨ In
For record, I can't run
for some reason, but 🤷♂️ |
This silences the ModuleName LSP code lens which unnecessarily suggests qualifying the module name. It also makes the various Main modules easier to distinguish from each other.
f7815b6
to
927c8b8
Compare
Great! bors r+ |
2990: Improve scripts for haskell-language-server and ghci r=rvl a=rvl It now generates a custom HLS config on the fly. Instructions are in `hie-direnv.yaml`. ### Issue Number ADP-1229 Co-authored-by: Rodney Lorrimar <[email protected]>
Build failed: |
bors r+ |
Build succeeded: |
It now generates a custom HLS config on the fly. Instructions are in
hie-direnv.yaml
.Issue Number
ADP-1229