Skip to content

Commit bfa8e85

Browse files
committed
Canonicalize hiedb path before comparing
Path comparisons are not accurate if non canonical
1 parent ef0e9fd commit bfa8e85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,12 @@ getModIfaceFromDiskAndIndexRule =
732732
hie_loc = ml_hie_file $ ms_location ms
733733
hash <- liftIO $ getFileHash hie_loc
734734
mrow <- liftIO $ HieDb.lookupHieFileFromSource hiedb (fromNormalizedFilePath f)
735+
hie_loc' <- liftIO $ canonicalizePath $ HieDb.hieModuleHieFile mrow
735736
case mrow of
736737
Just row
737738
| hash == HieDb.modInfoHash (HieDb.hieModInfo row)
738-
, hie_loc == HieDb.hieModuleHieFile row -> do
739+
&& hie_loc == hie_loc'
740+
-> do
739741
-- All good, the db has indexed the file
740742
when (coerce $ ideTesting se) $ liftIO $ mRunLspT (lspEnv se) $
741743
LSP.sendNotification (SCustomMethod "ghcide/reference/ready") $

0 commit comments

Comments
 (0)