@@ -2,7 +2,6 @@ package build
22
33import (
44 "fmt"
5- "slices"
65 "strings"
76 "sync"
87 "sync/atomic"
@@ -19,14 +18,6 @@ import (
1918 "github.com/microsoft/typescript-go/internal/tspath"
2019)
2120
22- type updateKind uint
23-
24- const (
25- updateKindNone updateKind = iota
26- updateKindConfig
27- updateKindUpdate
28- )
29-
3021type buildKind uint
3122
3223const (
@@ -70,11 +61,6 @@ type BuildTask struct {
7061 prevReporter * BuildTask
7162 reportDone chan struct {}
7263
73- // Watching things
74- configTime time.Time
75- extendedConfigTimes []time.Time
76- inputFiles []time.Time
77-
7864 buildInfoEntry * buildInfoEntry
7965 buildInfoEntryMu sync.Mutex
8066
@@ -710,14 +696,7 @@ func (t *BuildTask) cleanProjectOutput(orchestrator *Orchestrator, outputFile st
710696}
711697
712698func (t * BuildTask ) updateWatch (orchestrator * Orchestrator , oldCache * collections.SyncMap [tspath.Path , time.Time ]) {
713- t .configTime = orchestrator .host .loadOrStoreMTime (t .config , oldCache , false )
714699 if t .resolved != nil {
715- t .extendedConfigTimes = core .Map (t .resolved .ExtendedSourceFiles (), func (p string ) time.Time {
716- return orchestrator .host .loadOrStoreMTime (p , oldCache , false )
717- })
718- t .inputFiles = core .Map (t .resolved .FileNames (), func (p string ) time.Time {
719- return orchestrator .host .loadOrStoreMTime (p , oldCache , false )
720- })
721700 if t .canUpdateJsDtsOutputTimestamps () {
722701 for outputFile := range t .resolved .GetOutputFileNames () {
723702 orchestrator .host .storeMTimeFromOldCache (outputFile , oldCache )
@@ -737,45 +716,6 @@ func (t *BuildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) {
737716 orchestrator .host .resolvedReferences .delete (path )
738717}
739718
740- func (t * BuildTask ) hasUpdate (orchestrator * Orchestrator , path tspath.Path ) updateKind {
741- var needsConfigUpdate bool
742- var needsUpdate bool
743- if configTime := orchestrator .host .GetMTime (t .config ); configTime != t .configTime {
744- t .resetConfig (orchestrator , path )
745- needsConfigUpdate = true
746- }
747- if t .resolved != nil {
748- for index , file := range t .resolved .ExtendedSourceFiles () {
749- if orchestrator .host .GetMTime (file ) != t .extendedConfigTimes [index ] {
750- t .resetConfig (orchestrator , path )
751- needsConfigUpdate = true
752- }
753- }
754- for index , file := range t .resolved .FileNames () {
755- if orchestrator .host .GetMTime (file ) != t .inputFiles [index ] {
756- t .resetStatus ()
757- needsUpdate = true
758- }
759- }
760- if ! needsConfigUpdate {
761- configStart := orchestrator .opts .Sys .Now ()
762- newConfig := t .resolved .ReloadFileNamesOfParsedCommandLine (orchestrator .host .FS ())
763- configTime := orchestrator .opts .Sys .Now ().Sub (configStart )
764- // Make new channels if needed later
765- t .reportDone = make (chan struct {})
766- t .done = make (chan struct {})
767- if ! slices .Equal (t .resolved .FileNames (), newConfig .FileNames ()) {
768- orchestrator .host .resolvedReferences .store (path , newConfig )
769- orchestrator .host .configTimes .Store (path , configTime )
770- t .resolved = newConfig
771- t .resetStatus ()
772- needsUpdate = true
773- }
774- }
775- }
776- return core .IfElse (needsConfigUpdate , updateKindConfig , core .IfElse (needsUpdate , updateKindUpdate , updateKindNone ))
777- }
778-
779719func (t * BuildTask ) loadOrStoreBuildInfo (orchestrator * Orchestrator , configPath tspath.Path , buildInfoFileName string ) (* incremental.BuildInfo , time.Time ) {
780720 path := orchestrator .toPath (buildInfoFileName )
781721 t .buildInfoEntryMu .Lock ()
0 commit comments