Skip to content

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

Merged
merged 14 commits into from
Jul 8, 2025

Conversation

iisaduan
Copy link
Member

@iisaduan iisaduan commented Jun 23, 2025

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)

@iisaduan iisaduan marked this pull request as ready for review July 3, 2025 22:17
@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 22:17
Copy link
Contributor

@Copilot Copilot AI left a 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

Copy link
Member

@gabritto gabritto left a 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.

@iisaduan iisaduan changed the title [draft] find all references fourslash fourslash baselines and VerifyBaselinefindAllReferences Jul 4, 2025
Copy link
Member

@gabritto gabritto left a 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.

@iisaduan iisaduan added this pull request to the merge queue Jul 8, 2025
Merged via the queue into microsoft:main with commit 7347bf4 Jul 8, 2025
22 checks passed
@iisaduan iisaduan deleted the fourslash-baseline branch July 8, 2025 17:54
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.

3 participants