From 80ea1772e2e11754356a6587e5c2ca8ae8f950fe Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 27 Aug 2014 15:51:47 +0200 Subject: [PATCH] Add @extends annotations to generated externs --- config/jsdoc/info/publish.js | 3 +++ tasks/generate-externs.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/jsdoc/info/publish.js b/config/jsdoc/info/publish.js index 263c28df1e..23747fe591 100644 --- a/config/jsdoc/info/publish.js +++ b/config/jsdoc/info/publish.js @@ -88,6 +88,9 @@ exports.publish = function(data, opts) { stability: doc.api, path: path.join(doc.meta.path, doc.meta.filename) }; + if (doc.augments) { + symbol.extends = doc.augments[0]; + } if (doc.type) { symbol.types = getTypes(doc.type.names); } diff --git a/tasks/generate-externs.js b/tasks/generate-externs.js index 094bc4782d..ad27e16555 100644 --- a/tasks/generate-externs.js +++ b/tasks/generate-externs.js @@ -93,6 +93,9 @@ function generateExterns(typedefs, symbols, externs, interfaces) { if (symbol.kind === 'class') { constructors[name] = true; lines.push(' * @constructor'); + if (symbol.extends) { + lines.push(' * @extends {' + symbol.extends + '}'); + } } if (symbol.types) { lines.push(' * @type {' + noGoogTypes(symbol.types).join('|') + '}');