-
Notifications
You must be signed in to change notification settings - Fork 747
fix TS6053 missing file diagnostics to match tsc (#2081) #2096
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
fix TS6053 missing file diagnostics to match tsc (#2081) #2096
Conversation
internal/compiler/program_test.go
Outdated
| }) | ||
| } | ||
|
|
||
| func TestMissingReferenceFile(t *testing.T) { |
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.
No need for this; if you fixed the bug, the declarationEmitIndexTypeNotFound test should have been updated when you ran the tests.
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 have just fixed the bug, should i open a new pull request or just commit on this request?
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.
Just push to this one, please
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.
This is still an issue; the PR is not fixing the test I mentioned above
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.
In the last commit, I only made changes to loaderfile.go and program.go. I had previously added a new test (TestMissingReferenceFile), but it has been removed following the your guidance. Please let me know if I have misunderstood your point.
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.
If the fix in this PR worked, then the test case Ryan was showing, declarationEmitIndexTypeNotFound, would fail and ask you to update the baselines, and likely other tests. The fact that this PR contains code but no test baseline changes means the fix is not working.
Are you testing this some other way?
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.
Oh, got it! so if the bug is fixed, the tests are expected to fail and I need to update the baseline, right?
Previously, I ran a test locally for debugging and compiled an erroneous .ts file to check whether the error matched what tsc would produce. After that, I ran go test, which failed. I then code again to pass the test but forgot to manually verify it again, so I just realized that my last commit didn’t actually solve the issue.
Now I have fixed the bug again and I’ve updated the baseline, but it resulted in 64 changes, and I’m not sure how to verify whether the updated baseline is correct.
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.
It seems like an improvement with some regressions; if you view https://github.com/microsoft/typescript-go/pull/2096/files?file-filters%5B%5D=.go&file-filters%5B%5D=.diff (filtered to diffs), the goal would be to eliminate those by improving the fix.
Removed TestMissingReferenceFile due to changes in test structure.
|
Failed the tests, trying to resolve |
…ignatures are updated"
|
runner.go:131: Test when global file is added, the signatures are updated has unexpected diff Edit [3]:: Add new file and update main file Changes observed in incremental build: -src/main.ts:3:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found.
+src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found.
-3 /// <reference path="./fileNotFound.ts"/>
+2 /// <reference path="./fileNotFound.ts"/>
~~~~~~~~~~~~~~~~~
-Found 1 error in src/main.ts:3
+Found 1 error in src/anotherFileWithSameReferenes.ts:2 |
|
passed all the tests locally |
|
@jakebailey Please take a look. I'm still unsure whether the bug is actually fixed. When I compile with a not-found reference file, it behaves like tsc and the tests fail. After I accept the new baseline the tests pass, but no files are generated, and compiling with a not-found reference file still produces the same error as tsc. |
|
sorry it is not fixed yet |
…nNhatHan/typescript-go into fix-missing-file-diagnostics
|
I’ve come to realize this task is a bit beyond my current scope. I really appreciate all your help and feedback. I’ll close the pull request. |
|
I noticed that if a reference file is not found, only that error appears while other errors don’t, and some errors, like a file without an extension, are now reported as ‘file not found.’ Could this be because I called it too early? If this was fixed elsewhere, I’d appreciate it if you could let me know when. I’ve closed the PR but would like to understand how it was resolved. |
I tried to fix the bug, but I am unable to resolve the parentFile and textLoc for the Diagnostic (I did note by commenting). However, it now raises an error when reference directive file path doesn't exist.