Skip to content

Commit 7437af2

Browse files
committed
fix(completions): reverted if logic branch, initial changes covered only edge cases
1 parent 75d7ffc commit 7437af2

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

src/services/completions.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3367,19 +3367,14 @@ function getCompletionData(
33673367
const typeExpression = tryGetTypeExpressionFromTag(tag);
33683368
if (typeExpression) {
33693369
currentToken = getTokenAtPosition(sourceFile, position);
3370-
// Enable type completions if in type expression, unless token is a declaration
3371-
// name inside it (e.g., property name in `{ prop: Type }`). See #62281.
3372-
if (isCurrentlyEditingNode(typeExpression)) {
3373-
const tokenIsInsideTypeExpression = currentToken && isCurrentlyEditingNode(currentToken);
3374-
if (
3375-
!currentToken ||
3376-
!tokenIsInsideTypeExpression ||
3377-
(!isDeclarationName(currentToken) &&
3378-
(currentToken.parent.kind !== SyntaxKind.JSDocPropertyTag ||
3379-
(currentToken.parent as JSDocPropertyTag).name !== currentToken))
3380-
) {
3381-
insideJsDocTagTypeExpression = true;
3382-
}
3370+
if (
3371+
!currentToken ||
3372+
(!isDeclarationName(currentToken) &&
3373+
(currentToken.parent.kind !== SyntaxKind.JSDocPropertyTag ||
3374+
(currentToken.parent as JSDocPropertyTag).name !== currentToken))
3375+
) {
3376+
// Use as type location if inside tag's type expression
3377+
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
33833378
}
33843379
}
33853380
if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {

0 commit comments

Comments
 (0)