Skip to content

Module paths with / as separator are broken in Windows #93

Open
@keithfancher

Description

@keithfancher

Discovered while working on this HLS PR: haskell/haskell-language-server#4023, related to these issues:

Stan, via extensions, appears to be prepending the hs-source-dirs from the .cabal file verbatim onto the module name. This means if the .cabal file uses / as its path separators, the returned file paths (and associated extension map) will be broken for Windows users.

For example, if your cabal file has:

  hs-source-dirs: extension-tests/language-pragma

... then the resulting Map key winds up looking like this for Windows users:

extension-tests/language-pragma\\LanguagePragmaTest.hs

This results in Map lookups missing, which in turn results in Stan not recognizing any of a project's enabled extensions. (One of the causes for the above-mentioned HLS issue.)

From a quick look, I think the issue might be happening around here somewhere. (I do see some Cabal version checks, not sure how those play into this...)

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