Description
Discovered while working on this HLS PR: haskell/haskell-language-server#4023, related to these issues:
- Stan plugin recommends StrictData pragma even when it is in scope haskell/haskell-language-server#3174
- Stan should normalize incoming file paths to be relative stan#556
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...)