Skip to content

Commit a48d605

Browse files
committed
fix(51054): skip completion in the jsdoc type literals for typescript files
1 parent 4635a5c commit a48d605

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/services/completions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,7 @@ namespace ts.Completions {
30043004
function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols(): GlobalsSearch | undefined {
30053005
const typeLiteralNode = tryGetTypeLiteralNode(contextToken);
30063006
if (!typeLiteralNode) return GlobalsSearch.Continue;
3007+
if (typeLiteralNode.flags & (NodeFlags.JSDoc & ~NodeFlags.JavaScriptFile)) return GlobalsSearch.Fail;
30073008

30083009
const intersectionTypeNode = isIntersectionTypeNode(typeLiteralNode.parent) ? typeLiteralNode.parent : undefined;
30093010
const containerTypeNode = intersectionTypeNode || typeLiteralNode;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////interface Foo<T> { }
4+
/////**
5+
//// * @type {Foo<{/**/}>}
6+
//// */
7+
8+
verify.completions({ marker: "", exact: [], isNewIdentifierLocation: true });

0 commit comments

Comments
 (0)