You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement request related to a problem? Please describe.
I often am working on a workspace that is rather slow to start up HLS in on account of having a Lot of Code. When I'm making a new package, I often forget to add dependencies as I go. Every time I add one, I have to restart HLS altogether.
Since I use nix, it's often the case that the dependencies are actually available in the ghc package database of the shell already, they just aren't declared as dependencies of this particular package.
For instance, if I import Extra in some file (n.b. ghc-pkg list only shows extra-1.7.11, not sure what's up there):
[not found] [E] Could not load module ‘Extra’
It is a member of the hidden package ‘extra-1.7.12’.
Perhaps you need to add ‘extra’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘extra-1.7.10’.
Perhaps you need to add ‘extra’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘extra-1.7.11’.
Perhaps you need to add ‘extra’ to the build-depends in your .cabal file.
Describe the solution you'd like
I would love the ability to hot-add stuff to the set of dependencies of my package. It would be totally fine by me if HLS was like "here I believe you added it, pinky swear", and did not necessarily implement actually editing the cabal file for you.
Describe alternatives you've considered
It could also work to see changes in the cabal file and live-add the packages to the session if they are already present and built. That would also solve my issue.
Additional context
The text was updated successfully, but these errors were encountered:
In any way, slightly difficult to implement reliably. I think we are making some progress towards it with the hls-cabal-plugin.
It would be totally fine by me if HLS was like "here I believe you added it, pinky swear", and did not necessarily implement actually editing the cabal file for you.
While it might work in the nix case, in any other case, this seems like it is just going to make everything more complicated in other cases :)
I have often wanted something similar to this, though I suspected it might be impossible to implement robustly. A more modest proposal is to fix Cabal to make reloads quicker by recognising when a change to the .cabal file only requires a trivial modification of the flags passed to GHC. Or even more simply, avoiding the main expense, running the solver, when it isn't necessary. See haskell/cabal#9302 (reply in thread).
Anyway, these would involve changes entirely outside HLS.
Is your enhancement request related to a problem? Please describe.
I often am working on a workspace that is rather slow to start up HLS in on account of having a Lot of Code. When I'm making a new package, I often forget to add dependencies as I go. Every time I add one, I have to restart HLS altogether.
Since I use nix, it's often the case that the dependencies are actually available in the ghc package database of the shell already, they just aren't declared as dependencies of this particular package.
For instance, if I
import Extra
in some file (n.b. ghc-pkg list only shows extra-1.7.11, not sure what's up there):Describe the solution you'd like
I would love the ability to hot-add stuff to the set of dependencies of my package. It would be totally fine by me if HLS was like "here I believe you added it, pinky swear", and did not necessarily implement actually editing the cabal file for you.
Describe alternatives you've considered
It could also work to see changes in the cabal file and live-add the packages to the session if they are already present and built. That would also solve my issue.
Additional context
The text was updated successfully, but these errors were encountered: