@@ -16,15 +16,17 @@ import TextShow
1616
1717import Glean.Glass.SymbolId.Class
1818import Glean.Glass.Types (Name (.. ))
19- import Glean.Schema.CodeHs.Types as Hs (Entity )
19+ import Glean.Schema.CodeHs.Types as Hs (Entity ( .. ) )
2020import qualified Glean
2121import qualified Glean.Schema.Hs.Types as Hs
2222import qualified Glean.Schema.Src.Types as Src
2323
2424-- REPO/hs/containers/Data/Map/{var|datacon|tyvar|tycon}/toList[/START/END]
2525
2626instance Symbol Hs. Entity where
27- toSymbol = toSymbolPredicate
27+ toSymbol (Hs. Entity_name x) = toSymbolPredicate x
28+ toSymbol (Hs. Entity_mod x) = toSymbolPredicate x
29+ toSymbol _ = error " toSymbol: unknown Hs.Entity"
2830
2931instance Symbol Hs. Name_key where
3032 toSymbol (Hs. Name_key occ mod sort) = do
@@ -66,12 +68,15 @@ instance Symbol Hs.NameSort where
6668 toSymbol Hs. NameSort_external {} = return []
6769 toSymbol (Hs. NameSort_internal (Src. ByteSpan start end)) =
6870 return [showt (Glean. fromNat start), showt (Glean. fromNat end)]
71+ toSymbol _ = error " toSymbol: unknown Hs.NameSort"
6972
7073instance ToQName Hs. Entity where
71- toQName n = Glean. keyOf n >>= toQName
74+ toQName (Hs. Entity_name n) = Glean. keyOf n >>= toQName
75+ toQName (Hs. Entity_mod _) = error " TODO: ToQName Hs.Entity_mod"
76+ toQName _ = error " ToQName: unknown Hs.Entity"
7277
7378instance ToQName Hs. Name_key where
74- toQName (Hs. Name_key occ mod sort ) = do
79+ toQName (Hs. Name_key occ mod _sort ) = do
7580 Hs. Module_key m _ <- Glean. keyOf mod
7681 modname <- Glean. keyOf m
7782 Hs. OccName_key n _ <- Glean. keyOf occ
0 commit comments