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