kowainik / stan

🕵️ Haskell STatic ANalyser
https://kowainik.github.io/projects/stan
Mozilla Public License 2.0
562 stars 48 forks source link

Stan should normalize incoming file paths to be relative #556

Open keithfancher opened 5 months ago

keithfancher commented 5 months ago

Related to the HLS issue https://github.com/haskell/haskell-language-server/issues/3174 and its associated PR https://github.com/haskell/haskell-language-server/pull/4023.

Stan's checksMap and createCabalExtensionsMap use relative paths, but Stan will happily take absolute paths for queried HIE files. Paths coming in from HLS, for example, were absolute, causing Map misses and resulting in the above issue. The result of these misses is that Stan didn't detect any enabled language extensions, and, e.g., would spam the user with suggestions to enable StrictData.

I would suggest normalizing incoming files, ensuring they're relative as expected, to avoid issues like this in the future. And/or documenting that Stan expects relative paths.

Thank you!

tomjaguarpaw commented 5 months ago

Thanks for the report. stan and extensions have very little active maintainership currently. I'm happy to oversee and advise a patch to fix this, but I won't have time to do it myself any time in the near future. Perhaps @0rphee is interested?

tomjaguarpaw commented 5 months ago

The first thing to do would be to produce an example that demonstrates the current behaviour, as simply as possible.

0rphee commented 4 months ago

Probably I won't be able to work on this for the foreseeable future, maybe in a few months.. :)