MCPcopy Create free account
hub / github.com/microsoft/typescript-go / recheckTsConfig

Method recheckTsConfig

internal/execute/watcher.go:384–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

382}
383
384func (w *Watcher) recheckTsConfig() bool {
385 if w.configFileName == "" {
386 return false
387 }
388
389 if !w.configHasErrors && len(w.configFilePaths) > 0 {
390 changed := false
391 for _, path := range w.configFilePaths {
392 oldMtime, ok := w.configMtimes[path]
393 s := w.sys.FS().Stat(path)
394 if !ok {
395 if s != nil {
396 changed = true
397 break
398 }
399 } else if s == nil || !s.ModTime().Equal(oldMtime) {
400 changed = true
401 break
402 }
403 }
404 if !changed {
405 return false
406 }
407 }
408
409 configParseResult := w.parseConfigFile()
410 if configParseResult == nil {
411 return true
412 }
413 if w.configHasErrors {
414 w.configModified = true
415 }
416 w.configHasErrors = false
417 w.configFilePaths = append([]string{w.configFileName}, configParseResult.ExtendedSourceFiles()...)
418 if !reflect.DeepEqual(w.config.ParsedConfig, configParseResult.ParsedConfig) {
419 w.configModified = true
420 }
421 w.config = configParseResult
422 return false
423}
424
425func (w *Watcher) parseConfigFile() *tsoptions.ParsedCommandLine {
426 extendedConfigCache := &tsc.ExtendedConfigCache{}

Callers 1

DoCycleMethod · 0.95

Calls 8

parseConfigFileMethod · 0.95
lenFunction · 0.85
EqualMethod · 0.80
ModTimeMethod · 0.80
ExtendedSourceFilesMethod · 0.80
StatMethod · 0.65
FSMethod · 0.65
appendFunction · 0.50

Tested by

no test coverage detected