debugging

This commit is contained in:
Paul Chiusano 2021-07-14 00:21:38 -04:00
parent fa88db9dda
commit ffbfa7ba81

View File

@ -653,11 +653,13 @@ prettyDefinitionsBySuffixes relativeTo root renderWidth suffixifyBindings rt cod
-- rs0 can be empty or the term fetched, so when viewing a doc term -- rs0 can be empty or the term fetched, so when viewing a doc term
-- you get both its source and its rendered form -- you get both its source and its rendered form
docResults :: [Reference] -> [Name] -> Backend IO [(HashQualifiedName, UnisonHash, Doc.Doc)] docResults :: [Reference] -> [Name] -> Backend IO [(HashQualifiedName, UnisonHash, Doc.Doc)]
docResults rs0 docs = fmap join . for docs $ \name -> do docResults rs0 docs = do
-- resolve each name to (0 or more) references let refsFor n = Names3.lookupHQTerm (HQ.NameOnly n) parseNames
rs <- pure . Set.toList $ Names3.lookupHQTerm (HQ.NameOnly name) parseNames let rs = Set.unions (refsFor <$> docs) <> Set.fromList (Referent.Ref <$> rs0)
traceM $ "rs: " <> show rs
-- lookup the type of each, make sure it's a doc -- lookup the type of each, make sure it's a doc
docs <- selectDocs (map Referent.Ref rs0 <> rs) docs <- selectDocs (toList rs)
traceM $ "docs 2: " <> show docs
-- render all the docs -- render all the docs
join <$> traverse renderDoc docs join <$> traverse renderDoc docs