-
Notifications
You must be signed in to change notification settings - Fork 644
Do not create SourceFiles for non-existent files #1148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents the creation of SourceFiles for files that do not exist by adding an existence check before proceeding with file processing. Key changes include:
- Returning nil instead of a SourceFile in both internal/testutil/harnessutil/harnessutil.go and internal/compiler/host.go when the file isn't found.
- Updating baseline test files by removing redundant or extraneous marker lines.
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
testdata/baselines/reference/submodule/conformance/parserRealSource10.js.diff | Adjusted skipped-lines markers and removed an extra marker. |
testdata/baselines/reference/submodule/conformance/parserRealSource10.js | Removed an unwanted marker line. |
testdata/baselines/reference/submodule/conformance/parserRealSource1.js.diff | Removed baseline markers and updated skipped-lines counts. |
testdata/baselines/reference/submodule/conformance/parserRealSource1.js | Removed an unwanted marker line. |
testdata/baselines/reference/submodule/compiler/selfReferencingFile2.js.diff | Removed duplicated marker line. |
testdata/baselines/reference/submodule/compiler/selfReferencingFile2.js | Removed duplicated marker line. |
testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.js.diff | Removed an unnecessary reference comment and marker. |
testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.js | Removed an unnecessary marker line. |
testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.js.diff | Removed test lines associated with non-existent references. |
testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.js | Removed test lines associated with non-existent references. |
testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.js.diff | Adjusted reference comment and removed redundant marker. |
testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.js | Removed redundant marker line. |
testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.js.diff | Adjusted reference comment and removed redundant marker. |
testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.js | Removed redundant marker line. |
testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.js.diff | Removed extraneous marker lines from reference tests. |
testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.js | Removed extraneous marker lines from reference tests. |
testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.js.diff | Removed extraneous marker lines from reference tests. |
testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.js | Removed extraneous marker lines from reference tests. |
internal/testutil/harnessutil/harnessutil.go | Added a file existence check to avoid creating a SourceFile for non-existent files. |
internal/compiler/host.go | Added a file existence check to avoid creating a SourceFile for non-existent files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had done this change in #1078 where some of my changes werent working properly because of this
CI race failure is #1151. |
Noticed this while working on another PR. We were treating all not-found files as empty.
Perhaps this is just papering over some places we don't precheck that a file exists?No, Strada hadgetSourceFile(...): SourceFile | undefined
.