Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion internal/checker/nodecopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,15 @@ func getExistingNodeTreeVisitor(b *NodeBuilderImpl, bound *recoveryBoundary) *as
if specifier != originalSpec {
arg = factory.NewLiteralTypeNode(specifier)
}
originalQualifier := node.AsImportTypeNode().Qualifier
qualifier := visitor.VisitNode(originalQualifier)
b.copyImportTypeQualifierSymbol(originalQualifier, qualifier)
return factory.UpdateImportTypeNode(
node.AsImportTypeNode(),
node.AsImportTypeNode().IsTypeOf,
arg,
visitor.VisitNode(node.AsImportTypeNode().Attributes),
visitor.VisitNode(node.AsImportTypeNode().Qualifier),
qualifier,
visitor.VisitNodes(node.AsImportTypeNode().TypeArguments),
)
}
Expand Down Expand Up @@ -872,3 +875,14 @@ func getExistingNodeTreeVisitor(b *NodeBuilderImpl, bound *recoveryBoundary) *as
})
return visitor
}

func (b *NodeBuilderImpl) copyImportTypeQualifierSymbol(node *ast.Node, qualifier *ast.Node) {
if node == nil || qualifier == nil {
return
}
symbol := b.ch.symbolNodeLinks.Get(ast.GetFirstIdentifier(node)).resolvedSymbol
if symbol == nil {
return
}
b.idToSymbol[ast.GetFirstIdentifier(qualifier)] = symbol
}
287 changes: 212 additions & 75 deletions internal/fourslash/_scripts/convertFourslash.mts

Large diffs are not rendered by default.

