Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference path='fourslash.ts'/>

//// const foo = "foo";
//// function test1<T = /*1*/>() {}

verify.completions({ marker: "1", exact: completion.globalTypes });
2 changes: 1 addition & 1 deletion tests/cases/fourslash/completionListIsGlobalCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down