kowainik / stan

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

Limitation if there are several modules with the same name in the same project #321

Closed ShrykeWindgrace closed 4 years ago

ShrykeWindgrace commented 4 years ago

I noticed that if there two executable targets, both having a module Main.hs and marked for .hie file generation, then the only one of them will be visible to stan.

This is not an issue of stan per se - while dumping .hie files, ghc puts everything flatly in the specified folder; if two modules have the same name, then only the last one will overwrite the previous. Hence stan will be aware only of the last module.

And as far as I understand, we can not remedy this problem with careful choice of include/exclude scopes - we need to patch ghc options of our targets.

vrom911 commented 4 years ago

As you fairly noticed, this is not Stan's responsibility. You can create the HIE files the way you want. All that Stan need is the directory with the HIE files, which you can organise as you wish.

I would suggest you to open a GHC issue, not to rewrite Main modules as it is a more suitable place to discuss your problem.

I am afraid there is nothing we can do here, as Stan is explicitly not generating the HIE files itself and works with what is given to it.🙂 With such an approach, we offer users flexibility on what they want to have analysed and where they want to store the HIE files.