Skip to content

Commit

Permalink
Doxygen return parameter links to a GitHub user's account page (#5985)
Browse files Browse the repository at this point in the history
Fixes #5928
  • Loading branch information
alexr00 committed May 2, 2024
1 parent 6121221 commit e5c471e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/common/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ export const ALLOWED_USERS = `[a-zA-Z0-9-]+`;
export const JSDOC_NON_USERS = ['abstract', 'virtual', 'access', 'alias', 'async', 'augments', 'extends', 'author', 'borrows', 'callback', 'class', 'constructor', 'classdesc', 'constant', 'const', 'constructs', 'copyright', 'default', 'defaultvalue', 'deprecated', 'description', 'desc', 'enum', 'event', 'example', 'exports', 'external', 'host', 'file', 'fileoverview', 'overview', 'fires', 'emits', 'function', 'func', 'method', 'generator', 'global', 'hideconstructor', 'ignore', 'implements', 'inheritdoc', 'inner', 'instance', 'interface', 'kind', 'lends', 'license', 'listens', 'member', 'var', 'memberof', 'mixes', 'mixin', 'module', 'name', 'namespace', 'override', 'package', 'param', 'arg', 'argument', 'private', 'property', 'prop', 'protected', 'public', 'readonly', 'requires', 'returns', 'return', 'see', 'since', 'static', 'summary', 'this', 'throws', 'exception', 'todo', 'tutorial', 'type', 'typedef', 'variation', 'version', 'yields', 'yield', 'link'];

// https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md
export const PHPDOC_NON_USERS = ['api', 'author', 'copyright', 'deprecated', 'generated', 'internal', 'link', 'method', 'package', 'param', 'property', 'return', 'see', 'since', 'throws', 'todo', 'uses', 'var', 'version'];
export const PHPDOC_NON_USERS = ['api', 'author', 'copyright', 'deprecated', 'generated', 'internal', 'link', 'method', 'package', 'param', 'property', 'return', 'see', 'since', 'throws', 'todo', 'uses', 'var', 'version'];

// https://www.doxygen.nl/manual/commands.html
export const DOXYGEN_NON_USERS = ['a', 'addindex', 'addtogroup', 'anchor', 'arg', 'attention', 'author', 'authors', 'b', 'brief', 'bug', 'c', 'callergraph', 'callgraph', 'category', 'cite', 'class', 'code', 'collaborationgraph', 'concept', 'cond', 'copybrief', 'copydetails', 'copydoc', 'copyright', 'date', 'def', 'defgroup', 'deprecated', 'details', 'diafile', 'dir', 'directorygraph', 'docbookinclude', 'docbookonly', 'dontinclude', 'dot', 'dotfile', 'doxyconfig', 'e', 'else', 'elseif', 'em', 'emoji', 'endcode', 'endcond', 'enddocbookonly', 'enddot', 'endhtmlonly', 'endif', 'endinternal', 'endlatexonly', 'endlink', 'endmanonly', 'endmsc', 'endparblock', 'endrtfonly', 'endsecreflist', 'endverbatim', 'enduml', 'endxmlonly', 'enum', 'example', 'exception', 'extends', 'f(', 'f)', 'f$', 'f[', 'f]', 'f{', 'f}', 'file', 'fileinfo', 'fn', 'groupgraph', 'headerfile', 'hidecallergraph', 'hidecallgraph', 'hidecollaborationgraph', 'hidedirectorygraph', 'hidegroupgraph', 'hideincludedbygraph', 'hideincludegraph', 'hideinheritancegraph', 'hideinlinesource', 'hiderefby', 'hiderefs', 'hideinitializer', 'htmlinclude', 'htmlonly', 'idlexcept', 'if', 'ifnot', 'image', 'implements', 'important', 'include', 'includedoc', 'includedbygraph', 'includegraph', 'includelineno', 'ingroup', 'inheritancegraph', 'internal', 'invariant', 'interface', 'latexinclude', 'latexonly', 'li', 'line', 'lineinfo', 'link', 'mainpage', 'maninclude', 'manonly', 'memberof', 'module', 'msc', 'mscfile', 'n', 'name', 'namespace', 'noop', 'nosubgrouping', 'note', 'overload', 'p', 'package', 'page', 'par', 'paragraph', 'param', 'parblock', 'post', 'pre', 'private', 'privatesection', 'property', 'protected', 'protectedsection', 'protocol', 'public', 'publicsection', 'pure', 'qualifier', 'raisewarning', 'ref', 'refitem', 'related', 'relates', 'relatedalso', 'relatesalso', 'remark', 'remarks', 'result', 'return', 'returns', 'retval', 'rtfinclude', 'rtfonly', 'sa', 'secreflist', 'section', 'see', 'short', 'showdate', 'showinitializer', 'showinlinesource', 'showrefby', 'showrefs', 'since', 'skip', 'skipline', 'snippet', 'snippetdoc', 'snippetlineno', 'static', 'startuml', 'struct', 'subpage', 'subparagraph', 'subsection', 'subsubparagraph', 'subsubsection', 'tableofcontents', 'test', 'throw', 'throws', 'todo', 'tparam', 'typedef', 'union', 'until', 'var', 'verbatim', 'verbinclude', 'version', 'vhdlflow', 'warning', 'weakgroup', 'xmlinclude', 'xmlonly', 'xrefitem'];
6 changes: 5 additions & 1 deletion src/issues/userHoverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as vscode from 'vscode';
import { ITelemetry } from '../common/telemetry';
import { JSDOC_NON_USERS, PHPDOC_NON_USERS } from '../common/user';
import { DOXYGEN_NON_USERS, JSDOC_NON_USERS, PHPDOC_NON_USERS } from '../common/user';
import { RepositoriesManager } from '../github/repositoriesManager';
import { shouldShowHover, USER_EXPRESSION, userMarkdown } from './util';

Expand Down Expand Up @@ -40,6 +40,10 @@ export class UserHoverProvider implements vscode.HoverProvider {
if ((document.languageId === 'php') && PHPDOC_NON_USERS.indexOf(username) >= 0) {
return;
}
const isDoxygenLanguage = document.languageId === 'cpp' || document.languageId === 'c' || document.languageId === 'csharp' || document.languageId === 'java' || document.languageId === 'objective-c' || document.languageId === 'php';
if (isDoxygenLanguage && DOXYGEN_NON_USERS.indexOf(username) >= 0) {
return;
}
return this.createHover(document.uri, username, wordPosition);
}
} else {
Expand Down

0 comments on commit e5c471e

Please sign in to comment.