Open friedbrice opened 3 years ago
I think defining an explicit hie.yaml
will restrict HLS to the specified directories.
This might be helpful for generating the file: https://github.com/Avi-D-coder/implicit-hie
Thanks, @ilyakooo0! I actually tried this, following the advice on their readme (https://github.com/mpickering/hie-bios#ignoring-directories-1).
My config looked like this:
cradle:
multi:
- path: "./.cache"
config:
cradle:
none:
- path: "./"
config:
cradle:
cabal:
- path: "./src"
component: ...
- path: "./app"
component: ...
- path: "./test"
component: ...
(The ...
s above are metasyntactic, as the true values there are incidental to the discussion.)
Unfortunately, when I closed and restarted VS Code, vscode-haskell complained that it could not determine the appropriate GHC version :-/
Oh, I am a fool! That error is being reported in ~/.config/...
not in <project_root>/.config/...
. Maybe this is a different problem, then. I get build errors and Multi Cradle errors reported from my Paths_<project_name>.hs
files.
This is what I'm seeing every time I open my project:
Here are my config files:
cradle:
cabal:
- path: "./src"
component: ...
- path: "./test"
component: ...
- path: "./app"
component: ...
- path: "./one-off-task"
component: ...
{
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.tabSize": 2,
"haskell.formattingProvider": "ormolu",
"haskell.formatOnImportOn": true,
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
}
hi, thanks for the bug report, maybe delete the cache mentioned in the error could help
Did you try opening the Paths_
module? That might produce such errors. (So the suggestion would be, to not do that :) )
I failed to reproduce the issue manually, can you maybe share a project or a minimal example?
I have some Haskell files in my project directory outside of the traditional
./src/
,./app/
and./test/
directories. Examples are./dev-tools.hs
where I keep some things I like to use in GHCi, and./.cache/hie-bios/.../Paths_mwb.hs
.Haskell plugin reports errors in these files and tries to set up a multi-cradle project, but I would prefer if it didn't since they are not part of my actual project source.
Is there a way to tell the plugin to only trigger for Haskell files in specific directories?