Add JSDoc to suggestion types [skip ci]

This commit is contained in:
James Yu 2023-01-18 00:14:10 +08:00
parent 110b39798c
commit 56f12cd6d7
4 changed files with 25 additions and 8 deletions

View File

@ -16,15 +16,23 @@ const logger = getLogger('Intelli', 'Command')
type DataUnimathSymbolsJsonType = typeof import('../../../data/unimathsymbols.json') type DataUnimathSymbolsJsonType = typeof import('../../../data/unimathsymbols.json')
export type CmdType = { export type CmdType = {
/** Name of the command without the leading \ and with argument signature */
command?: string, command?: string,
/** Snippet to be inserted after the leading \ */
snippet?: string, snippet?: string,
/** The option of package below that activates this cmd */
option?: string, option?: string,
/** Possible options of this env */
keyvals?: string[], keyvals?: string[],
/** The index of keyval list in package .json file. Should not be used */
keyvalindex?: number, keyvalindex?: number,
/** The index of argument which have the keyvals */
keyvalpos?: number, keyvalpos?: number,
detail?: string, detail?: string,
documentation?: string, documentation?: string,
/** The package providing the environment */
package?: string, package?: string,
/** The action to be executed after inserting the snippet */
postAction?: string postAction?: string
} }

View File

@ -2,8 +2,10 @@ import * as vscode from 'vscode'
import type { ICompletionItem } from '../completion' import type { ICompletionItem } from '../completion'
export interface CmdSignature { export interface CmdSignature {
readonly name: string, // name without leading `\` /** name without leading `\` */
readonly args: string // {} for mandatory args and [] for optional args readonly name: string,
/** {} for mandatory args and [] for optional args */
readonly args: string
} }
/** /**

View File

@ -12,13 +12,20 @@ import { getLogger } from '../../components/logger'
const logger = getLogger('Intelli', 'Environment') const logger = getLogger('Intelli', 'Environment')
export type EnvType = { export type EnvType = {
name: string, // Name of the environment, what comes inside \begin{...} /** Name of the environment, what comes inside \begin{...} */
snippet?: string, // To be inserted after \begin{..} name: string,
/** To be inserted after \begin{..} */
snippet?: string,
/** The option of package below that activates this env */
option?: string, option?: string,
/** Possible options of this env */
keyvals?: string[], keyvals?: string[],
/** The index of keyval list in package .json file. Should not be used */
keyvalindex?: number, keyvalindex?: number,
/** The index of argument which have the keyvals */
keyvalpos?: number, keyvalpos?: number,
package?: string, // The package providing the environment /** The package providing the environment */
package?: string,
detail?: string detail?: string
} }

View File

@ -8,11 +8,11 @@ import {computeFilteringRange} from './completerutils'
import type { IProvider, ICompletionItem } from '../completion' import type { IProvider, ICompletionItem } from '../completion'
export interface ReferenceEntry extends ICompletionItem { export interface ReferenceEntry extends ICompletionItem {
// The file that defines the ref. /** The file that defines the ref. */
file: string, file: string,
// The position that defines the ref. /** The position that defines the ref. */
position: vscode.Position, position: vscode.Position,
// Stores the ref number. /** Stores the ref number. */
prevIndex?: {refNumber: string, pageNumber: string} prevIndex?: {refNumber: string, pageNumber: string}
} }