2020-10-24 21:45:32 +00:00
|
|
|
/**
|
|
|
|
* utils/types.ts
|
2021-03-16 12:01:13 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2020,2021 CismonX <admin@cismon.net>
|
|
|
|
*
|
|
|
|
* This file is part of vscode-texinfo.
|
|
|
|
*
|
|
|
|
* vscode-texinfo is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
|
|
* Software Foundation, either version 3 of the License, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* vscode-texinfo is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* vscode-texinfo. If not, see <https://www.gnu.org/licenses/>.
|
2020-10-24 21:45:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import * as vscode from 'vscode';
|
|
|
|
|
2021-05-25 09:00:27 +00:00
|
|
|
export type CompletionItem = vscode.CompletionItem & {
|
|
|
|
snippet?: boolean,
|
|
|
|
};
|
2020-10-24 21:45:32 +00:00
|
|
|
|
2021-05-25 09:00:27 +00:00
|
|
|
export type ExecResult = {
|
|
|
|
data?: string,
|
|
|
|
error: string,
|
|
|
|
};
|
2020-10-24 21:45:32 +00:00
|
|
|
|
2021-05-25 09:00:27 +00:00
|
|
|
export type FoldingRange = vscode.FoldingRange & {
|
|
|
|
name: string,
|
|
|
|
detail: string,
|
|
|
|
};
|
2020-10-24 21:45:32 +00:00
|
|
|
|
2021-05-25 09:00:27 +00:00
|
|
|
export type NamedLine = {
|
|
|
|
name: string,
|
|
|
|
line: number,
|
|
|
|
};
|
2020-10-26 17:28:11 +00:00
|
|
|
|
2021-04-19 12:43:20 +00:00
|
|
|
export type Operator<T> = (arg: T) => T;
|
2020-10-24 21:45:32 +00:00
|
|
|
|
2021-04-19 12:43:20 +00:00
|
|
|
export type Optional<T> = T | undefined;
|
2020-10-26 17:28:11 +00:00
|
|
|
|
2021-05-25 09:00:27 +00:00
|
|
|
export type Range = {
|
|
|
|
start: number,
|
|
|
|
end: number,
|
|
|
|
};
|
2020-10-26 19:37:05 +00:00
|
|
|
|
2020-10-24 21:45:32 +00:00
|
|
|
export function isDefined<T>(value: Optional<T>): value is T {
|
|
|
|
return value !== undefined;
|
|
|
|
}
|