delete LoadWatches command

This commit is contained in:
Mitchell Rosen 2022-07-19 12:20:36 -04:00
parent fe589400bc
commit aca371e523
5 changed files with 12 additions and 9 deletions

View File

@ -71,6 +71,7 @@ dependencies:
- vector
- wai
- warp
- witherable
library:
source-dirs: src

View File

@ -160,8 +160,6 @@ data
Command i v (Either Runtime.Error (EvalResult v))
-- Evaluate a single closed definition
Evaluate1 :: Bool -> PPE.PrettyPrintEnv -> UseCache -> Term v Ann -> Command i v (Either Runtime.Error (Term v Ann))
-- Loads any cached watches of the given kind
LoadWatches :: WK.WatchKind -> Set Reference -> Command i v [(Reference, Term v Ann)]
-- Merge two branches, using the codebase for the LCA calculation where possible.
Merge :: Branch.MergeMode -> Branch IO -> Branch IO -> Command i v (Branch IO)
ViewRemoteGitBranch ::
@ -240,7 +238,6 @@ commandName = \case
TypecheckFile {} -> "TypecheckFile"
Evaluate {} -> "Evaluate"
Evaluate1 {} -> "Evaluate1"
LoadWatches {} -> "LoadWatches"
Merge {} -> "Merge"
ViewRemoteGitBranch {} -> "ViewRemoteGitBranch"
SyncLocalRootBranch {} -> "SyncLocalRootBranch"

View File

@ -156,11 +156,6 @@ commandLine config awaitInput setBranchRef rt sdbxRt notifyUser notifyNumbered l
-- abstraction.
toIO <- UnliftIO.askRunInIO
lift $ Codebase.viewRemoteBranch codebase ns gitBranchBehavior (toIO . Free.fold go . action)
LoadWatches kind rs -> lift $ catMaybes <$> traverse go (toList rs)
where
go (Reference.Builtin _) = pure Nothing
go r@(Reference.DerivedId rid) =
fmap (r,) <$> Codebase.getWatch codebase kind rid
-- all builtin and derived type references
TypeReferencesByShortHash sh ->
lift $ Backend.typeReferencesByShortHash codebase sh

View File

@ -182,6 +182,7 @@ import Unison.Util.TransitiveClosure (transitiveClosure)
import Unison.Var (Var)
import qualified Unison.Var as Var
import qualified Unison.WatchKind as WK
import Witherable (wither)
defaultPatchNameSegment :: NameSegment
defaultPatchNameSegment = "patch"
@ -2071,7 +2072,11 @@ handleTest TestInput {includeLibNamespace, showFailures, showSuccesses} = do
Term.App' (Term.Constructor' (ConstructorReference ref cid)) (Term.Text' msg) <- toList ts,
cid == DD.failConstructorId && ref == DD.testResultRef
]
cachedTests <- fmap Map.fromList . eval $ LoadWatches WK.TestWatch testRefs
cachedTests <- do
fmap Map.fromList do
Set.toList testRefs & wither \case
Reference.Builtin _ -> pure Nothing
r@(Reference.DerivedId rid) -> liftIO (fmap (r,) <$> Codebase.getWatch codebase WK.TestWatch rid)
let stats = Output.CachedTests (Set.size testRefs) (Map.size cachedTests)
names <-
makePrintNamesFromLabeled' $

View File

@ -154,6 +154,7 @@ library
, vector
, wai
, warp
, witherable
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
if !os(windows)
@ -260,6 +261,7 @@ executable cli-integration-tests
, vector
, wai
, warp
, witherable
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
default-language: Haskell2010
@ -360,6 +362,7 @@ executable transcripts
, vector
, wai
, warp
, witherable
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
default-language: Haskell2010
@ -465,6 +468,7 @@ executable unison
, vector
, wai
, warp
, witherable
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
default-language: Haskell2010
@ -574,6 +578,7 @@ test-suite cli-tests
, vector
, wai
, warp
, witherable
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
default-language: Haskell2010