-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathtypes.ts
73 lines (69 loc) · 2.05 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { WordRange } from './textAndWord';
import { StmtContextType } from './entityCollector';
/**
* The insertion position of the candidate list.
* Such as cursor position
*/
export interface CaretPosition {
/** start at 1 */
readonly lineNumber: number;
/** start at 1 */
readonly column: number;
}
/**
* Syntax context type at caret position
*/
export enum EntityContextType {
/** catalog name */
CATALOG = 'catalog',
/** catalog name that will be created */
CATALOG_CREATE = 'catalogCreate',
/** database name path, such as catalog.db */
DATABASE = 'database',
/** database name path that will be created */
DATABASE_CREATE = 'databaseCreate',
/** table name path, such as catalog.db.tb */
TABLE = 'table',
/** table name path that will be created */
TABLE_CREATE = 'tableCreate',
/** view name path, such as db.tb.view */
VIEW = 'view',
/** view name path that will be created */
VIEW_CREATE = 'viewCreate',
/** function name */
FUNCTION = 'function',
/** function name that will be created */
FUNCTION_CREATE = 'functionCreate',
/** procedure name */
PROCEDURE = 'procedure',
/** procedure name that will be created */
PROCEDURE_CREATE = 'procedureCreate',
/** column name */
COLUMN = 'column',
/** column name that will be created */
COLUMN_CREATE = 'columnCreate',
/** table property key when creating table*/
TABLE_PROPERTY_KEY = 'tablePropertyKey',
/** table property value when creating table*/
TABLE_PROPERTY_VALUE = 'tablePropertyValue',
}
/**
* Suggested information analyzed from the input
*/
export interface SyntaxSuggestion<T = WordRange> {
readonly syntaxContextType: EntityContextType | StmtContextType;
readonly wordRanges: T[];
}
/**
* Suggested information analyzed from the input
*/
export interface Suggestions<T = WordRange> {
/**
* Suggestions about syntax
*/
readonly syntax: SyntaxSuggestion<T>[];
/**
* Suggestions about keywords
*/
readonly keywords: string[];
}