Skip to content

Hot-add dependencies #3288

Closed as not planned
Closed as not planned
@lf-

Description

@lf-

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

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