@@ -66,6 +66,7 @@ import Unison.Codebase.Editor.HandleInput.FindAndReplace (handleStructuredFindI,
66
66
import Unison.Codebase.Editor.HandleInput.FormatFile qualified as Format
67
67
import Unison.Codebase.Editor.HandleInput.InstallLib (handleInstallLib )
68
68
import Unison.Codebase.Editor.HandleInput.Load (EvalMode (Sandboxed ), evalUnisonFile , handleLoad , loadUnisonFile )
69
+ import Unison.Codebase.Editor.HandleInput.Ls (handleLs )
69
70
import Unison.Codebase.Editor.HandleInput.Merge2 (handleMerge )
70
71
import Unison.Codebase.Editor.HandleInput.MoveAll (handleMoveAll )
71
72
import Unison.Codebase.Editor.HandleInput.MoveBranch (doMoveBranch )
@@ -347,7 +348,7 @@ loop e = do
347
348
Left hash -> (,WhichBranchEmptyHash hash) <$> Cli. resolveShortCausalHash hash
348
349
Right path' -> do
349
350
absPath <- ProjectUtils. branchRelativePathToAbsolute path'
350
- let srcp = Path. convert absPath
351
+ let srcp = Path. AbsolutePath' absPath
351
352
srcb <- Cli. expectBranchAtPath' srcp
352
353
pure (srcb, WhichBranchEmptyPath srcp)
353
354
description <- inputDescription input
@@ -465,7 +466,7 @@ loop e = do
465
466
Cli. respond $ Output. MarkdownOut (Text. intercalate " \n ---\n " mdText)
466
467
DocsToHtmlI namespacePath' sourceDirectory -> do
467
468
Cli. Env {codebase, sandboxedRuntime} <- ask
468
- absPath <- Cli. resolvePath' namespacePath'
469
+ absPath <- ProjectUtils. branchRelativePathToAbsolute namespacePath'
469
470
branch <- liftIO $ Codebase. getBranchAtPath codebase absPath
470
471
_evalErrs <- liftIO $ (Backend. docsInBranchToHtmlFiles sandboxedRuntime codebase branch sourceDirectory)
471
472
pure ()
@@ -487,11 +488,11 @@ loop e = do
487
488
hqLength <- Cli. runTransaction Codebase. hashLength
488
489
pure (DeleteNameAmbiguous hqLength name srcTerms Set. empty)
489
490
dest <- Cli. resolveSplit' dest'
490
- destTerms <- Cli. getTermsAt (Path. convert dest)
491
+ destTerms <- Cli. getTermsAt (HQ'. NameOnly <$> dest)
491
492
when (not (Set. null destTerms)) do
492
493
Cli. returnEarly (TermAlreadyExists dest' destTerms)
493
494
description <- inputDescription input
494
- Cli. stepAt description (BranchUtil. makeAddTermName (Path. convert dest) srcTerm)
495
+ Cli. stepAt description (BranchUtil. makeAddTermName (first Path. unabsolute dest) srcTerm)
495
496
Cli. respond Success
496
497
AliasTypeI src' dest' -> do
497
498
src <- traverseOf _Right Cli. resolveSplit' src'
@@ -510,11 +511,11 @@ loop e = do
510
511
hqLength <- Cli. runTransaction Codebase. hashLength
511
512
pure (DeleteNameAmbiguous hqLength name Set. empty srcTypes)
512
513
dest <- Cli. resolveSplit' dest'
513
- destTypes <- Cli. getTypesAt (Path. convert dest)
514
+ destTypes <- Cli. getTypesAt (HQ'. NameOnly <$> dest)
514
515
when (not (Set. null destTypes)) do
515
516
Cli. returnEarly (TypeAlreadyExists dest' destTypes)
516
517
description <- inputDescription input
517
- Cli. stepAt description (BranchUtil. makeAddTypeName (Path. convert dest) srcType)
518
+ Cli. stepAt description (BranchUtil. makeAddTypeName (first Path. unabsolute dest) srcType)
518
519
Cli. respond Success
519
520
520
521
-- this implementation will happily produce name conflicts,
@@ -616,9 +617,9 @@ loop e = do
616
617
guidPath <- Cli. resolveSplit' (authorPath' |> NameSegment. guidSegment)
617
618
Cli. stepManyAt
618
619
description
619
- [ BranchUtil. makeAddTermName (Path. convert authorPath) (d authorRef),
620
- BranchUtil. makeAddTermName (Path. convert copyrightHolderPath) (d copyrightHolderRef),
621
- BranchUtil. makeAddTermName (Path. convert guidPath) (d guidRef)
620
+ [ BranchUtil. makeAddTermName (first Path. unabsolute authorPath) (d authorRef),
621
+ BranchUtil. makeAddTermName (first Path. unabsolute copyrightHolderPath) (d copyrightHolderRef),
622
+ BranchUtil. makeAddTermName (first Path. unabsolute guidPath) (d guidRef)
622
623
]
623
624
currentPath <- Cli. getCurrentPath
624
625
finalBranch <- Cli. getCurrentBranch0
@@ -687,21 +688,7 @@ loop e = do
687
688
traverse_ (displayI outputLoc) namesToDisplay
688
689
ShowDefinitionI outputLoc showDefinitionScope query -> handleShowDefinition outputLoc showDefinitionScope query
689
690
EditNamespaceI paths -> handleEditNamespace LatestFileLocation paths
690
- FindShallowI pathArg -> do
691
- Cli. Env {codebase} <- ask
692
-
693
- pathArgAbs <- Cli. resolvePath' pathArg
694
- entries <- liftIO (Backend. lsAtPath codebase Nothing pathArgAbs)
695
- Cli. setNumberedArgs $ fmap (SA. ShallowListEntry pathArg) entries
696
- pped <- Cli. currentPrettyPrintEnvDecl
697
- let suffixifiedPPE = PPED. suffixifiedPPE pped
698
- -- This used to be a delayed action which only forced the loading of the root
699
- -- branch when it was necessary for printing the results, but that got wiped out
700
- -- when we ported to the new Cli monad.
701
- -- It would be nice to restore it, but it's pretty rare that it actually results
702
- -- in an improvement, so perhaps it's not worth the effort.
703
- let buildPPE = pure suffixifiedPPE
704
- Cli. respond $ ListShallow buildPPE entries
691
+ FindShallowI pathArg -> handleLs pathArg
705
692
FindI isVerbose fscope ws -> handleFindI isVerbose fscope ws input
706
693
StructuredFindI _fscope ws -> handleStructuredFindI ws
707
694
StructuredFindReplaceI ws -> handleStructuredFindReplaceI ws
@@ -1564,7 +1551,7 @@ checkDeletes typesTermsTuples doutput inputs = do
1564
1551
(Path. HQSplit' , Set Reference , Set Referent ) ->
1565
1552
Cli (Path. Split , Name , Set Reference , Set Referent )
1566
1553
toSplitName hq = do
1567
- resolvedPath <- Path. convert <$> Cli. resolveSplit' (HQ'. toName <$> hq ^. _1)
1554
+ resolvedPath <- first Path. unabsolute <$> Cli. resolveSplit' (HQ'. toName <$> hq ^. _1)
1568
1555
return (resolvedPath, Path. unsafeToName (Path. unsplit resolvedPath), hq ^. _2, hq ^. _3)
1569
1556
-- get the splits and names with terms and types
1570
1557
splitsNames <- traverse toSplitName typesTermsTuples
@@ -1711,7 +1698,7 @@ docsI src = do
1711
1698
(codebaseByName) Lastly check for `foo.doc` in the codebase and if found do `display foo.doc`
1712
1699
-}
1713
1700
dotDoc :: HQ. HashQualified Name
1714
- dotDoc = Name. convert . Name. joinDot src $ Name. fromSegment NameSegment. docSegment
1701
+ dotDoc = HQ. NameOnly . Name. joinDot src $ Name. fromSegment NameSegment. docSegment
1715
1702
1716
1703
findInScratchfileByName :: Cli ()
1717
1704
findInScratchfileByName = do
0 commit comments