@@ -194,6 +194,7 @@ func NewProject(name string, kind Kind, currentDirectory string, host ProjectHos
194
194
kind : kind ,
195
195
currentDirectory : currentDirectory ,
196
196
rootFileNames : & collections.OrderedMap [tspath.Path , string ]{},
197
+ dirty : true ,
197
198
}
198
199
project .comparePathsOptions = tspath.ComparePathsOptions {
199
200
CurrentDirectory : currentDirectory ,
@@ -490,7 +491,9 @@ func (p *Project) updateGraph() bool {
490
491
p .programConfig = nil
491
492
p .pendingReload = PendingReloadNone
492
493
case PendingReloadFull :
493
- if err := p .loadConfig (); err != nil {
494
+ var err error
495
+ writeFileNames , err = p .LoadConfig ()
496
+ if err != nil {
494
497
panic (fmt .Sprintf ("failed to reload config: %v" , err ))
495
498
}
496
499
}
@@ -865,15 +868,7 @@ func (p *Project) AddInferredProjectRoot(info *ScriptInfo) {
865
868
p .markAsDirtyLocked ()
866
869
}
867
870
868
- func (p * Project ) LoadConfig () error {
869
- if err := p .loadConfig (); err != nil {
870
- return err
871
- }
872
- p .markAsDirty ()
873
- return nil
874
- }
875
-
876
- func (p * Project ) loadConfig () error {
871
+ func (p * Project ) LoadConfig () (bool , error ) {
877
872
if p .kind != KindConfigured {
878
873
panic ("loadConfig called on non-configured project" )
879
874
}
@@ -906,13 +901,12 @@ func (p *Project) loadConfig() error {
906
901
p .parsedCommandLine = parsedCommandLine
907
902
p .compilerOptions = parsedCommandLine .CompilerOptions ()
908
903
p .typeAcquisition = parsedCommandLine .TypeAcquisition ()
909
- p .setRootFiles (parsedCommandLine .FileNames ())
904
+ return p .setRootFiles (parsedCommandLine .FileNames ()), nil
910
905
} else {
911
906
p .compilerOptions = & core.CompilerOptions {}
912
907
p .typeAcquisition = nil
913
- return fmt .Errorf ("could not read file %q" , p .configFileName )
908
+ return false , fmt .Errorf ("could not read file %q" , p .configFileName )
914
909
}
915
- return nil
916
910
}
917
911
918
912
// setRootFiles returns true if the set of root files has changed.
0 commit comments