59 changes: 0 additions & 59 deletions internal/fourslash/_scripts/failingTests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ TestAmbientShorthandGotoDefinition
TestArgumentsAreAvailableAfterEditsAtEndOfFunction
TestAugmentedTypesClass1
TestAutoImportAllowImportingTsExtensionsPackageJsonImports1
TestAutoImportCompletionAmbientMergedModule1
TestAutoImportCompletionExportListAugmentation1
TestAutoImportCompletionExportListAugmentation2
TestAutoImportCompletionExportListAugmentation3
TestAutoImportCompletionExportListAugmentation4
TestAutoImportCrossProject_symlinks_stripSrc
TestAutoImportCrossProject_symlinks_toDist
TestAutoImportFileExcludePatterns10
Expand Down Expand Up @@ -90,32 +85,24 @@ TestCommentsLinePreservation
TestCommentsOverloadsFourslash
TestCommentsVariables
TestCompletionAfterQuestionDot
TestCompletionAutoInsertQuestionDot
TestCompletionCloneQuestionToken
TestCompletionEntryClassMembersWithInferredFunctionReturnType1
TestCompletionEntryForArgumentConstrainedToString
TestCompletionEntryForArrayElementConstrainedToString
TestCompletionEntryForArrayElementConstrainedToString2
TestCompletionEntryForUnionProperty
TestCompletionEntryForUnionProperty2
TestCompletionForComputedStringProperties
TestCompletionForMetaProperty
TestCompletionForObjectProperty
TestCompletionForStringLiteral
TestCompletionForStringLiteral_quotePreference
TestCompletionForStringLiteral_quotePreference1
TestCompletionForStringLiteral_quotePreference2
TestCompletionForStringLiteral_quotePreference3
TestCompletionForStringLiteral_quotePreference4
TestCompletionForStringLiteral_quotePreference5
TestCompletionForStringLiteral_quotePreference6
TestCompletionForStringLiteral_quotePreference7
TestCompletionForStringLiteral_quotePreference8
TestCompletionForStringLiteral4
TestCompletionImportMeta
TestCompletionImportMetaWithGlobalDeclaration
TestCompletionImportModuleSpecifierEndingUnsupportedExtension
TestCompletionInChecks1
TestCompletionInFunctionLikeBody_includesPrimitiveTypes
TestCompletionInUncheckedJSFile
TestCompletionListBuilderLocations_VariableDeclarations
Expand All @@ -136,31 +123,18 @@ TestCompletionListInUnclosedTaggedTemplate02
TestCompletionListInUnclosedTemplate01
TestCompletionListInUnclosedTemplate02
TestCompletionListInvalidMemberNames
TestCompletionListInvalidMemberNames_escapeQuote
TestCompletionListInvalidMemberNames_startWithSpace
TestCompletionListInvalidMemberNames_withExistingIdentifier
TestCompletionListInvalidMemberNames2
TestCompletionListOnAliases
TestCompletionListsStringLiteralTypeAsIndexedAccessTypeObject
TestCompletionListStringParenthesizedExpression
TestCompletionListStringParenthesizedType
TestCompletionListWithoutVariableinitializer
TestCompletionNoAutoInsertQuestionDotForThis
TestCompletionNoAutoInsertQuestionDotForTypeParameter
TestCompletionNoAutoInsertQuestionDotWithUserPreferencesOff
TestCompletionOfAwaitPromise1
TestCompletionOfAwaitPromise2
TestCompletionOfAwaitPromise3
TestCompletionOfAwaitPromise5
TestCompletionOfAwaitPromise6
TestCompletionOfAwaitPromise7
TestCompletionOfInterfaceAndVar
TestCompletionPreferredSuggestions1
TestCompletionsBeforeRestArg1
TestCompletionsClassMemberImportTypeNodeParameter1
TestCompletionsClassMemberImportTypeNodeParameter2
TestCompletionsClassMemberImportTypeNodeParameter3
TestCompletionsClassMemberImportTypeNodeParameter4
TestCompletionsElementAccessNumeric
TestCompletionsExportImport
TestCompletionsImport_default_anonymous
Expand Down Expand Up @@ -189,27 +163,12 @@ TestCompletionsLiteralFromInferenceWithinInferredType3
TestCompletionsLiterals
TestCompletionsMergedDeclarations1
TestCompletionsNewTarget
TestCompletionsOptionalMethod
TestCompletionsOverridingMethod1
TestCompletionsOverridingMethod10
TestCompletionsOverridingMethod11
TestCompletionsOverridingMethod14
TestCompletionsOverridingMethod17
TestCompletionsOverridingMethod2
TestCompletionsOverridingMethod3
TestCompletionsOverridingMethod4
TestCompletionsOverridingMethod9
TestCompletionsOverridingMethodCrash1
TestCompletionsOverridingProperties1
TestCompletionsRecommended_namespace
TestCompletionsRecommended_union
TestCompletionsRedeclareModuleAsGlobal
TestCompletionsStringsWithTriggerCharacter
TestCompletionsSymbolMembers
TestCompletionsTriggerCharacter
TestCompletionsTuple
TestCompletionsUniqueSymbol_import
TestCompletionsUniqueSymbol1
TestCompletionsWithDeprecatedTag10
TestConstQuickInfoAndCompletionList
TestContextuallyTypedFunctionExpressionGeneric1
Expand Down Expand Up @@ -275,18 +234,8 @@ TestImportNameCodeFixNewImportBaseUrl1
TestImportNameCodeFixNewImportBaseUrl2
TestImportNameCodeFixNewImportFile2
TestImportNameCodeFixNewImportTypeRoots1
TestImportStatementCompletions_esModuleInterop2
TestImportStatementCompletions_noSnippet
TestImportStatementCompletions_pnpm1
TestImportStatementCompletions_quotes
TestImportStatementCompletions_semicolons
TestImportSuggestionsCache_invalidPackageJson
TestImportTypeCompletions1
TestImportTypeCompletions3
TestImportTypeCompletions4
TestImportTypeCompletions6
TestImportTypeCompletions7
TestImportTypeCompletions8
TestImportTypeCompletions9
TestIndirectClassInstantiation
TestJavascriptModules20
Expand Down Expand Up @@ -316,14 +265,6 @@ TestJsdocTypedefTagNamespace
TestJsFileImportNoTypes2
TestJsQuickInfoGenerallyAcceptableSize
TestJsRequireQuickInfo
TestJsxAttributeCompletionStyleAuto
TestJsxAttributeCompletionStyleBraces
TestJsxAttributeCompletionStyleDefault
TestJsxAttributeCompletionStyleNone
TestJsxAttributeCompletionStyleNoSnippet
TestJsxAttributeSnippetCompletionAfterTypeArgs
TestJsxAttributeSnippetCompletionClosed
TestJsxAttributeSnippetCompletionUnclosed
TestJsxWithTypeParametershasInstantiatedSignatureHelp
TestLetQuickInfoAndCompletionList
TestLocalFunction
Expand Down
Loading
Loading