dot-language-support 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +436 -431
- package/dist/index.js +3277 -3739
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,566 +1,571 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import * as lst from "vscode-languageserver-types";
|
|
2
|
+
import { Color as Color$1, ColorInformation, ColorPresentation } from "vscode-languageserver-types";
|
|
3
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
4
4
|
|
|
5
|
+
//#region src/types.d.ts
|
|
5
6
|
declare const errorSource: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
readonly Scan: 1;
|
|
8
|
+
readonly Parse: 2;
|
|
9
|
+
readonly Check: 4;
|
|
9
10
|
};
|
|
10
11
|
type ErrorSource = (typeof errorSource)[keyof typeof errorSource];
|
|
11
12
|
type ErrorCode = ParseErrorCode | ScanErrorCode | CheckErrorCode;
|
|
12
13
|
interface ParseErrorCode {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
source: typeof errorSource.Parse;
|
|
15
|
+
sub: ParseError;
|
|
15
16
|
}
|
|
16
17
|
interface ScanErrorCode {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
source: typeof errorSource.Scan;
|
|
19
|
+
sub: ScanError;
|
|
19
20
|
}
|
|
20
21
|
interface CheckErrorCode {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
source: typeof errorSource.Check;
|
|
23
|
+
sub: CheckError;
|
|
23
24
|
}
|
|
24
25
|
declare const parseError: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
readonly ExpectationFailed: 0;
|
|
27
|
+
readonly TrailingData: 1;
|
|
28
|
+
readonly FailedListParsing: 2;
|
|
28
29
|
};
|
|
29
30
|
type ParseError = (typeof parseError)[keyof typeof parseError];
|
|
30
31
|
declare const scanError: {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
readonly ExpectationFailed: 0;
|
|
33
|
+
readonly Unterminated: 1;
|
|
33
34
|
};
|
|
34
35
|
type ScanError = (typeof scanError)[keyof typeof scanError];
|
|
35
36
|
declare const checkError: {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
readonly InvalidEdgeOperation: 0;
|
|
38
|
+
readonly InvalidShapeName: 1;
|
|
38
39
|
};
|
|
39
40
|
type CheckError = (typeof checkError)[keyof typeof checkError];
|
|
40
41
|
interface DiagnosticMessage {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
message: string;
|
|
43
|
+
code: ErrorCode;
|
|
44
|
+
category: DiagnosticCategory;
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
46
47
|
}
|
|
47
48
|
declare const diagnosticCategory: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
readonly Error: 1;
|
|
50
|
+
readonly Warning: 2;
|
|
51
|
+
readonly Message: 3;
|
|
52
|
+
readonly Suggestion: 4;
|
|
52
53
|
};
|
|
53
54
|
type DiagnosticCategory = (typeof diagnosticCategory)[keyof typeof diagnosticCategory];
|
|
54
55
|
type ID = string;
|
|
55
56
|
interface SourceFile {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
content: string;
|
|
58
|
+
graph?: Graph;
|
|
59
|
+
identifiers: Set<ID>;
|
|
60
|
+
diagnostics: DiagnosticMessage[];
|
|
61
|
+
symbols?: SymbolTable;
|
|
62
|
+
colors?: ColorTable;
|
|
62
63
|
}
|
|
63
64
|
interface HtmlIdentifier extends SyntaxNode {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
kind: typeof syntaxKind.HtmlIdentifier;
|
|
66
|
+
htmlContent: string;
|
|
66
67
|
}
|
|
67
68
|
interface TextIdentifier extends SyntaxNode {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
kind: typeof syntaxKind.TextIdentifier;
|
|
70
|
+
text: string;
|
|
70
71
|
}
|
|
71
72
|
interface QuotedTextIdentifier extends SyntaxNode {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
kind: typeof syntaxKind.QuotedTextIdentifier;
|
|
74
|
+
values: SyntaxNodeArray<StringLiteral>;
|
|
75
|
+
concatenation?: string;
|
|
75
76
|
}
|
|
76
77
|
interface StringLiteral extends SyntaxNode {
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
kind: typeof syntaxKind.StringLiteral;
|
|
79
|
+
text: string;
|
|
79
80
|
}
|
|
80
81
|
interface NumericIdentifier extends SyntaxNode {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
kind: typeof syntaxKind.NumericIdentifier;
|
|
83
|
+
text: string;
|
|
84
|
+
value: number;
|
|
84
85
|
}
|
|
85
86
|
type Identifier = TextIdentifier | QuotedTextIdentifier | HtmlIdentifier | NumericIdentifier;
|
|
86
87
|
interface Graph extends SyntaxNode {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
kind: typeof syntaxKind.DirectedGraph | typeof syntaxKind.UndirectedGraph;
|
|
89
|
+
keyword: Token<typeof syntaxKind.GraphKeyword | typeof syntaxKind.DigraphKeyword>;
|
|
90
|
+
strict?: Token<typeof syntaxKind.StrictKeyword>;
|
|
91
|
+
id?: Identifier;
|
|
92
|
+
statements: SyntaxNodeArray<Statement>;
|
|
92
93
|
}
|
|
93
94
|
interface StatementBase {
|
|
94
|
-
|
|
95
|
+
terminator?: StatementSeparator;
|
|
95
96
|
}
|
|
96
97
|
type StatementSeparator = Token<typeof syntaxKind.SemicolonToken>;
|
|
97
98
|
type Statement = NodeStatement | EdgeStatement | AttributeStatement | IdEqualsIdStatement | SubGraphStatement;
|
|
98
99
|
interface NodeStatement extends SyntaxNode, StatementBase {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
kind: typeof syntaxKind.NodeStatement;
|
|
101
|
+
id: NodeId;
|
|
102
|
+
attributes: SyntaxNodeArray<AttributeContainer>;
|
|
102
103
|
}
|
|
103
104
|
interface NodeId extends SyntaxNode {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
kind: typeof syntaxKind.NodeId;
|
|
106
|
+
id: Identifier;
|
|
107
|
+
port?: PortDeclaration;
|
|
107
108
|
}
|
|
108
109
|
type EdgeSourceOrTarget = NodeId | SubGraph;
|
|
109
110
|
interface EdgeStatement extends SyntaxNode, StatementBase {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
kind: typeof syntaxKind.EdgeStatement;
|
|
112
|
+
source: EdgeSourceOrTarget;
|
|
113
|
+
rhs: SyntaxNodeArray<EdgeRhs>;
|
|
114
|
+
attributes: SyntaxNodeArray<AttributeContainer>;
|
|
114
115
|
}
|
|
115
116
|
interface AttributeStatement extends SyntaxNode, StatementBase {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
kind: typeof syntaxKind.AttributeStatement;
|
|
118
|
+
subject: Token<typeof syntaxKind.GraphKeyword> | Token<typeof syntaxKind.NodeKeyword> | Token<typeof syntaxKind.EdgeKeyword>;
|
|
119
|
+
attributes: SyntaxNodeArray<AttributeContainer>;
|
|
119
120
|
}
|
|
120
121
|
interface IdEqualsIdStatement extends SyntaxNode, StatementBase {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
kind: typeof syntaxKind.IdEqualsIdStatement;
|
|
123
|
+
leftId: Identifier;
|
|
124
|
+
rightId: Identifier;
|
|
124
125
|
}
|
|
125
126
|
interface SubGraph extends SyntaxNode {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
kind: typeof syntaxKind.SubGraph;
|
|
128
|
+
id?: Identifier;
|
|
129
|
+
statements: SyntaxNodeArray<Statement>;
|
|
129
130
|
}
|
|
130
131
|
interface SubGraphStatement extends SyntaxNode, StatementBase {
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
kind: typeof syntaxKind.SubGraphStatement;
|
|
133
|
+
subgraph: SubGraph;
|
|
133
134
|
}
|
|
134
135
|
interface EdgeRhs extends SyntaxNode {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
kind: typeof syntaxKind.EdgeRhs;
|
|
137
|
+
operation: EdgeOp;
|
|
138
|
+
target: EdgeSourceOrTarget;
|
|
138
139
|
}
|
|
139
140
|
interface AttributeContainer extends SyntaxNode {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
kind: typeof syntaxKind.AttributeContainer;
|
|
142
|
+
openBracket: Token<typeof syntaxKind.OpenBracketToken>;
|
|
143
|
+
assignments: SyntaxNodeArray<Assignment>;
|
|
144
|
+
closeBracket: Token<typeof syntaxKind.CloseBracketToken>;
|
|
144
145
|
}
|
|
145
146
|
interface Assignment extends SyntaxNode {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
kind: typeof syntaxKind.Assignment;
|
|
148
|
+
leftId: Identifier;
|
|
149
|
+
rightId: Identifier;
|
|
150
|
+
terminator?: AssignmentSeparator;
|
|
150
151
|
}
|
|
151
152
|
type AssignmentSeparator = Token<typeof syntaxKind.SemicolonToken> | Token<typeof syntaxKind.CommaToken>;
|
|
152
153
|
type PortDeclaration = NormalPortDeclaration | CompassPortDeclaration;
|
|
153
154
|
interface NormalPortDeclaration extends SyntaxNode {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
kind: typeof syntaxKind.NormalPortDeclaration;
|
|
156
|
+
colon: Token<typeof syntaxKind.ColonToken>;
|
|
157
|
+
id: Identifier;
|
|
158
|
+
compassPt?: CompassPortDeclaration;
|
|
158
159
|
}
|
|
159
160
|
interface CompassPortDeclaration extends SyntaxNode {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
kind: typeof syntaxKind.CompassPortDeclaration;
|
|
162
|
+
colon: Token<typeof syntaxKind.ColonToken>;
|
|
163
|
+
compassPt: CompassPort;
|
|
163
164
|
}
|
|
164
165
|
type CompassPort = Token<typeof syntaxKind.CompassNorthToken> | Token<typeof syntaxKind.CompassNorthEastToken> | Token<typeof syntaxKind.CompassEastToken> | Token<typeof syntaxKind.CompassSouthEastToken> | Token<typeof syntaxKind.CompassSouthToken> | Token<typeof syntaxKind.CompassSouthWestToken> | Token<typeof syntaxKind.CompassWestToken> | Token<typeof syntaxKind.CompassNorthWestToken> | Token<typeof syntaxKind.CompassCenterToken> | Token<typeof syntaxKind.UnderscoreToken>;
|
|
165
166
|
type EdgeOp = Token<typeof syntaxKind.DirectedEdgeOp> | Token<typeof syntaxKind.UndirectedEdgeOp>;
|
|
166
167
|
interface TextRange {
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
pos: number;
|
|
169
|
+
end: number;
|
|
169
170
|
}
|
|
170
171
|
type SyntaxKind = (typeof syntaxKind)[keyof typeof syntaxKind];
|
|
171
172
|
declare const syntaxKind: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
173
|
+
readonly Unknown: 0;
|
|
174
|
+
readonly EndOfFileToken: 1;
|
|
175
|
+
readonly NewLineTrivia: 2;
|
|
176
|
+
readonly WhitespaceTrivia: 3;
|
|
177
|
+
readonly HashCommentTrivia: 4;
|
|
178
|
+
readonly SingleLineCommentTrivia: 5;
|
|
179
|
+
readonly MultiLineCommentTrivia: 6;
|
|
180
|
+
readonly CommaToken: 7;
|
|
181
|
+
readonly SemicolonToken: 8;
|
|
182
|
+
readonly PlusToken: 9;
|
|
183
|
+
readonly OpenBraceToken: 10;
|
|
184
|
+
readonly CloseBraceToken: 11;
|
|
185
|
+
readonly OpenBracketToken: 12;
|
|
186
|
+
readonly CloseBracketToken: 13;
|
|
187
|
+
readonly ColonToken: 14;
|
|
188
|
+
readonly EqualsToken: 15;
|
|
189
|
+
readonly LessThan: 16;
|
|
190
|
+
readonly GreaterThan: 17;
|
|
191
|
+
readonly CompassNorthToken: 18;
|
|
192
|
+
readonly CompassNorthEastToken: 19;
|
|
193
|
+
readonly CompassEastToken: 20;
|
|
194
|
+
readonly CompassSouthEastToken: 21;
|
|
195
|
+
readonly CompassSouthToken: 22;
|
|
196
|
+
readonly CompassSouthWestToken: 23;
|
|
197
|
+
readonly CompassWestToken: 24;
|
|
198
|
+
readonly CompassNorthWestToken: 25;
|
|
199
|
+
readonly CompassCenterToken: 26;
|
|
200
|
+
readonly UnderscoreToken: 27;
|
|
201
|
+
readonly StringLiteral: 28;
|
|
202
|
+
readonly HtmlIdentifier: 29;
|
|
203
|
+
readonly TextIdentifier: 30;
|
|
204
|
+
readonly QuotedTextIdentifier: 31;
|
|
205
|
+
readonly NumericIdentifier: 32;
|
|
206
|
+
readonly GraphKeyword: 33;
|
|
207
|
+
readonly DigraphKeyword: 34;
|
|
208
|
+
readonly NodeKeyword: 35;
|
|
209
|
+
readonly EdgeKeyword: 36;
|
|
210
|
+
readonly SubgraphKeyword: 37;
|
|
211
|
+
readonly StrictKeyword: 38;
|
|
212
|
+
readonly DirectedEdgeOp: 39;
|
|
213
|
+
readonly UndirectedEdgeOp: 40;
|
|
214
|
+
readonly DirectedGraph: 41;
|
|
215
|
+
readonly UndirectedGraph: 42;
|
|
216
|
+
readonly NodeStatement: 43;
|
|
217
|
+
readonly EdgeStatement: 44;
|
|
218
|
+
readonly AttributeStatement: 45;
|
|
219
|
+
readonly IdEqualsIdStatement: 46;
|
|
220
|
+
readonly SubGraph: 47;
|
|
221
|
+
readonly SubGraphStatement: 48;
|
|
222
|
+
readonly EdgeRhs: 49;
|
|
223
|
+
readonly AttributeContainer: 50;
|
|
224
|
+
readonly Assignment: 51;
|
|
225
|
+
readonly NormalPortDeclaration: 52;
|
|
226
|
+
readonly CompassPortDeclaration: 53;
|
|
227
|
+
readonly NodeId: 54;
|
|
228
|
+
readonly Count: 55;
|
|
229
|
+
readonly FirstNode: 41;
|
|
230
|
+
readonly CompassBegin: 18;
|
|
231
|
+
readonly CompassEnd: 27;
|
|
232
|
+
readonly LastKeyword: 38;
|
|
232
233
|
};
|
|
233
234
|
declare const syntaxKindNames: {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
235
|
+
readonly 0: "Unknown";
|
|
236
|
+
readonly 1: "EndOfFileToken";
|
|
237
|
+
readonly 2: "NewLineTrivia";
|
|
238
|
+
readonly 3: "WhitespaceTrivia";
|
|
239
|
+
readonly 4: "HashCommentTrivia";
|
|
240
|
+
readonly 5: "SingleLineCommentTrivia";
|
|
241
|
+
readonly 6: "MultiLineCommentTrivia";
|
|
242
|
+
readonly 7: "CommaToken";
|
|
243
|
+
readonly 8: "SemicolonToken";
|
|
244
|
+
readonly 9: "PlusToken";
|
|
245
|
+
readonly 10: "OpenBraceToken";
|
|
246
|
+
readonly 11: "CloseBraceToken";
|
|
247
|
+
readonly 12: "OpenBracketToken";
|
|
248
|
+
readonly 13: "CloseBracketToken";
|
|
249
|
+
readonly 14: "ColonToken";
|
|
250
|
+
readonly 15: "EqualsToken";
|
|
251
|
+
readonly 16: "LessThan";
|
|
252
|
+
readonly 17: "GreaterThan";
|
|
253
|
+
readonly 18: "CompassNorthToken";
|
|
254
|
+
readonly 19: "CompassNorthEastToken";
|
|
255
|
+
readonly 20: "CompassEastToken";
|
|
256
|
+
readonly 21: "CompassSouthEastToken";
|
|
257
|
+
readonly 22: "CompassSouthToken";
|
|
258
|
+
readonly 23: "CompassSouthWestToken";
|
|
259
|
+
readonly 24: "CompassWestToken";
|
|
260
|
+
readonly 25: "CompassNorthWestToken";
|
|
261
|
+
readonly 26: "CompassCenterToken";
|
|
262
|
+
readonly 27: "UnderscoreToken";
|
|
263
|
+
readonly 28: "StringLiteral";
|
|
264
|
+
readonly 29: "HtmlIdentifier";
|
|
265
|
+
readonly 30: "TextIdentifier";
|
|
266
|
+
readonly 31: "QuotedTextIdentifier";
|
|
267
|
+
readonly 32: "NumericIdentifier";
|
|
268
|
+
readonly 33: "GraphKeyword";
|
|
269
|
+
readonly 34: "DigraphKeyword";
|
|
270
|
+
readonly 35: "NodeKeyword";
|
|
271
|
+
readonly 36: "EdgeKeyword";
|
|
272
|
+
readonly 37: "SubgraphKeyword";
|
|
273
|
+
readonly 38: "StrictKeyword";
|
|
274
|
+
readonly 39: "DirectedEdgeOp";
|
|
275
|
+
readonly 40: "UndirectedEdgeOp";
|
|
276
|
+
readonly 41: "DirectedGraph";
|
|
277
|
+
readonly 42: "UndirectedGraph";
|
|
278
|
+
readonly 43: "NodeStatement";
|
|
279
|
+
readonly 44: "EdgeStatement";
|
|
280
|
+
readonly 45: "AttributeStatement";
|
|
281
|
+
readonly 46: "IdEqualsIdStatement";
|
|
282
|
+
readonly 47: "SubGraph";
|
|
283
|
+
readonly 48: "SubGraphStatement";
|
|
284
|
+
readonly 49: "EdgeRhs";
|
|
285
|
+
readonly 50: "AttributeContainer";
|
|
286
|
+
readonly 51: "Assignment";
|
|
287
|
+
readonly 52: "NormalPortDeclaration";
|
|
288
|
+
readonly 53: "CompassPortDeclaration";
|
|
289
|
+
readonly 54: "NodeId";
|
|
290
|
+
readonly 55: "Count";
|
|
290
291
|
};
|
|
291
292
|
interface SyntaxNode extends TextRange {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
kind: SyntaxKind;
|
|
294
|
+
flags: SyntaxNodeFlags;
|
|
295
|
+
graphContext?: GraphContext;
|
|
296
|
+
parent?: SyntaxNode;
|
|
297
|
+
symbol?: TypeSymbol;
|
|
297
298
|
}
|
|
298
299
|
interface Token<TKind extends SyntaxKind> extends SyntaxNode {
|
|
299
|
-
|
|
300
|
+
kind: TKind;
|
|
300
301
|
}
|
|
301
302
|
interface SyntaxNodeArray<T extends SyntaxNode> extends ReadonlyArray<T>, TextRange {
|
|
302
|
-
|
|
303
|
+
hasTrailingComma?: boolean;
|
|
303
304
|
}
|
|
304
305
|
type MutableSyntaxNodeArray<T extends SyntaxNode> = SyntaxNodeArray<T> & T[];
|
|
305
306
|
declare const syntaxNodeFlags: {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
readonly None: 0;
|
|
308
|
+
readonly ContainsErrors: number;
|
|
309
|
+
readonly Synthesized: number;
|
|
309
310
|
};
|
|
310
311
|
type SyntaxNodeFlags = (typeof syntaxNodeFlags)[keyof typeof syntaxNodeFlags];
|
|
311
312
|
declare const graphContext: {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
readonly None: 0;
|
|
314
|
+
readonly Strict: number;
|
|
315
|
+
readonly Directed: number;
|
|
316
|
+
readonly Undirected: number;
|
|
316
317
|
};
|
|
317
318
|
type GraphContext = (typeof graphContext)[keyof typeof graphContext];
|
|
318
319
|
declare const tokenFlags: {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
readonly None: 0;
|
|
321
|
+
readonly Unterminated: number;
|
|
322
|
+
readonly PrecedingLineBreak: number;
|
|
322
323
|
};
|
|
323
324
|
type TokenFlags = (typeof tokenFlags)[keyof typeof tokenFlags];
|
|
324
325
|
type CharacterCodes = (typeof characterCodes)[keyof typeof characterCodes];
|
|
325
326
|
declare const characterCodes: {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
327
|
+
readonly nullCharacter: 0;
|
|
328
|
+
readonly maxAsciiCharacter: 127;
|
|
329
|
+
readonly lineFeed: 10;
|
|
330
|
+
readonly carriageReturn: 13;
|
|
331
|
+
readonly lineSeparator: 8232;
|
|
332
|
+
readonly paragraphSeparator: 8233;
|
|
333
|
+
readonly nextLine: 133;
|
|
334
|
+
readonly space: 32;
|
|
335
|
+
readonly nonBreakingSpace: 160;
|
|
336
|
+
readonly enQuad: 8192;
|
|
337
|
+
readonly emQuad: 8193;
|
|
338
|
+
readonly enSpace: 8194;
|
|
339
|
+
readonly emSpace: 8195;
|
|
340
|
+
readonly threePerEmSpace: 8196;
|
|
341
|
+
readonly fourPerEmSpace: 8197;
|
|
342
|
+
readonly sixPerEmSpace: 8198;
|
|
343
|
+
readonly figureSpace: 8199;
|
|
344
|
+
readonly punctuationSpace: 8200;
|
|
345
|
+
readonly thinSpace: 8201;
|
|
346
|
+
readonly hairSpace: 8202;
|
|
347
|
+
readonly zeroWidthSpace: 8203;
|
|
348
|
+
readonly narrowNoBreakSpace: 8239;
|
|
349
|
+
readonly ideographicSpace: 12288;
|
|
350
|
+
readonly mathematicalSpace: 8287;
|
|
351
|
+
readonly ogham: 5760;
|
|
352
|
+
readonly _: 95;
|
|
353
|
+
readonly $: 36;
|
|
354
|
+
readonly _0: 48;
|
|
355
|
+
readonly _1: 49;
|
|
356
|
+
readonly _2: 50;
|
|
357
|
+
readonly _3: 51;
|
|
358
|
+
readonly _4: 52;
|
|
359
|
+
readonly _5: 53;
|
|
360
|
+
readonly _6: 54;
|
|
361
|
+
readonly _7: 55;
|
|
362
|
+
readonly _8: 56;
|
|
363
|
+
readonly _9: 57;
|
|
364
|
+
readonly a: 97;
|
|
365
|
+
readonly b: 98;
|
|
366
|
+
readonly c: 99;
|
|
367
|
+
readonly d: 100;
|
|
368
|
+
readonly e: 101;
|
|
369
|
+
readonly f: 102;
|
|
370
|
+
readonly g: 103;
|
|
371
|
+
readonly h: 104;
|
|
372
|
+
readonly i: 105;
|
|
373
|
+
readonly j: 106;
|
|
374
|
+
readonly k: 107;
|
|
375
|
+
readonly l: 108;
|
|
376
|
+
readonly m: 109;
|
|
377
|
+
readonly n: 110;
|
|
378
|
+
readonly o: 111;
|
|
379
|
+
readonly p: 112;
|
|
380
|
+
readonly q: 113;
|
|
381
|
+
readonly r: 114;
|
|
382
|
+
readonly s: 115;
|
|
383
|
+
readonly t: 116;
|
|
384
|
+
readonly u: 117;
|
|
385
|
+
readonly v: 118;
|
|
386
|
+
readonly w: 119;
|
|
387
|
+
readonly x: 120;
|
|
388
|
+
readonly y: 121;
|
|
389
|
+
readonly z: 122;
|
|
390
|
+
readonly A: 65;
|
|
391
|
+
readonly B: 66;
|
|
392
|
+
readonly C: 67;
|
|
393
|
+
readonly D: 68;
|
|
394
|
+
readonly E: 69;
|
|
395
|
+
readonly F: 70;
|
|
396
|
+
readonly G: 71;
|
|
397
|
+
readonly H: 72;
|
|
398
|
+
readonly I: 73;
|
|
399
|
+
readonly J: 74;
|
|
400
|
+
readonly K: 75;
|
|
401
|
+
readonly L: 76;
|
|
402
|
+
readonly M: 77;
|
|
403
|
+
readonly N: 78;
|
|
404
|
+
readonly O: 79;
|
|
405
|
+
readonly P: 80;
|
|
406
|
+
readonly Q: 81;
|
|
407
|
+
readonly R: 82;
|
|
408
|
+
readonly S: 83;
|
|
409
|
+
readonly T: 84;
|
|
410
|
+
readonly U: 85;
|
|
411
|
+
readonly V: 86;
|
|
412
|
+
readonly W: 87;
|
|
413
|
+
readonly X: 88;
|
|
414
|
+
readonly Y: 89;
|
|
415
|
+
readonly Z: 90;
|
|
416
|
+
readonly ampersand: 38;
|
|
417
|
+
readonly asterisk: 42;
|
|
418
|
+
readonly at: 64;
|
|
419
|
+
readonly backslash: 92;
|
|
420
|
+
readonly backtick: 96;
|
|
421
|
+
readonly bar: 124;
|
|
422
|
+
readonly caret: 94;
|
|
423
|
+
readonly closeBrace: 125;
|
|
424
|
+
readonly closeBracket: 93;
|
|
425
|
+
readonly closeParen: 41;
|
|
426
|
+
readonly colon: 58;
|
|
427
|
+
readonly comma: 44;
|
|
428
|
+
readonly dot: 46;
|
|
429
|
+
readonly doubleQuote: 34;
|
|
430
|
+
readonly equals: 61;
|
|
431
|
+
readonly exclamation: 33;
|
|
432
|
+
readonly greaterThan: 62;
|
|
433
|
+
readonly hash: 35;
|
|
434
|
+
readonly lessThan: 60;
|
|
435
|
+
readonly minus: 45;
|
|
436
|
+
readonly openBrace: 123;
|
|
437
|
+
readonly openBracket: 91;
|
|
438
|
+
readonly openParen: 40;
|
|
439
|
+
readonly percent: 37;
|
|
440
|
+
readonly plus: 43;
|
|
441
|
+
readonly question: 63;
|
|
442
|
+
readonly semicolon: 59;
|
|
443
|
+
readonly singleQuote: 39;
|
|
444
|
+
readonly slash: 47;
|
|
445
|
+
readonly tilde: 126;
|
|
446
|
+
readonly backspace: 8;
|
|
447
|
+
readonly formFeed: 12;
|
|
448
|
+
readonly byteOrderMark: 65279;
|
|
449
|
+
readonly tab: 9;
|
|
450
|
+
readonly verticalTab: 11;
|
|
450
451
|
};
|
|
451
452
|
type SymbolTable = Map<string, TypeSymbol>;
|
|
452
453
|
type ColorTable = Map<string, ColorInfo>;
|
|
453
454
|
interface TypeSymbol {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
name: string;
|
|
456
|
+
firstMention: SyntaxNode;
|
|
457
|
+
references?: SyntaxNode[];
|
|
458
|
+
members?: SymbolTable;
|
|
458
459
|
}
|
|
459
460
|
interface ColorInfo {
|
|
460
|
-
|
|
461
|
+
node: SyntaxNode;
|
|
461
462
|
}
|
|
462
463
|
interface Color {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
readonly red: number;
|
|
465
|
+
readonly green: number;
|
|
466
|
+
readonly blue: number;
|
|
467
|
+
readonly alpha: number;
|
|
467
468
|
}
|
|
468
469
|
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
469
470
|
type StatementOf<T extends Statement["kind"]> = T extends typeof syntaxKind.SubGraphStatement ? SubGraphStatement : T extends typeof syntaxKind.AttributeStatement ? AttributeStatement : T extends typeof syntaxKind.EdgeStatement ? EdgeStatement : T extends typeof syntaxKind.IdEqualsIdStatement ? IdEqualsIdStatement : T extends typeof syntaxKind.NodeStatement ? NodeStatement : never;
|
|
470
|
-
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/scanner.d.ts
|
|
471
473
|
interface Scanner {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
474
|
+
readonly end: number;
|
|
475
|
+
readonly pos: number;
|
|
476
|
+
readonly startPos: number;
|
|
477
|
+
readonly tokenPos: number;
|
|
478
|
+
readonly token: SyntaxKind;
|
|
479
|
+
readonly tokenValue: string | undefined;
|
|
480
|
+
readonly isUnterminated: boolean;
|
|
481
|
+
readonly text: string;
|
|
482
|
+
readonly onError: ErrorCallback | null;
|
|
483
|
+
setText(newText?: string, start?: number, length?: number): void;
|
|
484
|
+
setErrorCallback(cb: ErrorCallback): void;
|
|
485
|
+
scan(skipTrivia: boolean): SyntaxKind;
|
|
486
|
+
lookAhead(callback: () => SyntaxKind | boolean): SyntaxKind | boolean;
|
|
487
|
+
tryScan(callback: () => SyntaxKind | boolean): SyntaxKind | boolean;
|
|
486
488
|
}
|
|
487
489
|
declare function getTokenAsText(token: SyntaxKind): string | undefined;
|
|
488
490
|
declare function getTextAsToken(token: string): SyntaxKind | undefined;
|
|
489
491
|
type ErrorCallback = (message: string, category: DiagnosticCategory, sub: ScanError, length: number) => void;
|
|
490
492
|
declare class DefaultScanner implements Scanner {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
493
|
+
#private;
|
|
494
|
+
end: number;
|
|
495
|
+
pos: number;
|
|
496
|
+
startPos: number;
|
|
497
|
+
tokenPos: number;
|
|
498
|
+
token: SyntaxKind;
|
|
499
|
+
tokenValue: string | undefined;
|
|
500
|
+
tokenFlags: TokenFlags;
|
|
501
|
+
isUnterminated: boolean;
|
|
502
|
+
text: string;
|
|
503
|
+
onError: ErrorCallback | null;
|
|
504
|
+
setText(newText?: string, start?: number, length?: number): void;
|
|
505
|
+
setErrorCallback(cb: ErrorCallback | null): void;
|
|
506
|
+
scan(skipTrivia?: boolean): SyntaxKind;
|
|
507
|
+
lookAhead<T extends SyntaxKind>(callback: () => T): T;
|
|
508
|
+
tryScan<T extends SyntaxKind>(callback: () => T): T;
|
|
507
509
|
}
|
|
508
510
|
declare function isIdentifierStart(ch: number): boolean;
|
|
509
511
|
declare function skipTrivia(text: string, pos: number): number;
|
|
510
512
|
declare function isLineBreak(ch: number): boolean;
|
|
511
|
-
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region src/parser.d.ts
|
|
512
515
|
type ParsingContext = (typeof parsingContext)[keyof typeof parsingContext];
|
|
513
516
|
declare const parsingContext: {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
readonly None: 0;
|
|
518
|
+
readonly StatementList: 1;
|
|
519
|
+
readonly AttributeContainerList: 2;
|
|
520
|
+
readonly AssignmentList: 3;
|
|
521
|
+
readonly EdgeRhsList: 4;
|
|
522
|
+
readonly QuotedTextIdentifierConcatenation: 5;
|
|
523
|
+
readonly Count: 6;
|
|
521
524
|
};
|
|
522
525
|
declare class Parser {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
526
|
+
#private;
|
|
527
|
+
currentToken: SyntaxKind;
|
|
528
|
+
nodeCount: number;
|
|
529
|
+
identifiers: Set<string>;
|
|
530
|
+
identifierCount: number;
|
|
531
|
+
sourceText: string;
|
|
532
|
+
scanner: Scanner;
|
|
533
|
+
currentNodeHasError: boolean;
|
|
534
|
+
currentContext: ParsingContext;
|
|
535
|
+
diagnostics: DiagnosticMessage[];
|
|
536
|
+
constructor();
|
|
537
|
+
parse(sourceText: string): SourceFile;
|
|
535
538
|
}
|
|
536
539
|
declare function isIdentifier(kind: SyntaxKind): kind is 29 | 30 | 31 | 32;
|
|
537
540
|
declare function isIdentifierNode(node: SyntaxNode): node is Identifier;
|
|
538
|
-
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/service/service.d.ts
|
|
539
543
|
interface DocumentLike {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
544
|
+
positionAt(offset: number): lst.Position;
|
|
545
|
+
offsetAt(position: lst.Position): number;
|
|
546
|
+
readonly uri: string;
|
|
543
547
|
}
|
|
544
548
|
interface CommandApplication {
|
|
545
|
-
|
|
546
|
-
|
|
549
|
+
label?: string;
|
|
550
|
+
edit: lst.WorkspaceEdit;
|
|
547
551
|
}
|
|
548
552
|
interface LanguageService {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
553
|
+
parseDocument(doc: TextDocument | string): SourceFile;
|
|
554
|
+
validateDocument(doc: DocumentLike, sourceFile: SourceFile): lst.Diagnostic[];
|
|
555
|
+
hover(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.Hover | undefined;
|
|
556
|
+
findReferences(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position, context: lst.ReferenceContext): lst.Location[];
|
|
557
|
+
findDefinition(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.Location | undefined;
|
|
558
|
+
renameSymbol(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position, newName: string): lst.WorkspaceEdit | undefined;
|
|
559
|
+
getCompletions(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.CompletionItem[];
|
|
560
|
+
getDocumentColors(doc: DocumentLike, sourceFile: SourceFile): ColorInformation[] | undefined;
|
|
561
|
+
getColorRepresentations(doc: DocumentLike, sourceFile: SourceFile, color: Color$1, range: lst.Range): ColorPresentation[] | undefined;
|
|
562
|
+
getCodeActions(doc: DocumentLike, sourceFile: SourceFile, range: lst.Range, context: lst.CodeActionContext): lst.Command[] | undefined;
|
|
563
|
+
executeCommand(doc: DocumentLike, sourceFile: SourceFile, command: Omit<lst.Command, "title">): CommandApplication | undefined;
|
|
564
|
+
getAvailableCommands(): string[];
|
|
561
565
|
}
|
|
562
566
|
declare function createService(): LanguageService;
|
|
563
|
-
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/visitor.d.ts
|
|
564
569
|
declare function forEachChild<TReturn>(node: SyntaxNode, cbNode: (node: SyntaxNode) => TReturn, cbNodes?: (nodes: SyntaxNodeArray<SyntaxNode>) => TReturn): TReturn | undefined;
|
|
565
|
-
|
|
566
|
-
export {
|
|
570
|
+
//#endregion
|
|
571
|
+
export { Assignment, AssignmentSeparator, AttributeContainer, AttributeStatement, CharacterCodes, CheckError, CheckErrorCode, Color, ColorInfo, ColorTable, CommandApplication, CompassPort, CompassPortDeclaration, DefaultScanner, DiagnosticCategory, DiagnosticMessage, DocumentLike, EdgeOp, EdgeRhs, EdgeSourceOrTarget, EdgeStatement, ErrorCallback, ErrorCode, ErrorSource, Graph, GraphContext, HtmlIdentifier, ID, IdEqualsIdStatement, Identifier, LanguageService, MutableSyntaxNodeArray, NodeId, NodeStatement, NormalPortDeclaration, NumericIdentifier, Omit, ParseError, ParseErrorCode, Parser, ParsingContext, PortDeclaration, QuotedTextIdentifier, ScanError, ScanErrorCode, Scanner, SourceFile, Statement, StatementBase, StatementOf, StatementSeparator, StringLiteral, SubGraph, SubGraphStatement, SymbolTable, SyntaxKind, SyntaxNode, SyntaxNodeArray, SyntaxNodeFlags, TextIdentifier, TextRange, Token, TokenFlags, TypeSymbol, characterCodes, checkError, createService, diagnosticCategory, errorSource, forEachChild, getTextAsToken, getTokenAsText, graphContext, isIdentifier, isIdentifierNode, isIdentifierStart, isLineBreak, parseError, parsingContext, scanError, skipTrivia, syntaxKind, syntaxKindNames, syntaxNodeFlags, tokenFlags };
|