Repository navigation
Refresh no-input diagnostics when wildcard files change - #64717
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Jake Bailey (jakebailey) wants to merge 2 commits into
Conversation
Changing the set of wildcard-matched sources can leave the no-inputs error missing or stale. Cover both directions in ordinary and build watch mode before correcting the cached config diagnostics.
Watch sessions must report the same config errors as a fresh parse when sources appear or disappear. Recompute the no-inputs error on filename reload without mutating the earlier config snapshot or other errors.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Empty config files still lose TS18003 after wildcard file reloads because their raw value fails the map assertion.
1 open finding
What changed in this PR
Refreshes TS18003 diagnostics when wildcard-matched files are added or removed during watch mode.
Changes:
- Recomputes no-input diagnostics when reloading file names.
- Adds unit and watch-mode coverage.
- Updates watch baselines.
| File | Description |
|---|---|
tsc/internal/tsoptions/tsconfigparsing.go |
Extracts no-input diagnostic creation. |
tsc/internal/tsoptions/parsedcommandline.go |
Refreshes TS18003 during file reloads. |
tsc/internal/tsoptions/parsedcommandline_test.go |
Tests diagnostic transitions. |
tsc/internal/execute/tsctests/tscwatch_test.go |
Adds watch scenarios. |
tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-updates-no-inputs-diagnostics-build-false-initiallyEmpty-true.js |
Baselines initially empty watch behavior. |
tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-updates-no-inputs-diagnostics-build-false-initiallyEmpty-false.js |
Baselines initially populated watch behavior. |
tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js |
Records restored TS18003 parity. |
tsc/testdata/baselines/reference/tsbuildWatch/commandLineWatch/watch-updates-no-inputs-diagnostics-build-true-initiallyEmpty-true.js |
Baselines empty build-watch behavior. |
tsc/testdata/baselines/reference/tsbuildWatch/commandLineWatch/watch-updates-no-inputs-diagnostics-build-true-initiallyEmpty-false.js |
Baselines populated build-watch behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+516
to
+518
| if raw, ok := p.Raw.(*collections.OrderedMap[string, any]); ok && shouldReportNoInputFiles(fileNames, canJsonReportNoInputFiles(raw), nil) { | ||
| errors = append(errors, getErrorForNoInputFiles(p.getConfigFileSpecs(), p.ConfigFileName())) | ||
| } |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is one of the few "expected diffs", and can be fixed.
See second commit for the actual change.