@spyglassmc/core 0.1.0 → 0.2.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/README.md +7 -0
- package/lib/browser.d.ts +2 -0
- package/lib/browser.js +2 -0
- package/lib/common/TwoWayMap.d.ts +21 -0
- package/lib/common/TwoWayMap.js +69 -0
- package/lib/common/externals/BrowserExternals.d.ts +3 -0
- package/lib/common/externals/BrowserExternals.js +191 -0
- package/lib/common/externals/NodeJsExternals.d.ts +3 -0
- package/lib/common/externals/NodeJsExternals.js +151 -0
- package/lib/common/externals/downloader.d.ts +31 -0
- package/lib/common/externals/downloader.js +32 -0
- package/lib/common/externals/index.d.ts +96 -0
- package/lib/common/externals/index.js +2 -0
- package/lib/common/index.d.ts +2 -1
- package/lib/common/index.js +2 -13
- package/lib/common/util.d.ts +17 -34
- package/lib/common/util.js +32 -113
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -19
- package/lib/node/AstNode.d.ts +3 -3
- package/lib/node/AstNode.js +10 -16
- package/lib/node/BooleanNode.d.ts +2 -2
- package/lib/node/BooleanNode.js +4 -7
- package/lib/node/CommentNode.d.ts +1 -1
- package/lib/node/CommentNode.js +2 -5
- package/lib/node/ErrorNode.d.ts +1 -1
- package/lib/node/ErrorNode.js +2 -5
- package/lib/node/FileNode.d.ts +3 -3
- package/lib/node/FileNode.js +2 -5
- package/lib/node/FloatNode.d.ts +2 -2
- package/lib/node/FloatNode.js +4 -7
- package/lib/node/IntegerNode.d.ts +2 -2
- package/lib/node/IntegerNode.js +4 -7
- package/lib/node/ListNode.d.ts +2 -2
- package/lib/node/ListNode.js +2 -5
- package/lib/node/LiteralNode.d.ts +4 -4
- package/lib/node/LiteralNode.js +5 -8
- package/lib/node/LongNode.d.ts +2 -2
- package/lib/node/LongNode.js +4 -7
- package/lib/node/RecordNode.d.ts +2 -2
- package/lib/node/RecordNode.js +2 -5
- package/lib/node/ResourceLocationNode.d.ts +6 -8
- package/lib/node/ResourceLocationNode.js +9 -12
- package/lib/node/Sequence.d.ts +4 -3
- package/lib/node/Sequence.js +4 -6
- package/lib/node/StringNode.d.ts +5 -5
- package/lib/node/StringNode.js +9 -12
- package/lib/node/SymbolNode.d.ts +4 -4
- package/lib/node/SymbolNode.js +5 -8
- package/lib/node/index.d.ts +15 -15
- package/lib/node/index.js +15 -27
- package/lib/nodejs.d.ts +2 -0
- package/lib/nodejs.js +2 -0
- package/lib/parser/Parser.d.ts +3 -3
- package/lib/parser/Parser.js +1 -4
- package/lib/parser/boolean.d.ts +2 -2
- package/lib/parser/boolean.js +3 -6
- package/lib/parser/comment.d.ts +2 -2
- package/lib/parser/comment.js +5 -9
- package/lib/parser/empty.d.ts +1 -1
- package/lib/parser/empty.js +1 -5
- package/lib/parser/error.d.ts +2 -2
- package/lib/parser/error.js +5 -9
- package/lib/parser/file.d.ts +3 -3
- package/lib/parser/file.js +9 -13
- package/lib/parser/float.d.ts +4 -4
- package/lib/parser/float.js +12 -16
- package/lib/parser/index.d.ts +16 -16
- package/lib/parser/index.js +16 -34
- package/lib/parser/integer.d.ts +4 -4
- package/lib/parser/integer.js +10 -14
- package/lib/parser/list.d.ts +2 -2
- package/lib/parser/list.js +15 -19
- package/lib/parser/literal.d.ts +2 -2
- package/lib/parser/literal.js +5 -9
- package/lib/parser/long.d.ts +4 -4
- package/lib/parser/long.js +10 -14
- package/lib/parser/record.d.ts +3 -3
- package/lib/parser/record.js +20 -24
- package/lib/parser/resourceLocation.d.ts +2 -2
- package/lib/parser/resourceLocation.js +14 -18
- package/lib/parser/string.d.ts +7 -7
- package/lib/parser/string.js +40 -44
- package/lib/parser/symbol.d.ts +3 -3
- package/lib/parser/symbol.js +3 -7
- package/lib/parser/util.d.ts +30 -12
- package/lib/parser/util.js +78 -63
- package/lib/processor/ColorInfoProvider.d.ts +1 -1
- package/lib/processor/ColorInfoProvider.js +6 -9
- package/lib/processor/InlayHintProvider.d.ts +2 -2
- package/lib/processor/InlayHintProvider.js +1 -2
- package/lib/processor/SignatureHelpProvider.d.ts +2 -2
- package/lib/processor/SignatureHelpProvider.js +1 -2
- package/lib/processor/checker/Checker.d.ts +2 -2
- package/lib/processor/checker/Checker.js +1 -5
- package/lib/processor/checker/builtin.d.ts +5 -4
- package/lib/processor/checker/builtin.js +26 -28
- package/lib/processor/checker/index.d.ts +2 -2
- package/lib/processor/checker/index.js +2 -27
- package/lib/processor/colorizer/Colorizer.d.ts +4 -4
- package/lib/processor/colorizer/Colorizer.js +8 -11
- package/lib/processor/colorizer/builtin.d.ts +3 -3
- package/lib/processor/colorizer/builtin.js +33 -46
- package/lib/processor/colorizer/index.d.ts +2 -2
- package/lib/processor/colorizer/index.js +2 -27
- package/lib/processor/completer/Completer.d.ts +4 -4
- package/lib/processor/completer/Completer.js +14 -33
- package/lib/processor/completer/builtin.d.ts +7 -7
- package/lib/processor/completer/builtin.js +58 -74
- package/lib/processor/completer/index.d.ts +2 -2
- package/lib/processor/completer/index.js +2 -27
- package/lib/processor/formatter/Formatter.d.ts +2 -2
- package/lib/processor/formatter/Formatter.js +2 -7
- package/lib/processor/formatter/builtin.d.ts +3 -3
- package/lib/processor/formatter/builtin.js +22 -36
- package/lib/processor/formatter/index.d.ts +2 -2
- package/lib/processor/formatter/index.js +2 -27
- package/lib/processor/index.d.ts +9 -9
- package/lib/processor/index.js +9 -21
- package/lib/processor/linter/Linter.d.ts +2 -2
- package/lib/processor/linter/Linter.js +1 -2
- package/lib/processor/linter/builtin/undeclaredSymbol.d.ts +2 -2
- package/lib/processor/linter/builtin/undeclaredSymbol.js +23 -27
- package/lib/processor/linter/builtin.d.ts +3 -3
- package/lib/processor/linter/builtin.js +19 -31
- package/lib/processor/linter/index.d.ts +2 -2
- package/lib/processor/linter/index.js +2 -27
- package/lib/processor/util.d.ts +2 -2
- package/lib/processor/util.js +4 -9
- package/lib/service/CacheService.d.ts +6 -6
- package/lib/service/CacheService.js +38 -48
- package/lib/service/Config.d.ts +17 -16
- package/lib/service/Config.js +56 -51
- package/lib/service/Context.d.ts +14 -14
- package/lib/service/Context.js +30 -32
- package/lib/service/Dependency.js +2 -5
- package/lib/service/Downloader.d.ts +10 -39
- package/lib/service/Downloader.js +37 -106
- package/lib/service/ErrorReporter.d.ts +2 -2
- package/lib/service/ErrorReporter.js +11 -15
- package/lib/service/FileService.d.ts +41 -14
- package/lib/service/FileService.js +107 -81
- package/lib/service/Hover.d.ts +2 -2
- package/lib/service/Hover.js +4 -7
- package/lib/service/Logger.js +2 -5
- package/lib/service/MetaRegistry.d.ts +12 -12
- package/lib/service/MetaRegistry.js +62 -73
- package/lib/service/Operations.js +3 -9
- package/lib/service/Profiler.d.ts +1 -1
- package/lib/service/Profiler.js +25 -41
- package/lib/service/Project.d.ts +50 -51
- package/lib/service/Project.js +240 -238
- package/lib/service/Service.d.ts +19 -29
- package/lib/service/Service.js +57 -53
- package/lib/service/SymbolLocations.d.ts +3 -3
- package/lib/service/SymbolLocations.js +4 -7
- package/lib/service/SymbolRegistrar.d.ts +1 -1
- package/lib/service/SymbolRegistrar.js +1 -2
- package/lib/service/fileUtil.d.ts +21 -41
- package/lib/service/fileUtil.js +59 -129
- package/lib/service/index.d.ts +17 -17
- package/lib/service/index.js +17 -31
- package/lib/source/IndexMap.d.ts +1 -1
- package/lib/source/IndexMap.js +7 -10
- package/lib/source/LanguageError.d.ts +2 -2
- package/lib/source/LanguageError.js +3 -6
- package/lib/source/Location.d.ts +3 -3
- package/lib/source/Location.js +6 -9
- package/lib/source/Offset.d.ts +1 -1
- package/lib/source/Offset.js +4 -7
- package/lib/source/Position.js +2 -5
- package/lib/source/PositionRange.d.ts +2 -2
- package/lib/source/PositionRange.js +14 -17
- package/lib/source/Range.d.ts +1 -1
- package/lib/source/Range.js +7 -10
- package/lib/source/Source.d.ts +12 -4
- package/lib/source/Source.js +84 -29
- package/lib/source/index.d.ts +8 -8
- package/lib/source/index.js +8 -20
- package/lib/symbol/Symbol.d.ts +15 -15
- package/lib/symbol/Symbol.js +53 -68
- package/lib/symbol/SymbolUtil.d.ts +23 -33
- package/lib/symbol/SymbolUtil.js +162 -163
- package/lib/symbol/UriBinder.d.ts +1 -1
- package/lib/symbol/UriBinder.js +1 -2
- package/lib/symbol/index.d.ts +3 -3
- package/lib/symbol/index.js +3 -15
- package/package.json +7 -4
- package/lib/common/Heap.d.ts +0 -1
- package/lib/common/Heap.js +0 -2
- package/lib/node/TableNode.d.ts +0 -17
- package/lib/node/TableNode.js +0 -11
- package/lib/parser/table.d.ts +0 -22
- package/lib/parser/table.js +0 -97
- package/lib/service/CommandExecutor.d.ts +0 -3
- package/lib/service/CommandExecutor.js +0 -7
package/lib/symbol/Symbol.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
var _SymbolPathCollector_set;
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SymbolTable = exports.SymbolLocation = exports.Symbol = exports.SymbolUsageType = exports.SymbolUsageTypes = exports.SymbolPathCollector = exports.SymbolPath = exports.ResourceLocationCategory = exports.ResourceLocationCategories = exports.AllCategories = exports.DatapackCategories = exports.MiscCategories = exports.FileCategories = exports.TagFileCategories = exports.TaggableResourceLocationCategories = exports.WorldgenFileCategories = exports.RegistryCategories = exports.NbtdocCategories = void 0;
|
|
13
|
-
const rfdc_1 = __importDefault(require("rfdc"));
|
|
14
|
-
const common_1 = require("../common");
|
|
15
|
-
const source_1 = require("../source");
|
|
16
|
-
//#region NBTDoc Categories
|
|
17
|
-
exports.NbtdocCategories = Object.freeze([
|
|
18
|
-
'nbtdoc',
|
|
19
|
-
'nbtdoc/description',
|
|
1
|
+
import rfdc from 'rfdc';
|
|
2
|
+
import { isIterable } from '../common/index.js';
|
|
3
|
+
import { Location, PositionRange, Range } from '../source/index.js';
|
|
4
|
+
//#region Mcdoc Categories
|
|
5
|
+
export const McdocCategories = Object.freeze([
|
|
6
|
+
'mcdoc',
|
|
7
|
+
'mcdoc/dispatcher',
|
|
20
8
|
]);
|
|
21
9
|
//#endregion
|
|
22
10
|
//#region Registry Categories
|
|
23
11
|
// Data in `java-edition/src/binder/index.ts` may need to be updated when this section is changed.
|
|
24
|
-
|
|
12
|
+
export const RegistryCategories = Object.freeze([
|
|
25
13
|
'activity',
|
|
26
14
|
'attribute',
|
|
27
15
|
'block',
|
|
@@ -83,7 +71,7 @@ exports.RegistryCategories = Object.freeze([
|
|
|
83
71
|
]);
|
|
84
72
|
//#endregion
|
|
85
73
|
//#region Data Pack Categories
|
|
86
|
-
|
|
74
|
+
export const WorldgenFileCategories = Object.freeze([
|
|
87
75
|
'worldgen/biome',
|
|
88
76
|
'worldgen/configured_carver',
|
|
89
77
|
'worldgen/configured_feature',
|
|
@@ -95,13 +83,13 @@ exports.WorldgenFileCategories = Object.freeze([
|
|
|
95
83
|
'worldgen/processor_list',
|
|
96
84
|
'worldgen/template_pool',
|
|
97
85
|
]);
|
|
98
|
-
|
|
86
|
+
export const TaggableResourceLocationCategories = Object.freeze([
|
|
99
87
|
'function',
|
|
100
|
-
...
|
|
101
|
-
...
|
|
88
|
+
...RegistryCategories,
|
|
89
|
+
...WorldgenFileCategories,
|
|
102
90
|
]);
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
export const TagFileCategories = Object.freeze(TaggableResourceLocationCategories.map(key => `tag/${key}`));
|
|
92
|
+
export const FileCategories = Object.freeze([
|
|
105
93
|
'advancement',
|
|
106
94
|
'dimension',
|
|
107
95
|
'dimension_type',
|
|
@@ -111,10 +99,10 @@ exports.FileCategories = Object.freeze([
|
|
|
111
99
|
'predicate',
|
|
112
100
|
'recipe',
|
|
113
101
|
'structure',
|
|
114
|
-
...
|
|
115
|
-
...
|
|
102
|
+
...TagFileCategories,
|
|
103
|
+
...WorldgenFileCategories,
|
|
116
104
|
]);
|
|
117
|
-
|
|
105
|
+
export const MiscCategories = Object.freeze([
|
|
118
106
|
'attribute_modifier_uuid',
|
|
119
107
|
'bossbar',
|
|
120
108
|
'objective',
|
|
@@ -123,30 +111,31 @@ exports.MiscCategories = Object.freeze([
|
|
|
123
111
|
'tag',
|
|
124
112
|
'team',
|
|
125
113
|
]);
|
|
126
|
-
|
|
127
|
-
...
|
|
128
|
-
...
|
|
114
|
+
export const DatapackCategories = Object.freeze([
|
|
115
|
+
...FileCategories,
|
|
116
|
+
...MiscCategories,
|
|
129
117
|
]);
|
|
130
118
|
//#endregion
|
|
131
|
-
|
|
132
|
-
...
|
|
133
|
-
...
|
|
134
|
-
...
|
|
119
|
+
export const AllCategories = Object.freeze([
|
|
120
|
+
...DatapackCategories,
|
|
121
|
+
...McdocCategories,
|
|
122
|
+
...RegistryCategories,
|
|
135
123
|
]);
|
|
136
|
-
|
|
124
|
+
export const ResourceLocationCategories = Object.freeze([
|
|
137
125
|
'bossbar',
|
|
138
126
|
'storage',
|
|
139
|
-
|
|
140
|
-
...
|
|
127
|
+
'mcdoc/dispatcher',
|
|
128
|
+
...FileCategories,
|
|
129
|
+
...RegistryCategories,
|
|
141
130
|
]);
|
|
142
|
-
var ResourceLocationCategory;
|
|
131
|
+
export var ResourceLocationCategory;
|
|
143
132
|
(function (ResourceLocationCategory) {
|
|
144
133
|
function is(category) {
|
|
145
|
-
return
|
|
134
|
+
return ResourceLocationCategories.includes(category);
|
|
146
135
|
}
|
|
147
136
|
ResourceLocationCategory.is = is;
|
|
148
|
-
})(ResourceLocationCategory
|
|
149
|
-
var SymbolPath;
|
|
137
|
+
})(ResourceLocationCategory || (ResourceLocationCategory = {}));
|
|
138
|
+
export var SymbolPath;
|
|
150
139
|
(function (SymbolPath) {
|
|
151
140
|
function fromSymbol(symbol) {
|
|
152
141
|
return symbol
|
|
@@ -165,38 +154,34 @@ var SymbolPath;
|
|
|
165
154
|
return JSON.parse(value);
|
|
166
155
|
}
|
|
167
156
|
SymbolPath.fromString = fromString;
|
|
168
|
-
})(SymbolPath
|
|
169
|
-
class SymbolPathCollector {
|
|
170
|
-
|
|
171
|
-
_SymbolPathCollector_set.set(this, new Set());
|
|
172
|
-
}
|
|
157
|
+
})(SymbolPath || (SymbolPath = {}));
|
|
158
|
+
export class SymbolPathCollector {
|
|
159
|
+
#set = new Set();
|
|
173
160
|
add(path) {
|
|
174
161
|
if (!path) {
|
|
175
162
|
return;
|
|
176
163
|
}
|
|
177
|
-
|
|
164
|
+
this.#set.add(SymbolPath.toString(path));
|
|
178
165
|
}
|
|
179
166
|
has(path) {
|
|
180
|
-
return
|
|
167
|
+
return this.#set.has(SymbolPath.toString(path));
|
|
181
168
|
}
|
|
182
169
|
collect() {
|
|
183
|
-
return [...
|
|
170
|
+
return [...this.#set].map(SymbolPath.fromString);
|
|
184
171
|
}
|
|
185
172
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
exports.SymbolUsageTypes = Object.freeze(['definition', 'declaration', 'implementation', 'reference', 'typeDefinition']);
|
|
189
|
-
var SymbolUsageType;
|
|
173
|
+
export const SymbolUsageTypes = Object.freeze(['definition', 'declaration', 'implementation', 'reference', 'typeDefinition']);
|
|
174
|
+
export var SymbolUsageType;
|
|
190
175
|
(function (SymbolUsageType) {
|
|
191
176
|
function is(value) {
|
|
192
|
-
return
|
|
177
|
+
return SymbolUsageTypes.includes(value);
|
|
193
178
|
}
|
|
194
179
|
SymbolUsageType.is = is;
|
|
195
|
-
})(SymbolUsageType
|
|
196
|
-
var Symbol;
|
|
180
|
+
})(SymbolUsageType || (SymbolUsageType = {}));
|
|
181
|
+
export var Symbol;
|
|
197
182
|
(function (Symbol) {
|
|
198
183
|
function get(table, category, ...path) {
|
|
199
|
-
if (
|
|
184
|
+
if (isIterable(table)) {
|
|
200
185
|
for (const t of table) {
|
|
201
186
|
const result = get(t, category, ...path);
|
|
202
187
|
if (result) {
|
|
@@ -211,21 +196,21 @@ var Symbol;
|
|
|
211
196
|
return undefined;
|
|
212
197
|
}
|
|
213
198
|
Symbol.get = get;
|
|
214
|
-
})(Symbol
|
|
215
|
-
var SymbolLocation;
|
|
199
|
+
})(Symbol || (Symbol = {}));
|
|
200
|
+
export var SymbolLocation;
|
|
216
201
|
(function (SymbolLocation) {
|
|
217
202
|
/* istanbul ignore next */
|
|
218
203
|
function create(doc, range, fullRange, contributor, additional) {
|
|
219
204
|
return {
|
|
220
|
-
...
|
|
221
|
-
...fullRange ? { fullRange:
|
|
205
|
+
...Location.create(doc, range),
|
|
206
|
+
...fullRange ? { fullRange: Range.get(fullRange), fullPosRange: PositionRange.from(fullRange, doc) } : {},
|
|
222
207
|
...contributor ? { contributor } : {},
|
|
223
208
|
...additional ? additional : {},
|
|
224
209
|
};
|
|
225
210
|
}
|
|
226
211
|
SymbolLocation.create = create;
|
|
227
|
-
})(SymbolLocation
|
|
228
|
-
var SymbolTable;
|
|
212
|
+
})(SymbolLocation || (SymbolLocation = {}));
|
|
213
|
+
export var SymbolTable;
|
|
229
214
|
(function (SymbolTable) {
|
|
230
215
|
/**
|
|
231
216
|
* The passed-in parameter `table` won't be mutated.
|
|
@@ -251,7 +236,7 @@ var SymbolTable;
|
|
|
251
236
|
linkSymbol(childSymbol, map, parentSymbol, category, [...path, identifier]);
|
|
252
237
|
}
|
|
253
238
|
};
|
|
254
|
-
const ans = (
|
|
239
|
+
const ans = rfdc()(table);
|
|
255
240
|
for (const [category, map] of Object.entries(ans)) {
|
|
256
241
|
linkSymbolMap(map, undefined, category, []);
|
|
257
242
|
}
|
|
@@ -280,7 +265,7 @@ var SymbolTable;
|
|
|
280
265
|
unlinkSymbol(childSymbol);
|
|
281
266
|
}
|
|
282
267
|
};
|
|
283
|
-
const ans = (
|
|
268
|
+
const ans = rfdc({ circles: true })(table);
|
|
284
269
|
for (const map of Object.values(ans)) {
|
|
285
270
|
unlinkSymbolMap(map);
|
|
286
271
|
}
|
|
@@ -302,7 +287,7 @@ var SymbolTable;
|
|
|
302
287
|
return link(JSON.parse(json));
|
|
303
288
|
}
|
|
304
289
|
SymbolTable.deserialize = deserialize;
|
|
305
|
-
})(SymbolTable
|
|
290
|
+
})(SymbolTable || (SymbolTable = {}));
|
|
306
291
|
// interface SymbolEvent {
|
|
307
292
|
// symbol: Symbol,
|
|
308
293
|
// }
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import EventEmitter from 'events';
|
|
3
1
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
2
|
+
import type { ExternalEventEmitter, Externals } from '../common/index.js';
|
|
3
|
+
import type { AstNode } from '../node/index.js';
|
|
4
|
+
import type { RangeLike } from '../source/index.js';
|
|
5
|
+
import type { AllCategory, Symbol, SymbolLocationBuiltInContributor, SymbolLocationMetadata, SymbolMap, SymbolMetadata, SymbolTable, SymbolUsageType } from './Symbol.js';
|
|
6
|
+
import { SymbolLocation, SymbolVisibility } from './Symbol.js';
|
|
8
7
|
export interface LookupResult {
|
|
9
8
|
/**
|
|
10
9
|
* The {@link SymbolMap} that contains the symbol. If `symbol` is `undefined`, this property will be the map that could
|
|
@@ -28,28 +27,11 @@ interface SymbolLocationEvent extends SymbolEvent {
|
|
|
28
27
|
type: SymbolUsageType;
|
|
29
28
|
location: SymbolLocation;
|
|
30
29
|
}
|
|
31
|
-
export interface SymbolUtil {
|
|
32
|
-
on(event: 'symbolCreated', callbackFn: (data: SymbolEvent) => void): this;
|
|
33
|
-
on(event: 'symbolAmended', callbackFn: (data: SymbolEvent) => void): this;
|
|
34
|
-
on(event: 'symbolRemoved', callbackFn: (data: SymbolEvent) => void): this;
|
|
35
|
-
on(event: 'symbolLocationCreated', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
36
|
-
on(event: 'symbolLocationRemoved', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
37
|
-
once(event: 'symbolCreated', callbackFn: (data: SymbolEvent) => void): this;
|
|
38
|
-
once(event: 'symbolAmended', callbackFn: (data: SymbolEvent) => void): this;
|
|
39
|
-
once(event: 'symbolRemoved', callbackFn: (data: SymbolEvent) => void): this;
|
|
40
|
-
once(event: 'symbolLocationCreated', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
41
|
-
once(event: 'symbolLocationRemoved', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
42
|
-
emit(event: 'symbolCreated', data: SymbolEvent): boolean;
|
|
43
|
-
emit(event: 'symbolAmended', data: SymbolEvent): boolean;
|
|
44
|
-
emit(event: 'symbolRemoved', data: SymbolEvent): boolean;
|
|
45
|
-
emit(event: 'symbolLocationCreated', data: SymbolLocationEvent): boolean;
|
|
46
|
-
emit(event: 'symbolLocationRemoved', data: SymbolLocationEvent): boolean;
|
|
47
|
-
}
|
|
48
30
|
interface DocAndNode {
|
|
49
31
|
doc: TextDocument;
|
|
50
32
|
node: AstNode;
|
|
51
33
|
}
|
|
52
|
-
export declare class SymbolUtil
|
|
34
|
+
export declare class SymbolUtil implements ExternalEventEmitter {
|
|
53
35
|
#private;
|
|
54
36
|
/**
|
|
55
37
|
* @internal
|
|
@@ -60,11 +42,26 @@ export declare class SymbolUtil extends EventEmitter {
|
|
|
60
42
|
*/
|
|
61
43
|
_inDelayMode: boolean;
|
|
62
44
|
get global(): SymbolTable;
|
|
63
|
-
constructor(global: SymbolTable,
|
|
45
|
+
constructor(global: SymbolTable, eventEmitterConstructor: Externals['event']['EventEmitter'],
|
|
64
46
|
/** @internal */
|
|
65
47
|
_currentContributor?: string,
|
|
66
48
|
/** @internal */
|
|
67
49
|
_inDelayMode?: boolean);
|
|
50
|
+
on(event: 'symbolCreated', callbackFn: (data: SymbolEvent) => void): this;
|
|
51
|
+
on(event: 'symbolAmended', callbackFn: (data: SymbolEvent) => void): this;
|
|
52
|
+
on(event: 'symbolRemoved', callbackFn: (data: SymbolEvent) => void): this;
|
|
53
|
+
on(event: 'symbolLocationCreated', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
54
|
+
on(event: 'symbolLocationRemoved', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
55
|
+
once(event: 'symbolCreated', callbackFn: (data: SymbolEvent) => void): this;
|
|
56
|
+
once(event: 'symbolAmended', callbackFn: (data: SymbolEvent) => void): this;
|
|
57
|
+
once(event: 'symbolRemoved', callbackFn: (data: SymbolEvent) => void): this;
|
|
58
|
+
once(event: 'symbolLocationCreated', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
59
|
+
once(event: 'symbolLocationRemoved', callbackFn: (data: SymbolLocationEvent) => void): this;
|
|
60
|
+
emit(event: 'symbolCreated', data: SymbolEvent): boolean;
|
|
61
|
+
emit(event: 'symbolAmended', data: SymbolEvent): boolean;
|
|
62
|
+
emit(event: 'symbolRemoved', data: SymbolEvent): boolean;
|
|
63
|
+
emit(event: 'symbolLocationCreated', data: SymbolLocationEvent): boolean;
|
|
64
|
+
emit(event: 'symbolLocationRemoved', data: SymbolLocationEvent): boolean;
|
|
68
65
|
/**
|
|
69
66
|
* Build the internal cache of the SymbolUtil according to the current global symbol table.
|
|
70
67
|
*/
|
|
@@ -223,14 +220,7 @@ interface SymbolAdditionUsageBase extends SymbolLocationMetadata {
|
|
|
223
220
|
*/
|
|
224
221
|
type?: SymbolUsageType;
|
|
225
222
|
/**
|
|
226
|
-
*
|
|
227
|
-
* nbtdoc code,
|
|
228
|
-
* ```nbtdoc
|
|
229
|
-
* 0123456789012345
|
|
230
|
-
* compound Foo {}
|
|
231
|
-
* ```
|
|
232
|
-
*
|
|
233
|
-
* The `range` for the Symbol `Foo` is `[9, 12)`, while the `fullRange` for it is `[0, 15)`.
|
|
223
|
+
* @see {@link SymbolLocation.fullRange}
|
|
234
224
|
*/
|
|
235
225
|
fullRange?: RangeLike;
|
|
236
226
|
}
|