@@ -33,7 +33,6 @@ import Unison.Codebase.Path qualified as Path
3333import Unison.ConstructorReference qualified as ConstructorReference
3434import Unison.DataDeclaration qualified as DD
3535import Unison.DataDeclaration.Dependencies qualified as DD
36- import Unison.Debug qualified as Debug
3736import Unison.HashQualified qualified as HQ
3837import Unison.HashQualifiedPrime qualified as HQ'
3938import Unison.LabeledDependency qualified as LD
@@ -96,7 +95,6 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
9695 go = do
9796 rootBranchNamespaceHashId <- CausalQ. expectNamespaceIdsByCausalIdsOf id rootCausalId
9897 (namesPerspective, query) <- NameLookupOps. relocateToNameRoot perspective perspectiveQuery rootBranchNamespaceHashId
99- Debug. debugM Debug. Server " definitionForHQName: (namesPerspective, query)" (namesPerspective, query)
10098 -- Bias towards both relative and absolute path to queries,
10199 -- This allows us to still bias towards definitions outside our namesRoot but within the
102100 -- same tree;
@@ -108,17 +106,14 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
108106 let ppedBuilder deps = (PPED. biasTo biases) <$> lift (PPEPostgres. ppedForReferences namesPerspective deps)
109107 let nameSearch = PGNameSearch. nameSearchForPerspective namesPerspective
110108 dr@ (Backend. DefinitionResults terms types misses) <- mkDefinitionsForQuery nameSearch [query]
111- Debug. debugM Debug. Server " definitionForHQName: found definitions" dr
112109 let width = mayDefaultWidth renderWidth
113110 let docResults :: Name -> Codebase. CodebaseM e [(HashQualifiedName , UnisonHash , Doc. Doc )]
114111 docResults name = do
115- Debug. debugM Debug. Server " definitionForHQName: looking up docs for name" name
116112 -- We need to re-lookup the names perspective here because the name we've found
117113 -- may now be in a lib.
118114 namesPerspective <- NameLookupOps. namesPerspectiveForRootAndPath rootBranchNamespaceHashId (NL. nameToPathSegments name)
119115 let nameSearch = PGNameSearch. nameSearchForPerspective namesPerspective
120116 docRefs <- Docs. docsForDefinitionName nameSearch name
121- Debug. debugM Debug. Server " definitionForHQName: Found these docs" docRefs
122117 renderDocRefs ppedBuilder width rt docRefs
123118
124119 let drDeps = Backend. definitionResultsDependencies dr
@@ -127,14 +122,12 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
127122 typeDefinitions <-
128123 ifor (Backend. typesToSyntaxOf suffixifyBindings width termAndTypePPED (Map. asList_ . traversed) types) \ ref tp -> do
129124 let hqTypeName = PPE. typeNameOrHashOnly fqnTermAndTypePPE ref
130- Debug. debugM Debug. Temp " definitionForHQName: hqTypeName " (ref, hqTypeName)
131125 docs <- maybe (pure [] ) docResults (HQ. toName hqTypeName)
132126 lift $ Backend. mkTypeDefinition termAndTypePPED width ref docs tp
133127 termDefinitions <-
134128 ifor (Backend. termsToSyntaxOf suffixifyBindings width termAndTypePPED (Map. asList_ . traversed) terms) \ reference trm -> do
135129 let referent = Referent. Ref reference
136130 let hqTermName = PPE. termNameOrHashOnly fqnTermAndTypePPE referent
137- Debug. debugM Debug. Temp " definitionForHQName: hqTermName " (reference, hqTermName)
138131 docs <- maybe (pure [] ) docResults (HQ. toName hqTermName)
139132 Backend. mkTermDefinition termAndTypePPED width reference docs trm
140133 let renderedDisplayTerms = Map. mapKeys Reference. toText termDefinitions
0 commit comments