diff --git a/src/services/completions.ts b/src/services/completions.ts index 9c558f194ab5a..90e8c70be37b3 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -3946,7 +3946,7 @@ function getCompletionData( isFunctionLikeKind(parentKind); case SyntaxKind.EqualsToken: - return parentKind === SyntaxKind.TypeAliasDeclaration; + return parentKind === SyntaxKind.TypeAliasDeclaration || parentKind === SyntaxKind.TypeParameter; case SyntaxKind.AsKeyword: return parentKind === SyntaxKind.AsExpression; diff --git a/tests/cases/fourslash/completionListDefaultTypeArgumentPositionTypeOnly.ts b/tests/cases/fourslash/completionListDefaultTypeArgumentPositionTypeOnly.ts new file mode 100644 index 0000000000000..d42049c5eccd6 --- /dev/null +++ b/tests/cases/fourslash/completionListDefaultTypeArgumentPositionTypeOnly.ts @@ -0,0 +1,6 @@ +/// + +//// const foo = "foo"; +//// function test1() {} + +verify.completions({ marker: "1", exact: completion.globalTypes }); diff --git a/tests/cases/fourslash/completionListIsGlobalCompletion.ts b/tests/cases/fourslash/completionListIsGlobalCompletion.ts index 107c64adadb2a..9516b8e4f34ab 100644 --- a/tests/cases/fourslash/completionListIsGlobalCompletion.ts +++ b/tests/cases/fourslash/completionListIsGlobalCompletion.ts @@ -48,7 +48,7 @@ verify.completions( { marker: "7", exact: completion.globalsInsideFunction(x), isGlobalCompletion: true }, { marker: "9", exact: ["x", "y"], isGlobalCompletion: false }, { marker: "10", exact: completion.classElementKeywords, isGlobalCompletion: false, isNewIdentifierLocation: true }, - { marker: "13", exact: globals, isGlobalCompletion: false }, + { marker: "13", exact: completion.globalTypesPlus(["A", "B", "C"]), isGlobalCompletion: false }, { marker: "15", exact: globals.filter(name => name !== 'x'), isGlobalCompletion: true, isNewIdentifierLocation: true }, { marker: "16", unsorted: [...x, completion.globalThisEntry, ...completion.globalsVars, completion.undefinedVarEntry].filter(name => name !== 'user'), isGlobalCompletion: false }, { marker: "17", exact: completion.globalKeywords, isGlobalCompletion: false },