fix(46606): show completion in jsdoc property tag (#46657)

This commit is contained in:
Oleksandr T
2021-12-07 15:28:41 -08:00
committed by GitHub
parent 6722ef12d3
commit 5f372d9d7e
2 changed files with 13 additions and 2 deletions
+3 -2
View File
@@ -3531,8 +3531,9 @@ namespace ts.Completions {
/** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
function getJsDocTagAtPosition(node: Node, position: number): JSDocTag | undefined {
const jsdoc = findAncestor(node, isJSDoc);
return jsdoc && jsdoc.tags && (rangeContainsPosition(jsdoc, position) ? findLast(jsdoc.tags, tag => tag.pos < position) : undefined);
return findAncestor(node, n =>
isJSDocTag(n) && rangeContainsPosition(n, position) ? true :
isJSDoc(n) ? "quit" : false) as JSDocTag | undefined;
}
export function getPropertiesForObjectExpression(contextualType: Type, completionsType: Type | undefined, obj: ObjectLiteralExpression | JsxAttributes, checker: TypeChecker): Symbol[] {
@@ -0,0 +1,10 @@
///<reference path="fourslash.ts" />
/////**
//// * @typedef {Object} Foo
//// * @property {/**/}
//// */
verify.completions(
{ marker: "", exact: completion.globalTypes },
);