Skip to content

Add unsorted expected completions #1351

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 1 commit into from
Jul 2, 2025
Merged

Add unsorted expected completions #1351

merged 1 commit into from
Jul 2, 2025

Conversation

gabritto
Copy link
Member

@gabritto gabritto commented Jul 2, 2025

Adds the unsorted option to expected completion lists in fourslash, and correspondingly in the conversion script.
15 new tests, 5 of which are skipped due to failing.

@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 18:05
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 introduces support for an Unsorted completion expectation in Fourslash tests and updates the conversion script to both parse and generate code for the new unsorted property.

  • Adds a new Unsorted []CompletionsExpectedItem field and verification path in internal/fourslash/fourslash.go
  • Imports maps and slices for unsorted-item handling
  • Updates convertFourslash.mts to recognize, parse, and emit the unsorted argument
  • Adds 15 new Fourslash test files using Unsorted (5 are skipped due to current failures)

Reviewed Changes

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

File Description
internal/fourslash/fourslash.go Added Unsorted field and its verification logic
internal/fourslash/_scripts/convertFourslash.mts Parses and generates the unsorted property in conversion script
internal/fourslash/_scripts/failingTests.txt Marks newly added tests (with Unsorted) as failing/skipped
internal/fourslash/tests/gen/* New Fourslash tests exercising the Unsorted option
Comments suppressed due to low confidence (1)

internal/fourslash/_scripts/convertFourslash.mts:392

  • Make this fallback branch explicit for unsorted only (e.g. else if (propName === "unsorted")) and add a default case afterward to throw an error on unknown properties instead of silently treating them as unsorted.
                else {

@gabritto gabritto enabled auto-merge July 2, 2025 18:41
@gabritto gabritto added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit fdf79f0 Jul 2, 2025
39 of 41 checks passed
@gabritto gabritto deleted the gabritto/unsorted branch July 2, 2025 18:57
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