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

Fail on initialisation error & Cannot find module error #217

Closed
yeomjy opened this issue Mar 16, 2020 · 3 comments
Closed

Fail on initialisation error & Cannot find module error #217

yeomjy opened this issue Mar 16, 2020 · 3 comments

Comments

@yeomjy
Copy link

yeomjy commented Mar 16, 2020

Hi, I'm using Haskell Language Server extension 0.0.37 on Arch Linux. I'm using ghc-8.8.2 with stack(lts-15.3).
And I installed hie-8.8.2 by Aura(https://github.com/haskell/haskell-ide-engine#installation-on-arch-linux)

First error is:
I used stack new command for making new project directory. And I opened folder at vscode.
Extension successfully worked with app/Main.hs and src/Lib.hs which were made by stack new command.
But Extension doesn't worked with test/Spec.hs and Setup.hs.
Error Message Is:
Fail on initialisation for "/home/junyoung/Haskell/new-project/test/Spec.hs". Could not obtain flags for: "test/Spec.hs". This module was not part of any component we are aware of. Component: ChLibName ChMainLibName with source directory: ["src"] Component: ChExeName "new-project-exe" with source directory: ["app"] To expose a module, refer to: https://docs.haskellstack.org/en/stable/GUIDE/ If you are usingpackage.yamlthen you don't have to manually expose modules. Maybe you didn't set the source directories for your project correctly.
same error messages for Setup.hs.

I think this extension only work with code that makes executable file, How can I use this extension with Setup and test code files?

And the Second Error is:
I made my own module and named it NewModule. Placed It in same director(lib) and imported it in Lib.hs like this.

module Lib
    ( someFunc
    ) where

import NewModule

Then a red underline appeared at "import NewModule"
Error message is:
Could not find module ‘GS’ Use -v (or:set -vin ghci) to see a list of the files searched for
but ghci and stack build worked normally. Why this error message happens?

@fendor
Copy link
Collaborator

fendor commented Mar 16, 2020

You can not use this extension for files like Setup.hs. However, the loading of test-components is a known issue and discussed in haskell/haskell-ide-engine#1564.
TLDR; Execute stack test before opening the project with hie, then it ought to work.

@yeomjy
Copy link
Author

yeomjy commented Mar 18, 2020

Thank you.

@jneira
Copy link
Member

jneira commented May 25, 2020

Tracked in the hie issue linked above

@jneira jneira closed this as completed May 25, 2020
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