Skip to content

Commit

Permalink
Remove a bunch of old debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Feb 14, 2025
1 parent b84dc2e commit cc99032
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/Share/Web/UCM/SyncV2/Impl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import Share.Web.UCM.Sync.HashJWT qualified as HashJWT
import Share.Web.UCM.SyncV2.Queries qualified as SSQ
import Share.Web.UCM.SyncV2.Types (IsCausalSpine (..), IsLibRoot (..))
import U.Codebase.Sqlite.Orphans ()
import Unison.Debug qualified as Debug
import Unison.Hash32 (Hash32)
import Unison.Share.API.Hash (HashJWTClaims (..))
import Unison.SyncV2.API qualified as SyncV2
Expand Down Expand Up @@ -112,11 +111,8 @@ causalDependenciesStreamImpl mayCallerUserId (SyncV2.CausalDependenciesRequest {
Logging.logInfoText "Starting causal dependencies stream"
Codebase.runCodebaseTransaction codebase $ do
(_bhId, causalId) <- CausalQ.expectCausalIdsOf id (hash32ToCausalHash causalHash)
Debug.debugLogM Debug.Temp "Getting cursor"
cursor <- SSQ.spineAndLibDependenciesOfCausalCursor causalId
Debug.debugLogM Debug.Temp "Folding cursor"
Cursor.foldBatched cursor batchSize \batch -> do
Debug.debugLogM Debug.Temp "Got batch"
let depBatch =
batch <&> \(causalHash, isCausalSpine, isLibRoot) ->
let dependencyType = case (isCausalSpine, isLibRoot) of
Expand Down
7 changes: 0 additions & 7 deletions src/Unison/Server/Share/Definitions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import Unison.Codebase.Path qualified as Path
import Unison.ConstructorReference qualified as ConstructorReference
import Unison.DataDeclaration qualified as DD
import Unison.DataDeclaration.Dependencies qualified as DD
import Unison.Debug qualified as Debug
import Unison.HashQualified qualified as HQ
import Unison.HashQualifiedPrime qualified as HQ'
import Unison.LabeledDependency qualified as LD
Expand Down Expand Up @@ -96,7 +95,6 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
go = do
rootBranchNamespaceHashId <- CausalQ.expectNamespaceIdsByCausalIdsOf id rootCausalId
(namesPerspective, query) <- NameLookupOps.relocateToNameRoot perspective perspectiveQuery rootBranchNamespaceHashId
Debug.debugM Debug.Server "definitionForHQName: (namesPerspective, query)" (namesPerspective, query)
-- Bias towards both relative and absolute path to queries,
-- This allows us to still bias towards definitions outside our namesRoot but within the
-- same tree;
Expand All @@ -108,17 +106,14 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
let ppedBuilder deps = (PPED.biasTo biases) <$> lift (PPEPostgres.ppedForReferences namesPerspective deps)
let nameSearch = PGNameSearch.nameSearchForPerspective namesPerspective
dr@(Backend.DefinitionResults terms types misses) <- mkDefinitionsForQuery nameSearch [query]
Debug.debugM Debug.Server "definitionForHQName: found definitions" dr
let width = mayDefaultWidth renderWidth
let docResults :: Name -> Codebase.CodebaseM e [(HashQualifiedName, UnisonHash, Doc.Doc)]
docResults name = do
Debug.debugM Debug.Server "definitionForHQName: looking up docs for name" name
-- We need to re-lookup the names perspective here because the name we've found
-- may now be in a lib.
namesPerspective <- NameLookupOps.namesPerspectiveForRootAndPath rootBranchNamespaceHashId (NL.nameToPathSegments name)
let nameSearch = PGNameSearch.nameSearchForPerspective namesPerspective
docRefs <- Docs.docsForDefinitionName nameSearch name
Debug.debugM Debug.Server "definitionForHQName: Found these docs" docRefs
renderDocRefs ppedBuilder width rt docRefs

let drDeps = Backend.definitionResultsDependencies dr
Expand All @@ -127,14 +122,12 @@ definitionForHQName perspective rootCausalId renderWidth suffixifyBindings rt pe
typeDefinitions <-
ifor (Backend.typesToSyntaxOf suffixifyBindings width termAndTypePPED (Map.asList_ . traversed) types) \ref tp -> do
let hqTypeName = PPE.typeNameOrHashOnly fqnTermAndTypePPE ref
Debug.debugM Debug.Temp "definitionForHQName: hqTypeName " (ref, hqTypeName)
docs <- maybe (pure []) docResults (HQ.toName hqTypeName)
lift $ Backend.mkTypeDefinition termAndTypePPED width ref docs tp
termDefinitions <-
ifor (Backend.termsToSyntaxOf suffixifyBindings width termAndTypePPED (Map.asList_ . traversed) terms) \reference trm -> do
let referent = Referent.Ref reference
let hqTermName = PPE.termNameOrHashOnly fqnTermAndTypePPE referent
Debug.debugM Debug.Temp "definitionForHQName: hqTermName " (reference, hqTermName)
docs <- maybe (pure []) docResults (HQ.toName hqTermName)
Backend.mkTermDefinition termAndTypePPED width reference docs trm
let renderedDisplayTerms = Map.mapKeys Reference.toText termDefinitions
Expand Down

0 comments on commit cc99032

Please sign in to comment.