kowainik / stan

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

Prelude.!!: index too large #327

Closed fendor closed 4 years ago

fendor commented 4 years ago

Not sure whether this issue belongs here or to ghcide.

Stan doesnt work with HIE files generated by Haskell Language Server / ghcide.

The issue was described in reddit and the explanation of what is missing:

I think I know what happens. When contributing GHC-8.10 support in ghcide, I noticed that they create HIE files artificially and they erase source content from HIE files completely. That's why you see an error about too large index — there's simply no source code info in HIE files.

We can check indexes on our side in Stan, but you will see blank lines in report, which won't make it that useful to users.

If this is indeed what is happening, what you can do is to try to discuss this issue with the Haskell IDE engine team, reporting the bug to them. I see how this issue can break the integration of different tools and that resolving it can help different tools not to interfere with each other. I believe it's a good idea, in general, to build tooling around the same API and same expectations, otherwise we will have the broken ecosystem in area of IDE.

I confirmed in ghcide that the source bytestring is empty: https://github.com/digital-asset/ghcide/blob/master/src/Development/IDE/Core/Compile.hs#L281 and https://github.com/digital-asset/ghcide/blob/master/src-ghc88/Development/IDE/GHC/HieAst.hs#L94

vrom911 commented 4 years ago

@fendor Unfortunately, we can't do anything with the fact that the generated HIE files are incomplete. However, we can improve Stan's behaviour in this case, so the user can understand better the problem, and maybe open the follow-up issues in the responsible tools.

I have made such changes in #328, This should fix it :slightly_smiling_face: