Skip to content

Conversation

@TranNhatHan
Copy link

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.

})
}

func TestMissingReferenceFile(t *testing.T) {
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Author

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.

Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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.

@TranNhatHan
Copy link
Author

Failed the tests, trying to resolve

@TranNhatHan
Copy link
Author

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

@TranNhatHan
Copy link
Author

passed all the tests locally

@TranNhatHan TranNhatHan changed the title fix (unfinished) TS6053 missing file diagnostics to match tsc (#2081) fix TS6053 missing file diagnostics to match tsc (#2081) Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants