Skip to content
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

0.1 errors when opening VSCode #101

Closed
DavSanchez opened this issue May 9, 2020 · 3 comments
Closed

0.1 errors when opening VSCode #101

DavSanchez opened this issue May 9, 2020 · 3 comments

Comments

@DavSanchez
Copy link

DavSanchez commented May 9, 2020

Hi guys!

Congratulations for this project. Hope it becomes the tool of our dreams to work with Haskell!

I'm trying haskell-language-server and I have encountered this issue, where it returns an error about not finding the module and there is a "Processing 1/2" indicator at the status bar that won't finish, as in the image below.

Screenshot 2020-05-09 at 03 05 39

Obviously it's not working. Hover, formatting... nothing. It's just stuck there.

The instructions done to install this were:

git clone https://.../haskell/haskell-language-server.git --recurse-submodules
cd haskell-language-server
git checkout 0.1
stack ./install.hs hls-8.8.3

The settings for VSCode are only:

{
  "languageServerHaskell.formattingProvider": "ormolu",
  "languageServerHaskell.hieVariant": "haskell-language-server"
}

And the project itself is one generated with stack new <template>, unmodified apart from setting a git repo.

What could this be? Am I doing something wrong? Thanks in advance!

@Avi-D-coder
Copy link
Collaborator

This is unfortunately expected behavior for the time being. #88 is not yet ready for use.

For the time being please install and run implicit-hie.
It will generate an hie.yaml config file and everything will work.

PS: I will be discussing getting hie/hls/ghcide installed and working with cabal and stack on the weekly haskell video chat at 5 PM UTC tomorrow(Saturday).

@fendor
Copy link
Collaborator

fendor commented May 9, 2020

@DavSanchez Can you please post the full log? Imo, this is not expected behaviour.
Also, as a quicker work-around to this problem, you may write a hie.yaml file. A rought introduction: https://github.com/haskell/haskell-ide-engine#project-configuration

For a simple stack project, a hie.yaml with the contents:

cradle:
  stack:

should suffice. Place this in the root of your project and also make sure to open the project root when starting the lsp-client.

@DavSanchez
Copy link
Author

DavSanchez commented May 9, 2020

Ah, I had a hie.yaml created from the available ones from this repo, and I just realised I had left an uncommented path and component there that was not present in my project structure (was referring to haskell-language-server component, from the original file). Now the process unstuck and it works, sorry!

Just in case it gives you any more information you can use, the log is the following:

[client] run command = "haskell-language-server-wrapper --lsp"
[client] debug command = "haskell-language-server-wrapper --lsp"
ghcide version: 0.1.0.0 (GHC: 8.8.3) (PATH: /.../.local/bin/haskell-language-server-wrapper) (GIT hash: 019b028)
ghcide version: 0.1.0.0 (GHC: 8.8.3) (PATH: /.../.local/bin/haskell-language-server-8.8.3) (GIT hash: 019b028)
Starting (haskell-language-server)LSP server...
with arguments: Arguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsVersion = False, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 1}
with plugins: [PluginId "brittany",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas"]
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
Started LSP server in 0.00s
2020-05-09 18:10:52.393533 [ThreadId 9] - Opened text document: file:///.../htgeobot/src/Lib.hs
Consulting the cradle for "/.../htgeobot/src/Lib.hs"
Error parsing targets: Unknown local package: haskell-language-server
Note that to specify options to be passed to GHCi, use the --ghci-options flag
2020-05-09 18:10:52.786702 [ThreadId 44] - Plugin.makeCodeLens (ideLogger)
/.../htgeobot/.stack-work/install/x86_64-osx/e65fb45fb2f681541018788623ee2651c5c0fbe15135afc7c7153784047a1a27/8.8.3/pkgdb:/.../.stack/snapshots/x86_64-osx/e65fb45fb2f681541018788623ee2651c5c0fbe15135afc7c7153784047a1a27/8.8.3/pkgdb:/.../.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
haskell-language-server-8.8.3: CradleError (ExitFailure 1) ["Failed to parse result of calling stack","Error parsing targets: Unknown local package: haskell-language-server","Note that to specify options to be passed to GHCi, use the --ghci-options flag"]

The ... stands for my $HOME directory.

I'll need to read a little bit more on how the syntax for components defined at hie.yaml works.

Thanks!

pepeiborra added a commit that referenced this issue Dec 27, 2020
* Improve hover performance by speeding up getFileExists

We touch the file system only the first time.
After that, we rely on the lsp client to tell us if a file is created or deleted

Fixes #101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants