refactor: underscore-prefix kwargs
ci/woodpecker/push/woodpecker Pipeline was successful Details

so that they could be mangled by terser, producing shorter output
This commit is contained in:
CismonX 2024-04-04 04:15:19 +08:00
parent 530902128c
commit afe3694a88
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
1 changed files with 46 additions and 46 deletions

View File

@ -49,24 +49,24 @@ export default class CompletionItemProvider
return this._completionItems ??= [ return this._completionItems ??= [
command('ampchar', command('ampchar',
'Insert an ampersand, "&"', 'Insert an ampersand, "&"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('atchar', command('atchar',
'Insert an at sign, "@"', 'Insert an at sign, "@"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('backslashchar', command('backslashchar',
'Insert a blackslash, "\\"', 'Insert a blackslash, "\\"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command( command(
'lbracechar', 'lbracechar',
'Insert a left brace, "{"', 'Insert a left brace, "{"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('rbracechar', command('rbracechar',
'Insert a right brace, "}"', 'Insert a right brace, "}"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('abbr', ...braceCommand('abbr',
'Indicate a general abbreviation', 'Indicate a general abbreviation',
@ -84,7 +84,7 @@ export default class CompletionItemProvider
), ),
command('alias', command('alias',
'Defines a new command to be just like an existing one', 'Defines a new command to be just like an existing one',
{ snippet: true }, { _snippet: true },
), ),
...lineCommandEnum('allowcodebreaks', ...lineCommandEnum('allowcodebreaks',
'Control breaking at "-" and "_" in TeX', 'Control breaking at "-" and "_" in TeX',
@ -116,7 +116,7 @@ export default class CompletionItemProvider
), ),
command('arrow', command('arrow',
'Generate a right arrow glyph, "→"', 'Generate a right arrow glyph, "→"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('asis', command('asis',
'Print the tables first column without highlighting', 'Print the tables first column without highlighting',
@ -134,7 +134,7 @@ export default class CompletionItemProvider
), ),
command('bullet', command('bullet',
'Generate a large round dot, "•"', 'Generate a large round dot, "•"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('bye', command('bye',
'Stop formatting', 'Stop formatting',
@ -182,7 +182,7 @@ export default class CompletionItemProvider
), ),
command('click', command('click',
'Represent a single "click" in a GUI', 'Represent a single "click" in a GUI',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('clicksequence', ...braceCommand('clicksequence',
'Represent a sequence of clicks in a GUI', 'Represent a sequence of clicks in a GUI',
@ -206,7 +206,7 @@ export default class CompletionItemProvider
), ),
command('comma', command('comma',
'Insert a comma character, ","', 'Insert a comma character, ","',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('command', ...braceCommand('command',
'Indicate a command name', 'Indicate a command name',
@ -224,7 +224,7 @@ export default class CompletionItemProvider
), ),
command('copyright', command('copyright',
'The copyright symbol, "©"', 'The copyright symbol, "©"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...lineCommand('defcodeindex', ...lineCommand('defcodeindex',
'Define a new index, print entries in an @code font', 'Define a new index, print entries in an @code font',
@ -386,7 +386,7 @@ export default class CompletionItemProvider
), ),
command('dots', command('dots',
'Generate an ellipsis, "…"', 'Generate an ellipsis, "…"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('email', ...braceCommand('email',
'Indicate an electronic mail address', 'Indicate an electronic mail address',
@ -402,7 +402,7 @@ export default class CompletionItemProvider
), ),
command('enddots', command('enddots',
'Generate an end-of-sentence ellipsis, "..."', 'Generate an end-of-sentence ellipsis, "..."',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...blockCommand('enumerate', ...blockCommand('enumerate',
'Begin a numbered list, using @item for each entry', 'Begin a numbered list, using @item for each entry',
@ -414,12 +414,12 @@ export default class CompletionItemProvider
), ),
command('equiv', command('equiv',
'Insert a glyph indicating exact equivalence, "≡"', 'Insert a glyph indicating exact equivalence, "≡"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('error', command('error',
'Indicate that the following text is an error message, ' + 'Indicate that the following text is an error message, ' +
'"error→"', '"error→"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('errormsg', ...braceCommand('errormsg',
'Report message as an error to standard error, ' + 'Report message as an error to standard error, ' +
@ -428,7 +428,7 @@ export default class CompletionItemProvider
), ),
command('euro', command('euro',
'Generate the Euro currency sign, "€"', 'Generate the Euro currency sign, "€"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...headingFootingCommand('evenfooting', ...headingFootingCommand('evenfooting',
'Generate page footers that are the same for ' + 'Generate page footers that are the same for ' +
@ -457,7 +457,7 @@ export default class CompletionItemProvider
), ),
command('expansion', command('expansion',
'Indicate the result of a macro expansion with a glyph, "→"', 'Indicate the result of a macro expansion with a glyph, "→"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('file', ...braceCommand('file',
'Highlight the name of a file', 'Highlight the name of a file',
@ -509,14 +509,14 @@ export default class CompletionItemProvider
), ),
command('geq', command('geq',
'Generate a greater-than-or-equal sign, "≥"', 'Generate a greater-than-or-equal sign, "≥"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...blockCommand('group', ...blockCommand('group',
'Disallow page breaks within following text', 'Disallow page breaks within following text',
), ),
command('hashchar', command('hashchar',
'Insert a hash character, "#"', 'Insert a hash character, "#"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...lineCommand('heading', ...lineCommand('heading',
'Print an unnumbered section-like heading', 'Print an unnumbered section-like heading',
@ -683,11 +683,11 @@ export default class CompletionItemProvider
), ),
command('LaTeX', command('LaTeX',
'Generate the LaTeX logo', 'Generate the LaTeX logo',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('leq', command('leq',
'Generate a less-than-or-equal sign, "≤"', 'Generate a less-than-or-equal sign, "≤"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...blockCommand('lisp', ...blockCommand('lisp',
'Begin an example of Lisp code', 'Begin an example of Lisp code',
@ -716,7 +716,7 @@ export default class CompletionItemProvider
), ),
command('minus', command('minus',
'Generate a minus sign, "-"', 'Generate a minus sign, "-"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...blockCommand('multitable', ...blockCommand('multitable',
'Begin a multi-column table', 'Begin a multi-column table',
@ -760,7 +760,7 @@ export default class CompletionItemProvider
), ),
command('pagesizes', command('pagesizes',
'Change page dimensions', 'Change page dimensions',
{ snippet: true }, { _snippet: true },
), ),
...lineCommand('paragraphindent', ...lineCommand('paragraphindent',
'Indent paragraphs by spaces', 'Indent paragraphs by spaces',
@ -776,15 +776,15 @@ export default class CompletionItemProvider
), ),
command('point', command('point',
'Indicate the position of point in a buffer with ""', 'Indicate the position of point in a buffer with ""',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('pounds', command('pounds',
'Generate the pounds sterling currency sign, "£"', 'Generate the pounds sterling currency sign, "£"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('print', command('print',
'Indicate printed output to the reader with "-|"', 'Indicate printed output to the reader with "-|"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...lineCommand('printindex', ...lineCommand('printindex',
'Generate the alphabetized index for index name', 'Generate the alphabetized index for index name',
@ -801,19 +801,19 @@ export default class CompletionItemProvider
), ),
command('quotedblleft', command('quotedblleft',
'Produce quotation mark "“"', 'Produce quotation mark "“"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('quotedblright', command('quotedblright',
'Produce quotation mark "”"', 'Produce quotation mark "”"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('quoteleft', command('quoteleft',
'Produce quotation mark ""', 'Produce quotation mark ""',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('quoteright', command('quoteright',
'Produce quotation mark ""', 'Produce quotation mark ""',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('r', ...braceCommand('r',
'Set text in the regular roman font', 'Set text in the regular roman font',
@ -834,11 +834,11 @@ export default class CompletionItemProvider
), ),
command('registeredsymbol', command('registeredsymbol',
'Generate the legal symbol, "®"', 'Generate the legal symbol, "®"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('result', command('result',
'Indicate the result of an expression with "⇒"', 'Indicate the result of an expression with "⇒"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('samp', ...braceCommand('samp',
'Indicate a literal example of a sequence of characters', 'Indicate a literal example of a sequence of characters',
@ -976,14 +976,14 @@ export default class CompletionItemProvider
), ),
command('TeX', command('TeX',
'Generate the TeX logo', 'Generate the TeX logo',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...blockCommand('tex', ...blockCommand('tex',
'Enter TeX completely', 'Enter TeX completely',
), ),
command('textdegree', command('textdegree',
'Generate the degree symbol, "◦"', 'Generate the degree symbol, "◦"',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
command('thischapter', command('thischapter',
'Insert the number and name of the current chapter', 'Insert the number and name of the current chapter',
@ -1006,7 +1006,7 @@ export default class CompletionItemProvider
command('tie', command('tie',
'Generate a normal interword space at which a line break ' + 'Generate a normal interword space at which a line break ' +
'is not allowed', 'is not allowed',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...braceCommand('tieaccent', ...braceCommand('tieaccent',
'Generate a tie-after accent over the two characters', 'Generate a tie-after accent over the two characters',
@ -1029,7 +1029,7 @@ export default class CompletionItemProvider
), ),
command('today', command('today',
'Insert the current date', 'Insert the current date',
{ hasEmptyBrace: true }, { _hasEmptyBrace: true },
), ),
...lineCommand('top', ...lineCommand('top',
'Mark the topmost @node in the file', 'Mark the topmost @node in the file',
@ -1213,20 +1213,20 @@ function command(name: string, detail: string, extraArgs?: {
/** /**
* Whether this command has a snippet. * Whether this command has a snippet.
*/ */
snippet?: boolean, _snippet?: boolean,
/** /**
* Whether this command takes no arguments and braces are required. * Whether this command takes no arguments and braces are required.
*/ */
hasEmptyBrace?: boolean, _hasEmptyBrace?: boolean,
}): CompletionItem { }): CompletionItem {
return { return {
label: '@' + name, label: '@' + name,
kind: vscode.CompletionItemKind.Function, kind: vscode.CompletionItemKind.Function,
detail: detail, detail: detail,
sortText: name + (extraArgs?.snippet ? '1' : ''), sortText: name + (extraArgs?._snippet ? '1' : ''),
filterText: name, filterText: name,
insertText: name + (extraArgs?.hasEmptyBrace ? '{}' : ''), insertText: name + (extraArgs?._hasEmptyBrace ? '{}' : ''),
snippet: extraArgs?.snippet, snippet: extraArgs?._snippet,
}; };
} }
@ -1243,7 +1243,7 @@ function blockCommand(
...args: string[] ...args: string[]
) { ) {
return [blockSnippet(name, detail, ...args), return [blockSnippet(name, detail, ...args),
command(name, detail, { snippet: true })]; command(name, detail, { _snippet: true })];
} }
/** /**
@ -1260,7 +1260,7 @@ function braceCommand(
...args: string[] ...args: string[]
) { ) {
return [braceCommandSnippet(name, detail, numArgsRequired, ...args), return [braceCommandSnippet(name, detail, numArgsRequired, ...args),
command(name, detail, { snippet: true })]; command(name, detail, { _snippet: true })];
} }
/** /**
@ -1272,7 +1272,7 @@ function braceCommand(
*/ */
function lineCommand(name: string, detail: string, ...args: string[]) { function lineCommand(name: string, detail: string, ...args: string[]) {
return [lineCommandSnippet(name, detail, ...args), return [lineCommandSnippet(name, detail, ...args),
command(name, detail, { snippet: true })]; command(name, detail, { _snippet: true })];
} }
/** /**
@ -1300,7 +1300,7 @@ function lineCommandEnum(name: string, detail: string, ...items: string[]) {
`@${name} ${items.join('/')}`, `@${name} ${items.join('/')}`,
`${name} \${1|${items.join(',')}|}`, `${name} \${1|${items.join(',')}|}`,
), ),
command(name, detail, { snippet: true }), command(name, detail, { _snippet: true }),
]; ];
} }
@ -1314,7 +1314,7 @@ function headingFootingCommand(name: string, detail: string) {
return [ return [
snippet(name, name, detail, 0, `@${name} left @| center @| right`, snippet(name, name, detail, 0, `@${name} left @| center @| right`,
name + ' ${1:left} @| ${2:center} @| ${3:right}'), name + ' ${1:left} @| ${2:center} @| ${3:right}'),
command(name, detail, { snippet: true }), command(name, detail, { _snippet: true }),
]; ];
} }