Closed Anrock closed 6 years ago
git bisect
shows that 884d1e6ba3308ff1beb6d17dbebdf2b222cea7a4
is first broken commit.
Not sure why, but it's working again at 2f9f683
Nope, for some reason first diagnostic upon launch stayed until being fixed. And then it was all the same.
I have a deja vu, this looks very similar to #329
This is once again an issue somewhere around setTypeCheckedModule
function.
((diags', errs), mtm) <- GM.getTypecheckedModuleGhc' (myLogger rfm) fp
returns diagnostics for file://C%3A/blabla
and next line let diags = Map.insertWith Set.union uri Set.empty diags'
inserts empty diagnostics for file://C:/blabla
into diagnostics map.
Probably https://github.com/alanz/haskell-lsp/pull/76 is related. At least it touches semicolon encoding for Windows drives.
Looks like canonicalizing uri before trying to insert fixes the issue. Not sure if it's a proper solution.
diff --git a/src/Haskell/Ide/Engine/Plugin/GhcMod.hs b/src/Haskell/Ide/Engine/Plugin/GhcMod.
hs
index b5d42b3..ea62f06 100644
--- a/src/Haskell/Ide/Engine/Plugin/GhcMod.hs
+++ b/src/Haskell/Ide/Engine/Plugin/GhcMod.hs
@@ -157,7 +157,8 @@ setTypecheckedModule uri =
debugm $ "setTypecheckedModule: file mapping state is: " ++ show fileMap
rfm <- GM.mkRevRedirMapFunc
((diags', errs), mtm) <- GM.getTypecheckedModuleGhc' (myLogger rfm) fp
- let diags = Map.insertWith Set.union uri Set.empty diags'
+ canonUri <- canonicalizeUri uri
+ let diags = Map.insertWith Set.union canonUri Set.empty diags'
case mtm of
Nothing -> do
debugm $ "setTypecheckedModule: Didn't get typechecked module for: " ++ show fp
Full hie log
HIE Version 0.2.0.0, Git revision 4e900d53c401c0d3b6f69c6bbddc9ab6c6834d0d (dirty) (1338 commits) x86_64 ghc-8.2.2
I guess here is the issue:
Diagnostics are shown due to first message and then almost immediately cleared by second message. Not sure if there any more info needed?