Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments.
(node)
| 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); |
no test coverage detected