Skip to content

Commit 5c8a587

Browse files
committed
[new-hs-indexer] Track xrefs to modules from import declarations
* Expand xrefs to include `ModuleName` (unfortunately not `Module`) * Capture these in the indexer * Expand codemarkup to resolve ModuleName xrefs to Modules All tested in VS Code, we can click on a module name in an import to jump to the module.
1 parent ef49a1a commit 5c8a587

12 files changed

Lines changed: 811 additions & 1017 deletions

File tree

glean/glass/Glean/Glass/SymbolId/Hs.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ instance Symbol Hs.NameSort where
7272

7373
instance ToQName Hs.Entity where
7474
toQName (Hs.Entity_name n) = Glean.keyOf n >>= toQName
75-
toQName (Hs.Entity_mod _) = error "TODO: ToQName Hs.Entity_mod"
75+
toQName (Hs.Entity_mod mod) = do
76+
Hs.Module_key m _ <- Glean.keyOf mod
77+
modname <- Glean.keyOf m
78+
return $ Right (Name modname, Name "")
7679
toQName _ = error "ToQName: unknown Hs.Entity"
7780

7881
instance ToQName Hs.Name_key where

0 commit comments

Comments
 (0)