Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Could not obtain flags for test files with cabal-helper cradle using stack #1564

Open
@fduxiao

Description

@fduxiao

Everything was working well until I recompiled HIE with commit hash 22c69c620b2707119194bb33c4ae15427e46f0a2. When I try editing a test file, vscode keeps complaining the following:

Fail on initialisation for "/Users/xiao/haskell/mal2/test/NumberSpec.hs".
Could not obtain flags for: "test/NumberSpec.hs".

This module was not part of any component we are aware of.

Component: ChLibName ChMainLibName with source directory: ["src"]
Component: ChExeName "mal-exe" with source directory: ["app"]


To expose a module, refer to:
https://docs.haskellstack.org/en/stable/GUIDE/
If you are using `package.yaml` then you don't have to manually expose modules.
Maybe you didn't set the source directories for your project correctly.

Previously (at least in November 2019) I never met this, but now vscode warns me that Fail on initialisation for "/Users/xiao/haskell/mal2/test/NumberSpec.hs". Could not obtain flags for: "test/NumberSpec.hs". repeatedly. (The alert flashes so quickly that I narrowly copied this line).

stack test works correctly and the test source dir is specified in the tests section of package.yaml(The same problem occurs even if I initialize a new project with stack). It seems that HIE doesn't consider test sources as a component to be aware of.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions