MCPcopy Create free account
hub / github.com/nodejs/node / getJSDocHost

Function getJSDocHost

test/fixtures/snapshot/typescript.js:17019–17028  ·  view source on GitHub ↗

Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments.

(node)

Source from the content-addressed store, hash-verified

17017 ts.getEffectiveJSDocHost = getEffectiveJSDocHost;
17018 /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */
17019 function getJSDocHost(node) {
17020 var jsDoc = getJSDocRoot(node);
17021 if (!jsDoc) {
17022 return undefined;
17023 }
17024 var host = jsDoc.parent;
17025 if (host && host.jsDoc && jsDoc === ts.lastOrUndefined(host.jsDoc)) {
17026 return host;
17027 }
17028 }
17029 ts.getJSDocHost = getJSDocHost;
17030 function getJSDocRoot(node) {
17031 return ts.findAncestor(node.parent, ts.isJSDoc);

Callers 1

getEffectiveJSDocHostFunction · 0.85

Calls 1

getJSDocRootFunction · 0.85

Tested by

no test coverage detected