-
Notifications
You must be signed in to change notification settings - Fork 90
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
Support projects in subfolders #1016
Comments
Hi, thank you for the feature requests! Let's think about the use-cases and how we want HLS to behave. We can think of a number of potential project structures:
We have the following requirements:
VSCode gives us the URI of the filepath that caused the extension to be activated.
One issue we have is that we try to figure out the GHC version to compile the project, but HLS also tries to figure out the GHC version on its own which would likely fail for us. |
Is there any requirement for the plugin to launch only a single HLS instance? It doesn't sound unreasonable to me to run one HLS instance per subproject, although that does of course have drawbacks like much more memory usage. |
I am not sure, but usually, if you have a project, you often have dependencies between haskell packages. If you launched different HLS instances per subproject, HLS would likely get confused. |
This would be great. I've seen it trip up beginners a few times. And I actually have at least one project which has a For some reason I always assumed the fix would be difficult. |
We are not sure, whether is difficult, quite easy, or perhaps even required by the lsp standard :) |
Is your feature request related to a problem? Please describe.
I'm currently working on a project of which a Haskell project is only a small part. When trying to open the root folder in VSCode however, the Haskell extension does not pick up on the Stack project in the Haskell-specific subfolder.
Describe the solution you'd like
I would like the extension to select the Haskell project folder by looking for stack.yaml/*.cabal/whatever files, instead of just naively picking the opened folder as Haskell project folder.
This is also what Kate does, its LSP client default configuration has the following line for HLS:
"rootIndicationFileNames": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml"]
Describe alternatives you've considered
Additional context
Consider the following folder layout:
In my example, I open toplevel in VSCode (instead of project), but want HLS to use project as root folder.
So if I open the file
project/src/Main.hs
, I want HLS to start withDirectory: toplevel/project
, notDirectory: toplevel
which causes it to miss the stack/cabal files that allow it to know what dependencies I am using etc.The text was updated successfully, but these errors were encountered: