Skip to content

Implement MarkerNames() in fourslash #1450

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 7 commits into from
Jul 24, 2025
Merged

Implement MarkerNames() in fourslash #1450

merged 7 commits into from
Jul 24, 2025

Conversation

DanielRosenwasser
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 19:58
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

This PR implements the MarkerNames() method in the fourslash testing framework and enables several previously skipped tests related to "go to definition" functionality. The implementation extracts marker names from test data and integrates with the test conversion script to support the ...test.markerNames() pattern.

Key changes:

  • Adds MarkerNames() method to extract named markers from fourslash test data
  • Updates test conversion script to handle ...test.markerNames() expressions
  • Enables three previously skipped "go to definition" tests with proper marker name handling

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/fourslash/fourslash.go Implements MarkerNames() method using MapFiltered to extract marker names
internal/core/core.go Adds MapFiltered utility function for filtering and mapping slices
internal/fourslash/_scripts/convertFourslash.mts Updates conversion script to handle ...test.markerNames() expressions
internal/fourslash/tests/gen/*_test.go Removes t.Skip() calls and updates method calls to use f.MarkerNames()...
internal/fourslash/_scripts/failingTests.txt Removes three tests from the failing tests list
testdata/baselines/reference/fourslash//.baseline.jsonc New baseline files for enabled tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this change is sketchy - but I think it is possibly due to a bug in the baselining logic. My guess is that baselining is currently too eager. Any test that requests multiple baselines where an edit has occurred in between probably fails because any of the following might be true:

  1. the baselines were never accepted so the test could never succeed
  2. the second baseline call will always read the results of the first baseline, and is assumed to fail
  3. the second baseline was accepted, so the first call will always fail

@DanielRosenwasser DanielRosenwasser added this pull request to the merge queue Jul 24, 2025
Merged via the queue into main with commit 2e8b060 Jul 24, 2025
22 checks passed
@DanielRosenwasser DanielRosenwasser deleted the markerNames branch July 24, 2025 20:50
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.

4 participants