Skip to content

Fourslash conversion script improvements + fix #1503

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gabritto
Copy link
Member

@gabritto gabritto commented Aug 1, 2025

In this PR, changes to the conversion script:

  • Parsing and inlining variables from Strada fourslash tests. I still need to add parsing and conversion of array destructuring at some future point. This adds 31 tests.
  • Conversion of replacementSpan for completion items. This fixes 19 tests.
  • Fixed conversion of quick info args where we were using the expected text as the expected docs (my fault for missing this in the original PR 🙁).
  • Added the completion.globalThisEntry constant.

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 improves the fourslash test conversion script to better handle TypeScript test files. The changes enhance conversion accuracy by adding variable parsing/inlining, fixing completion item replacementSpan conversion, correcting quick info argument handling, and adding the completion.globalThisEntry constant.

  • Adds parsing and inlining of variables from Strada fourslash tests (31 new tests)
  • Fixes conversion of replacementSpan for completion items (19 test fixes)
  • Corrects quick info args conversion where expected text was incorrectly used as expected docs

Reviewed Changes

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

Show a summary per file
File Description
internal/fourslash/tests/gen/tripleSlashRefPathCompletionHiddenFile_test.go Adds TextEdit field with replacement range for completion item
internal/fourslash/tests/gen/syntheticImportFromBabelGeneratedFile2_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/syntheticImportFromBabelGeneratedFile1_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoTemplateTag_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoSpecialPropertyAssignment_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoPropertyTag_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoOnNewKeyword01_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoMappedType_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoJsDocTags2_test.go Removes test skip and fixes quick info expected documentation
internal/fourslash/tests/gen/quickInfoJsDocNonDiscriminatedUnionSharedProp_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoInJsdocInTsFile1_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoFromContextualType_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/quickInfoForDecorators_test.go Removes test skip and fixes quick info expected documentation
internal/fourslash/tests/gen/quickInfoCallProperty_test.go Removes test skip and fixes quick info expected documentation
internal/fourslash/tests/gen/protoVarInContextualObjectLiteral_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/memberListInsideObjectLiterals_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/letQuickInfoAndCompletionList_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/jsdocTypedefTag_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsQuickInfoGenerallyAcceptableSize_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocTagsWithHyphen_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription9_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription7_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription6_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription4_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription1_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocPropertyDescription11_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/jsDocInheritDoc_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/getJavaScriptQuickInfo7_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/getJavaScriptCompletions21_test.go Removes test skip and adds TextEdit field for completion item
internal/fourslash/tests/gen/constQuickInfoAndCompletionList_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/constEnumQuickInfoAndCompletionList_test.go Updates function name and test content, removes skip
internal/fourslash/tests/gen/completionsWithStringReplacementMode1_test.go Removes test skip and adds TextEdit fields for all completion items
internal/fourslash/tests/gen/completionsUniqueSymbol1_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionsTypeKeywords_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionsTuple_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionsTriggerCharacter_test.go Adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionsSymbolMembers_test.go Adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionsStringsWithTriggerCharacter_test.go Adds TextEdit fields for all completion items
internal/fourslash/tests/gen/completionsStringLiteral_fromTypeConstraint_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionsKeyof_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionsJsxAttributeInitializer2_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionsJsPropertyAssignment_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionsInExport_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionsInExport_moduleBlock_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionsImportOrExportSpecifier_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionsElementAccessNumeric_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionsAssertKeyword_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionOfAwaitPromise7_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionOfAwaitPromise5_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionOfAwaitPromise3_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionOfAwaitPromise2_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionOfAwaitPromise1_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionNoAutoInsertQuestionDotForTypeParameter_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionNoAutoInsertQuestionDotForThis_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionListInvalidMemberNames_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionListInvalidMemberNames_startWithSpace_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionListInvalidMemberNames_escapeQuote_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionListInExportClause01_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionListForObjectSpread_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionListAfterStringLiteralTypeWithNoSubstitutionTemplateLiteral_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionInfoWithExplicitTypeArguments_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionForStringLiteral_test.go Adds TextEdit fields for all completion items
internal/fourslash/tests/gen/completionForStringLiteral_quotePreference8_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral_quotePreference7_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral_quotePreference3_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral_quotePreference2_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral_mappedTypeMembers_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForStringLiteral_details_test.go Adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionForStringLiteralWithDynamicImport_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteralInIndexedAccess01_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForStringLiteralImport1_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteralFromSignature_test.go Removes test skip and adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteralExport_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral4_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/tests/gen/completionForStringLiteral3_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionForStringLiteral2_test.go Removes test skip and adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionForStringLiteral15_test.go Removes test skip and adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForStringLiteral14_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForStringLiteral12_test.go Removes test skip and adds TextEdit field for completion item
internal/fourslash/tests/gen/completionForQuotedPropertyInPropertyAssignment4_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForQuotedPropertyInPropertyAssignment3_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForQuotedPropertyInPropertyAssignment2_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForQuotedPropertyInPropertyAssignment1_test.go New generated test file from fourslash conversion
internal/fourslash/tests/gen/completionForComputedStringProperties_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/completionAutoInsertQuestionDot_test.go Adds TextEdit fields for completion items
internal/fourslash/tests/gen/completionAfterQuestionDot_test.go Adds TextEdit field for completion item
internal/fourslash/tests/gen/commentsUnion_test.go Fixes quick info expected documentation from repeated text to proper docs
internal/fourslash/tests/gen/argumentsAreAvailableAfterEditsAtEndOfFunction_test.go New generated test file from fourslash conversion (skipped)
internal/fourslash/_scripts/failingTests.txt Updates list of failing tests to reflect fixed tests

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