-
Notifications
You must be signed in to change notification settings - Fork 659
fourslash baselines and VerifyBaselinefindAllReferences
#1274
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
…o fourslash-baseline
…o fourslash-baseline
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
Adds a comprehensive suite of draft “find all references” tests to the fourslash harness, covering TSX, runtime imports, JS exports, and many language constructs.
- Introduces TSX-specific findAllReferences test (
tsxFindAllReferences10_test.go
). - Adds path-mapped tslib import reference tests and JS export rename tests.
- Generates dozens of new tests under
internal/fourslash/tests/gen/
to exercise edge cases.
Reviewed Changes
Copilot reviewed 300 out of 595 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
internal/fourslash/tests/gen/tsxFindAllReferences10_test.go | Add TSX component findAllReferences baseline test |
internal/fourslash/tests/gen/tslibFindAllReferencesOnRuntimeImportWithPaths1_test.go | Add findAllReferences test for tslib imports with custom paths |
internal/fourslash/tests/gen/renameJsExports03_test.go | Add JS export renaming reference test |
internal/fourslash/tests/gen/renameJsExports02_test.go | Add second JS export rename test |
internal/fourslash/tests/gen/remoteGetReferences_test.go | Add remote reference resolution tests |
internal/fourslash/tests/gen/referencesToStringLiteralValue_test.go | Add string-literal reference tests |
... | Many additional generated tests covering properties, keywords, merges, modules, enums, JSX, JSDoc, and more |
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.
Some minor comments (mostly about recent updates I made that may conflict, sorry) and a question, but in general looks good.
testdata/baselines/reference/fourslash/findAllRef/AmbientShorthandFindAllRefs.baseline.jsonc
Show resolved
Hide resolved
VerifyBaselinefindAllReferences
…o fourslash-baseline
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 think tests need to be re-generated, but this looks good.
Ports most of the baselining for fourslash (the functions that format FS content with range and location markers). There are features I did not port because they were not used in the baselines that I was porting/the functions I know that are planned on be ported pretty directly. I'm leaving those features unimplemented for now in case they are used differently/no longer used
Also adds
VerifyBaselineFindAllReferences
as an example of how to use the new baseline. These tests aren't being run against the submodule yet, they are just a standard "has the baseline changed" test. Not sure if we will eventually make these run against the submodule, since in corsa we currently only compute the locations of references so most of the stuff that is in the strada baseline (the json structures) is no longer computed. There are also some known bugs in what's currently implemented in FAR (see #1342)