Skip to content

haskell-session-change-target unusable in cabal package with multiple library stanzas #1796

Open
@noinia

Description

@noinia

I have a project in which my cabal file specifies multiple libraries (since I'm using backpack) [1]. If I try to fire up an repl I have to select the correct target using haskell-session-change-target. That works well for selecting benchmarks or testsuites, however,
for each library stanza I just get a copy of "lib:" (so "lib:hgeometry-vector" in my particular case), and unfortunately that does not allow me to actually switch to the right library.

Browsing through the source a bit, I think the culprit is the haskell-cabal-enum-targets function in haskell-cabal.el. In particular, it seems that on line 520 it is indeed creating the "lib:" instances rather than picking whatever the right session name is. While I (think) I can read enough elisp to figure out where this went wrong, I'm not really fluent enough to easily change it to do the right thing. I guess we want to keep the current behavior for the unnamed global library, but use the proper section-name (=name of the sub-library) when the section has a name).

[1] the particular package in question is https://github.com/noinia/hgeometry/tree/hgeom-1/hgeometry-vector but I don't think it should matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions