Skip to content

Commit 5f372d9

Browse files
authored
fix(46606): show completion in jsdoc property tag (microsoft#46657)
1 parent 6722ef1 commit 5f372d9

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/services/completions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,8 +3531,9 @@ namespace ts.Completions {
35313531

35323532
/** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
35333533
function getJsDocTagAtPosition(node: Node, position: number): JSDocTag | undefined {
3534-
const jsdoc = findAncestor(node, isJSDoc);
3535-
return jsdoc && jsdoc.tags && (rangeContainsPosition(jsdoc, position) ? findLast(jsdoc.tags, tag => tag.pos < position) : undefined);
3534+
return findAncestor(node, n =>
3535+
isJSDocTag(n) && rangeContainsPosition(n, position) ? true :
3536+
isJSDoc(n) ? "quit" : false) as JSDocTag | undefined;
35363537
}
35373538

35383539
export function getPropertiesForObjectExpression(contextualType: Type, completionsType: Type | undefined, obj: ObjectLiteralExpression | JsxAttributes, checker: TypeChecker): Symbol[] {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
///<reference path="fourslash.ts" />
2+
3+
/////**
4+
//// * @typedef {Object} Foo
5+
//// * @property {/**/}
6+
//// */
7+
8+
verify.completions(
9+
{ marker: "", exact: completion.globalTypes },
10+
);

0 commit comments

Comments
 (0)