diff --git a/modules/jsdoc/tag/dictionary/definitions.js b/modules/jsdoc/tag/dictionary/definitions.js index daa4ed45..27bd63aa 100644 --- a/modules/jsdoc/tag/dictionary/definitions.js +++ b/modules/jsdoc/tag/dictionary/definitions.js @@ -327,6 +327,16 @@ }) .synonym('return'); + dictionary.defineTag('see', { + mustHaveValue: true, + onTagged: function(doclet, tag) { + if (!doclet.see) { doclet.see = []; } + doclet.see.push(tag.value); + + return true; + } + }); + dictionary.defineTag('since', { mustHaveValue: true, onTagged: function(doclet, tag) { diff --git a/test/cases/seetag.js b/test/cases/seetag.js new file mode 100644 index 00000000..9b9ad723 --- /dev/null +++ b/test/cases/seetag.js @@ -0,0 +1,11 @@ +/** +* @see #search +*/ +function foo() { +} + +/** +* @see http://example.com/someref +*/ +function bar() { +} diff --git a/test/runner.js b/test/runner.js index 3e217e0a..191afb4a 100644 --- a/test/runner.js +++ b/test/runner.js @@ -98,6 +98,7 @@ testFile('test/t/cases/globaltag.js'); testFile('test/t/cases/ignoretag.js'); testFile('test/t/cases/paramtag.js'); testFile('test/t/cases/returnstag.js'); +testFile('test/t/cases/seetag.js'); testFile('test/t/cases/sincetag.js'); testFile('test/t/cases/typetag.js'); testFile('test/t/cases/versiontag.js'); diff --git a/test/t/cases/seetag.js b/test/t/cases/seetag.js new file mode 100644 index 00000000..646d892b --- /dev/null +++ b/test/t/cases/seetag.js @@ -0,0 +1,15 @@ +(function() { + var docSet = testhelpers.getDocSetFromFile('test/cases/seetag.js'), + foo = docSet.getByLongname('foo')[0], + bar = docSet.getByLongname('bar')[0]; + + //dump(docSet.doclets); exit(0); + + test('When a symbol has an @see tag, the doclet has a see property that includes that value.', function() { + assert.equal(typeof foo.see, 'object'); + assert.equal(foo.see[0], '#search'); + + assert.equal(typeof bar.see, 'object'); + assert.equal(bar.see[0], 'http://example.com/someref'); + }); +})(); \ No newline at end of file