vscode-css-languageservice 5.4.2 → 6.1.0
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/CHANGELOG.md +7 -1
- package/SECURITY.md +41 -0
- package/lib/esm/beautify/beautify-css.js +11 -4
- package/lib/esm/cssLanguageService.d.ts +2 -1
- package/lib/esm/cssLanguageService.js +15 -17
- package/lib/esm/cssLanguageTypes.js +2 -2
- package/lib/esm/data/webCustomData.js +356 -232
- package/lib/esm/languageFacts/builtinData.js +15 -15
- package/lib/esm/languageFacts/colors.js +66 -69
- package/lib/esm/languageFacts/dataManager.js +38 -42
- package/lib/esm/languageFacts/dataProvider.js +17 -23
- package/lib/esm/languageFacts/entry.js +22 -23
- package/lib/esm/parser/cssErrors.js +5 -7
- package/lib/esm/parser/cssNodes.js +869 -1377
- package/lib/esm/parser/cssParser.js +419 -376
- package/lib/esm/parser/cssScanner.js +168 -175
- package/lib/esm/parser/cssSymbolScope.js +107 -137
- package/lib/esm/parser/lessParser.js +177 -202
- package/lib/esm/parser/lessScanner.js +22 -43
- package/lib/esm/parser/scssErrors.js +5 -7
- package/lib/esm/parser/scssParser.js +196 -208
- package/lib/esm/parser/scssScanner.js +33 -54
- package/lib/esm/services/cssCodeActions.js +36 -40
- package/lib/esm/services/cssCompletion.js +300 -395
- package/lib/esm/services/cssFolding.js +32 -35
- package/lib/esm/services/cssFormatter.js +22 -22
- package/lib/esm/services/cssHover.js +30 -33
- package/lib/esm/services/cssNavigation.js +260 -289
- package/lib/esm/services/cssSelectionRange.js +6 -6
- package/lib/esm/services/cssValidation.js +13 -16
- package/lib/esm/services/lessCompletion.js +351 -370
- package/lib/esm/services/lint.js +161 -175
- package/lib/esm/services/lintRules.js +20 -27
- package/lib/esm/services/lintUtil.js +19 -28
- package/lib/esm/services/pathCompletion.js +84 -158
- package/lib/esm/services/scssCompletion.js +283 -307
- package/lib/esm/services/scssNavigation.js +65 -137
- package/lib/esm/services/selectorPrinting.js +131 -175
- package/lib/esm/utils/arrays.js +6 -12
- package/lib/esm/utils/objects.js +1 -1
- package/lib/esm/utils/resources.js +3 -16
- package/lib/esm/utils/strings.js +10 -12
- package/lib/umd/beautify/beautify-css.js +11 -4
- package/lib/umd/cssLanguageService.d.ts +2 -1
- package/lib/umd/cssLanguageService.js +34 -32
- package/lib/umd/cssLanguageTypes.js +4 -3
- package/lib/umd/data/webCustomData.js +355 -231
- package/lib/umd/languageFacts/colors.js +65 -68
- package/lib/umd/languageFacts/dataManager.js +41 -44
- package/lib/umd/languageFacts/dataProvider.js +17 -22
- package/lib/umd/languageFacts/entry.js +22 -23
- package/lib/umd/languageFacts/facts.js +5 -1
- package/lib/umd/parser/cssErrors.js +5 -6
- package/lib/umd/parser/cssNodes.js +870 -1307
- package/lib/umd/parser/cssParser.js +424 -380
- package/lib/umd/parser/cssScanner.js +168 -173
- package/lib/umd/parser/cssSymbolScope.js +109 -134
- package/lib/umd/parser/lessParser.js +182 -206
- package/lib/umd/parser/lessScanner.js +22 -42
- package/lib/umd/parser/scssErrors.js +5 -6
- package/lib/umd/parser/scssParser.js +202 -213
- package/lib/umd/parser/scssScanner.js +25 -45
- package/lib/umd/services/cssCodeActions.js +41 -44
- package/lib/umd/services/cssCompletion.js +308 -402
- package/lib/umd/services/cssFolding.js +35 -38
- package/lib/umd/services/cssFormatter.js +25 -25
- package/lib/umd/services/cssHover.js +36 -38
- package/lib/umd/services/cssNavigation.js +267 -295
- package/lib/umd/services/cssSelectionRange.js +8 -8
- package/lib/umd/services/cssValidation.js +17 -19
- package/lib/umd/services/lessCompletion.js +354 -372
- package/lib/umd/services/lint.js +167 -180
- package/lib/umd/services/lintRules.js +20 -24
- package/lib/umd/services/lintUtil.js +20 -28
- package/lib/umd/services/pathCompletion.js +87 -160
- package/lib/umd/services/scssCompletion.js +287 -310
- package/lib/umd/services/scssNavigation.js +69 -140
- package/lib/umd/services/selectorPrinting.js +134 -174
- package/lib/umd/utils/arrays.js +6 -12
- package/lib/umd/utils/objects.js +1 -1
- package/lib/umd/utils/resources.js +4 -17
- package/lib/umd/utils/strings.js +10 -12
- package/package.json +16 -15
|
@@ -3,129 +3,105 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
'use strict';
|
|
6
|
-
var __extends = (this && this.__extends) || (function () {
|
|
7
|
-
var extendStatics = function (d, b) {
|
|
8
|
-
extendStatics = Object.setPrototypeOf ||
|
|
9
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
-
return extendStatics(d, b);
|
|
12
|
-
};
|
|
13
|
-
return function (d, b) {
|
|
14
|
-
if (typeof b !== "function" && b !== null)
|
|
15
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() { this.constructor = d; }
|
|
18
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
6
|
import * as nodes from './cssNodes';
|
|
22
7
|
import { findFirst } from '../utils/arrays';
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
export class Scope {
|
|
9
|
+
constructor(offset, length) {
|
|
25
10
|
this.offset = offset;
|
|
26
11
|
this.length = length;
|
|
27
12
|
this.symbols = [];
|
|
28
13
|
this.parent = null;
|
|
29
14
|
this.children = [];
|
|
30
15
|
}
|
|
31
|
-
|
|
16
|
+
addChild(scope) {
|
|
32
17
|
this.children.push(scope);
|
|
33
18
|
scope.setParent(this);
|
|
34
|
-
}
|
|
35
|
-
|
|
19
|
+
}
|
|
20
|
+
setParent(scope) {
|
|
36
21
|
this.parent = scope;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (length === void 0) { length = 0; }
|
|
22
|
+
}
|
|
23
|
+
findScope(offset, length = 0) {
|
|
40
24
|
if (this.offset <= offset && this.offset + this.length > offset + length || this.offset === offset && this.length === length) {
|
|
41
25
|
return this.findInScope(offset, length);
|
|
42
26
|
}
|
|
43
27
|
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (length === void 0) { length = 0; }
|
|
28
|
+
}
|
|
29
|
+
findInScope(offset, length = 0) {
|
|
47
30
|
// find the first scope child that has an offset larger than offset + length
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
const end = offset + length;
|
|
32
|
+
const idx = findFirst(this.children, s => s.offset > end);
|
|
50
33
|
if (idx === 0) {
|
|
51
34
|
// all scopes have offsets larger than our end
|
|
52
35
|
return this;
|
|
53
36
|
}
|
|
54
|
-
|
|
37
|
+
const res = this.children[idx - 1];
|
|
55
38
|
if (res.offset <= offset && res.offset + res.length >= offset + length) {
|
|
56
39
|
return res.findInScope(offset, length);
|
|
57
40
|
}
|
|
58
41
|
return this;
|
|
59
|
-
}
|
|
60
|
-
|
|
42
|
+
}
|
|
43
|
+
addSymbol(symbol) {
|
|
61
44
|
this.symbols.push(symbol);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
for (
|
|
65
|
-
|
|
45
|
+
}
|
|
46
|
+
getSymbol(name, type) {
|
|
47
|
+
for (let index = 0; index < this.symbols.length; index++) {
|
|
48
|
+
const symbol = this.symbols[index];
|
|
66
49
|
if (symbol.name === name && symbol.type === type) {
|
|
67
50
|
return symbol;
|
|
68
51
|
}
|
|
69
52
|
}
|
|
70
53
|
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
54
|
+
}
|
|
55
|
+
getSymbols() {
|
|
73
56
|
return this.symbols;
|
|
74
|
-
};
|
|
75
|
-
return Scope;
|
|
76
|
-
}());
|
|
77
|
-
export { Scope };
|
|
78
|
-
var GlobalScope = /** @class */ (function (_super) {
|
|
79
|
-
__extends(GlobalScope, _super);
|
|
80
|
-
function GlobalScope() {
|
|
81
|
-
return _super.call(this, 0, Number.MAX_VALUE) || this;
|
|
82
57
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
58
|
+
}
|
|
59
|
+
export class GlobalScope extends Scope {
|
|
60
|
+
constructor() {
|
|
61
|
+
super(0, Number.MAX_VALUE);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class Symbol {
|
|
65
|
+
constructor(name, value, node, type) {
|
|
88
66
|
this.name = name;
|
|
89
67
|
this.value = value;
|
|
90
68
|
this.node = node;
|
|
91
69
|
this.type = type;
|
|
92
70
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var ScopeBuilder = /** @class */ (function () {
|
|
97
|
-
function ScopeBuilder(scope) {
|
|
71
|
+
}
|
|
72
|
+
export class ScopeBuilder {
|
|
73
|
+
constructor(scope) {
|
|
98
74
|
this.scope = scope;
|
|
99
75
|
}
|
|
100
|
-
|
|
76
|
+
addSymbol(node, name, value, type) {
|
|
101
77
|
if (node.offset !== -1) {
|
|
102
|
-
|
|
78
|
+
const current = this.scope.findScope(node.offset, node.length);
|
|
103
79
|
if (current) {
|
|
104
80
|
current.addSymbol(new Symbol(name, value, node, type));
|
|
105
81
|
}
|
|
106
82
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
83
|
+
}
|
|
84
|
+
addScope(node) {
|
|
109
85
|
if (node.offset !== -1) {
|
|
110
|
-
|
|
86
|
+
const current = this.scope.findScope(node.offset, node.length);
|
|
111
87
|
if (current && (current.offset !== node.offset || current.length !== node.length)) { // scope already known?
|
|
112
|
-
|
|
88
|
+
const newScope = new Scope(node.offset, node.length);
|
|
113
89
|
current.addChild(newScope);
|
|
114
90
|
return newScope;
|
|
115
91
|
}
|
|
116
92
|
return current;
|
|
117
93
|
}
|
|
118
94
|
return null;
|
|
119
|
-
}
|
|
120
|
-
|
|
95
|
+
}
|
|
96
|
+
addSymbolToChildScope(scopeNode, node, name, value, type) {
|
|
121
97
|
if (scopeNode && scopeNode.offset !== -1) {
|
|
122
|
-
|
|
98
|
+
const current = this.addScope(scopeNode); // create the scope or gets the existing one
|
|
123
99
|
if (current) {
|
|
124
100
|
current.addSymbol(new Symbol(name, value, node, type));
|
|
125
101
|
}
|
|
126
102
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
103
|
+
}
|
|
104
|
+
visitNode(node) {
|
|
129
105
|
switch (node.type) {
|
|
130
106
|
case nodes.NodeType.Keyframe:
|
|
131
107
|
this.addSymbol(node, node.getName(), void 0, nodes.ReferenceType.Keyframe);
|
|
@@ -149,32 +125,30 @@ var ScopeBuilder = /** @class */ (function () {
|
|
|
149
125
|
this.addScope(node);
|
|
150
126
|
return true;
|
|
151
127
|
case nodes.NodeType.For:
|
|
152
|
-
|
|
153
|
-
|
|
128
|
+
const forNode = node;
|
|
129
|
+
const scopeNode = forNode.getDeclarations();
|
|
154
130
|
if (scopeNode && forNode.variable) {
|
|
155
131
|
this.addSymbolToChildScope(scopeNode, forNode.variable, forNode.variable.getName(), void 0, nodes.ReferenceType.Variable);
|
|
156
132
|
}
|
|
157
133
|
return true;
|
|
158
134
|
case nodes.NodeType.Each: {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
for (
|
|
164
|
-
|
|
165
|
-
this.addSymbolToChildScope(scopeNode_1, variable, variable.getName(), void 0, nodes.ReferenceType.Variable);
|
|
135
|
+
const eachNode = node;
|
|
136
|
+
const scopeNode = eachNode.getDeclarations();
|
|
137
|
+
if (scopeNode) {
|
|
138
|
+
const variables = eachNode.getVariables().getChildren();
|
|
139
|
+
for (const variable of variables) {
|
|
140
|
+
this.addSymbolToChildScope(scopeNode, variable, variable.getName(), void 0, nodes.ReferenceType.Variable);
|
|
166
141
|
}
|
|
167
142
|
}
|
|
168
143
|
return true;
|
|
169
144
|
}
|
|
170
145
|
}
|
|
171
146
|
return true;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
147
|
+
}
|
|
148
|
+
visitRuleSet(node) {
|
|
149
|
+
const current = this.scope.findScope(node.offset, node.length);
|
|
175
150
|
if (current) {
|
|
176
|
-
for (
|
|
177
|
-
var child = _a[_i];
|
|
151
|
+
for (const child of node.getSelectors().getChildren()) {
|
|
178
152
|
if (child instanceof nodes.Selector) {
|
|
179
153
|
if (child.getChildren().length === 1) { // only selectors with a single element can be extended
|
|
180
154
|
current.addSymbol(new Symbol(child.getChild(0).getText(), void 0, child, nodes.ReferenceType.Rule));
|
|
@@ -183,48 +157,46 @@ var ScopeBuilder = /** @class */ (function () {
|
|
|
183
157
|
}
|
|
184
158
|
}
|
|
185
159
|
return true;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
160
|
+
}
|
|
161
|
+
visitVariableDeclarationNode(node) {
|
|
162
|
+
const value = node.getValue() ? node.getValue().getText() : void 0;
|
|
189
163
|
this.addSymbol(node, node.getName(), value, nodes.ReferenceType.Variable);
|
|
190
164
|
return true;
|
|
191
|
-
}
|
|
192
|
-
|
|
165
|
+
}
|
|
166
|
+
visitFunctionParameterNode(node) {
|
|
193
167
|
// parameters are part of the body scope
|
|
194
|
-
|
|
168
|
+
const scopeNode = node.getParent().getDeclarations();
|
|
195
169
|
if (scopeNode) {
|
|
196
|
-
|
|
197
|
-
|
|
170
|
+
const valueNode = node.getDefaultValue();
|
|
171
|
+
const value = valueNode ? valueNode.getText() : void 0;
|
|
198
172
|
this.addSymbolToChildScope(scopeNode, node, node.getName(), value, nodes.ReferenceType.Variable);
|
|
199
173
|
}
|
|
200
174
|
return true;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
175
|
+
}
|
|
176
|
+
visitCustomPropertyDeclarationNode(node) {
|
|
177
|
+
const value = node.getValue() ? node.getValue().getText() : '';
|
|
204
178
|
this.addCSSVariable(node.getProperty(), node.getProperty().getName(), value, nodes.ReferenceType.Variable);
|
|
205
179
|
return true;
|
|
206
|
-
}
|
|
207
|
-
|
|
180
|
+
}
|
|
181
|
+
addCSSVariable(node, name, value, type) {
|
|
208
182
|
if (node.offset !== -1) {
|
|
209
183
|
this.scope.addSymbol(new Symbol(name, value, node, type));
|
|
210
184
|
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var Symbols = /** @class */ (function () {
|
|
216
|
-
function Symbols(node) {
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export class Symbols {
|
|
188
|
+
constructor(node) {
|
|
217
189
|
this.global = new GlobalScope();
|
|
218
190
|
node.acceptVisitor(new ScopeBuilder(this.global));
|
|
219
191
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
192
|
+
findSymbolsAtOffset(offset, referenceType) {
|
|
193
|
+
let scope = this.global.findScope(offset, 0);
|
|
194
|
+
const result = [];
|
|
195
|
+
const names = {};
|
|
224
196
|
while (scope) {
|
|
225
|
-
|
|
226
|
-
for (
|
|
227
|
-
|
|
197
|
+
const symbols = scope.getSymbols();
|
|
198
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
199
|
+
const symbol = symbols[i];
|
|
228
200
|
if (symbol.type === referenceType && !names[symbol.name]) {
|
|
229
201
|
result.push(symbol);
|
|
230
202
|
names[symbol.name] = true;
|
|
@@ -233,16 +205,16 @@ var Symbols = /** @class */ (function () {
|
|
|
233
205
|
scope = scope.parent;
|
|
234
206
|
}
|
|
235
207
|
return result;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
208
|
+
}
|
|
209
|
+
internalFindSymbol(node, referenceTypes) {
|
|
210
|
+
let scopeNode = node;
|
|
239
211
|
if (node.parent instanceof nodes.FunctionParameter && node.parent.getParent() instanceof nodes.BodyDeclaration) {
|
|
240
212
|
scopeNode = node.parent.getParent().getDeclarations();
|
|
241
213
|
}
|
|
242
214
|
if (node.parent instanceof nodes.FunctionArgument && node.parent.getParent() instanceof nodes.Function) {
|
|
243
|
-
|
|
215
|
+
const funcId = node.parent.getParent().getIdentifier();
|
|
244
216
|
if (funcId) {
|
|
245
|
-
|
|
217
|
+
const functionSymbol = this.internalFindSymbol(funcId, [nodes.ReferenceType.Function]);
|
|
246
218
|
if (functionSymbol) {
|
|
247
219
|
scopeNode = functionSymbol.node.getDeclarations();
|
|
248
220
|
}
|
|
@@ -251,12 +223,12 @@ var Symbols = /** @class */ (function () {
|
|
|
251
223
|
if (!scopeNode) {
|
|
252
224
|
return null;
|
|
253
225
|
}
|
|
254
|
-
|
|
255
|
-
|
|
226
|
+
const name = node.getText();
|
|
227
|
+
let scope = this.global.findScope(scopeNode.offset, scopeNode.length);
|
|
256
228
|
while (scope) {
|
|
257
|
-
for (
|
|
258
|
-
|
|
259
|
-
|
|
229
|
+
for (let index = 0; index < referenceTypes.length; index++) {
|
|
230
|
+
const type = referenceTypes[index];
|
|
231
|
+
const symbol = scope.getSymbol(name, type);
|
|
260
232
|
if (symbol) {
|
|
261
233
|
return symbol;
|
|
262
234
|
}
|
|
@@ -264,10 +236,10 @@ var Symbols = /** @class */ (function () {
|
|
|
264
236
|
scope = scope.parent;
|
|
265
237
|
}
|
|
266
238
|
return null;
|
|
267
|
-
}
|
|
268
|
-
|
|
239
|
+
}
|
|
240
|
+
evaluateReferenceTypes(node) {
|
|
269
241
|
if (node instanceof nodes.Identifier) {
|
|
270
|
-
|
|
242
|
+
const referenceTypes = node.referenceTypes;
|
|
271
243
|
if (referenceTypes) {
|
|
272
244
|
return referenceTypes;
|
|
273
245
|
}
|
|
@@ -276,9 +248,9 @@ var Symbols = /** @class */ (function () {
|
|
|
276
248
|
return [nodes.ReferenceType.Variable];
|
|
277
249
|
}
|
|
278
250
|
// are a reference to a keyframe?
|
|
279
|
-
|
|
251
|
+
const decl = nodes.getParentDeclaration(node);
|
|
280
252
|
if (decl) {
|
|
281
|
-
|
|
253
|
+
const propertyName = decl.getNonPrefixedPropertyName();
|
|
282
254
|
if ((propertyName === 'animation' || propertyName === 'animation-name')
|
|
283
255
|
&& decl.getValue() && decl.getValue().offset === node.offset) {
|
|
284
256
|
return [nodes.ReferenceType.Keyframe];
|
|
@@ -289,26 +261,26 @@ var Symbols = /** @class */ (function () {
|
|
|
289
261
|
else if (node instanceof nodes.Variable) {
|
|
290
262
|
return [nodes.ReferenceType.Variable];
|
|
291
263
|
}
|
|
292
|
-
|
|
264
|
+
const selector = node.findAParent(nodes.NodeType.Selector, nodes.NodeType.ExtendsReference);
|
|
293
265
|
if (selector) {
|
|
294
266
|
return [nodes.ReferenceType.Rule];
|
|
295
267
|
}
|
|
296
268
|
return null;
|
|
297
|
-
}
|
|
298
|
-
|
|
269
|
+
}
|
|
270
|
+
findSymbolFromNode(node) {
|
|
299
271
|
if (!node) {
|
|
300
272
|
return null;
|
|
301
273
|
}
|
|
302
274
|
while (node.type === nodes.NodeType.Interpolation) {
|
|
303
275
|
node = node.getParent();
|
|
304
276
|
}
|
|
305
|
-
|
|
277
|
+
const referenceTypes = this.evaluateReferenceTypes(node);
|
|
306
278
|
if (referenceTypes) {
|
|
307
279
|
return this.internalFindSymbol(node, referenceTypes);
|
|
308
280
|
}
|
|
309
281
|
return null;
|
|
310
|
-
}
|
|
311
|
-
|
|
282
|
+
}
|
|
283
|
+
matchesSymbol(node, symbol) {
|
|
312
284
|
if (!node) {
|
|
313
285
|
return false;
|
|
314
286
|
}
|
|
@@ -318,24 +290,22 @@ var Symbols = /** @class */ (function () {
|
|
|
318
290
|
if (!node.matches(symbol.name)) {
|
|
319
291
|
return false;
|
|
320
292
|
}
|
|
321
|
-
|
|
293
|
+
const referenceTypes = this.evaluateReferenceTypes(node);
|
|
322
294
|
if (!referenceTypes || referenceTypes.indexOf(symbol.type) === -1) {
|
|
323
295
|
return false;
|
|
324
296
|
}
|
|
325
|
-
|
|
297
|
+
const nodeSymbol = this.internalFindSymbol(node, referenceTypes);
|
|
326
298
|
return nodeSymbol === symbol;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
299
|
+
}
|
|
300
|
+
findSymbol(name, type, offset) {
|
|
301
|
+
let scope = this.global.findScope(offset);
|
|
330
302
|
while (scope) {
|
|
331
|
-
|
|
303
|
+
const symbol = scope.getSymbol(name, type);
|
|
332
304
|
if (symbol) {
|
|
333
305
|
return symbol;
|
|
334
306
|
}
|
|
335
307
|
scope = scope.parent;
|
|
336
308
|
}
|
|
337
309
|
return null;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
}());
|
|
341
|
-
export { Symbols };
|
|
310
|
+
}
|
|
311
|
+
}
|