@spyglassmc/core 0.4.1 → 0.4.2
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/lib/common/Dev.js +2 -2
- package/lib/common/ReadonlyProxy.d.ts +2 -2
- package/lib/common/StateProxy.d.ts +2 -2
- package/lib/common/externals/NodeJsExternals.js +4 -1
- package/lib/common/externals/downloader.d.ts +2 -2
- package/lib/common/externals/index.d.ts +2 -2
- package/lib/common/util.d.ts +7 -7
- package/lib/common/util.js +2 -2
- package/lib/node/AstNode.d.ts +1 -1
- package/lib/node/AstNode.js +3 -1
- package/lib/node/CommentNode.d.ts +2 -2
- package/lib/node/ResourceLocationNode.d.ts +1 -1
- package/lib/node/ResourceLocationNode.js +6 -8
- package/lib/node/StringNode.d.ts +3 -3
- package/lib/node/StringNode.js +4 -1
- package/lib/parser/Parser.d.ts +5 -5
- package/lib/parser/float.d.ts +1 -1
- package/lib/parser/integer.d.ts +1 -1
- package/lib/parser/long.d.ts +1 -1
- package/lib/parser/string.js +4 -1
- package/lib/parser/util.d.ts +7 -7
- package/lib/parser/util.js +7 -2
- package/lib/processor/ColorInfoProvider.d.ts +3 -3
- package/lib/processor/ColorInfoProvider.js +4 -2
- package/lib/processor/InlayHintProvider.d.ts +1 -1
- package/lib/processor/SignatureHelpProvider.d.ts +1 -1
- package/lib/processor/binder/Binder.d.ts +1 -1
- package/lib/processor/binder/builtin.d.ts +2 -2
- package/lib/processor/binder/builtin.js +3 -1
- package/lib/processor/binder/index.d.ts +1 -1
- package/lib/processor/binder/index.js +1 -1
- package/lib/processor/checker/Checker.d.ts +3 -3
- package/lib/processor/checker/builtin.d.ts +1 -1
- package/lib/processor/checker/builtin.js +2 -1
- package/lib/processor/colorizer/Colorizer.d.ts +3 -3
- package/lib/processor/completer/Completer.d.ts +1 -1
- package/lib/processor/completer/builtin.js +8 -4
- package/lib/processor/formatter/Formatter.d.ts +1 -1
- package/lib/processor/formatter/Formatter.js +3 -1
- package/lib/processor/linter/Linter.d.ts +1 -1
- package/lib/processor/util.d.ts +1 -1
- package/lib/service/CacheService.d.ts +1 -1
- package/lib/service/CacheService.js +2 -2
- package/lib/service/Config.d.ts +9 -9
- package/lib/service/Config.js +5 -2
- package/lib/service/Dependency.d.ts +3 -3
- package/lib/service/FileService.d.ts +1 -1
- package/lib/service/FileService.js +7 -3
- package/lib/service/Project.d.ts +5 -5
- package/lib/service/Project.js +9 -4
- package/lib/service/Service.js +12 -3
- package/lib/service/SymbolRegistrar.d.ts +1 -1
- package/lib/service/UriProcessor.d.ts +3 -3
- package/lib/service/fileUtil.d.ts +2 -2
- package/lib/source/IndexMap.d.ts +1 -1
- package/lib/source/Location.d.ts +1 -1
- package/lib/source/Offset.d.ts +1 -1
- package/lib/source/Range.d.ts +1 -1
- package/lib/source/Source.d.ts +4 -4
- package/lib/symbol/Symbol.d.ts +12 -12
- package/lib/symbol/Symbol.js +9 -7
- package/lib/symbol/SymbolUtil.d.ts +4 -4
- package/lib/symbol/SymbolUtil.js +4 -3
- package/package.json +2 -2
package/lib/symbol/Symbol.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import rfdc from 'rfdc';
|
|
2
2
|
import { isIterable } from '../common/index.js';
|
|
3
3
|
import { Location, PositionRange, Range } from '../source/index.js';
|
|
4
|
-
|
|
4
|
+
// #region Mcdoc Categories
|
|
5
5
|
export const McdocCategories = Object.freeze([
|
|
6
6
|
'mcdoc',
|
|
7
7
|
'mcdoc/dispatcher',
|
|
8
8
|
]);
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// #endregion
|
|
10
|
+
// #region Registry Categories
|
|
11
11
|
// Data in `java-edition/src/binder/index.ts` may need to be updated when this section is changed.
|
|
12
12
|
export const RegistryCategories = Object.freeze([
|
|
13
13
|
'activity',
|
|
@@ -69,8 +69,8 @@ export const RegistryCategories = Object.freeze([
|
|
|
69
69
|
'worldgen/tree_decorator_type',
|
|
70
70
|
'worldgen/trunk_placer_type',
|
|
71
71
|
]);
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
// #endregion
|
|
73
|
+
// #region Data Pack Categories
|
|
74
74
|
export const WorldgenFileCategories = Object.freeze([
|
|
75
75
|
'worldgen/biome',
|
|
76
76
|
'worldgen/configured_carver',
|
|
@@ -116,7 +116,7 @@ export const DatapackCategories = Object.freeze([
|
|
|
116
116
|
...FileCategories,
|
|
117
117
|
...MiscCategories,
|
|
118
118
|
]);
|
|
119
|
-
|
|
119
|
+
// #endregion
|
|
120
120
|
export const AllCategories = Object.freeze([
|
|
121
121
|
...DatapackCategories,
|
|
122
122
|
...McdocCategories,
|
|
@@ -139,7 +139,9 @@ export var ResourceLocationCategory;
|
|
|
139
139
|
export var SymbolPath;
|
|
140
140
|
(function (SymbolPath) {
|
|
141
141
|
function fromSymbol(symbol) {
|
|
142
|
-
return symbol
|
|
142
|
+
return symbol
|
|
143
|
+
? { category: symbol.category, path: symbol.path }
|
|
144
|
+
: undefined;
|
|
143
145
|
}
|
|
144
146
|
SymbolPath.fromSymbol = fromSymbol;
|
|
145
147
|
/**
|
|
@@ -213,7 +213,7 @@ interface SymbolAddition {
|
|
|
213
213
|
data?: SymbolMetadata;
|
|
214
214
|
usage?: SymbolAdditionUsage;
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
type SymbolAdditionUsage = SymbolAdditionUsageWithRange | SymbolAdditionUsageWithNode;
|
|
217
217
|
interface SymbolAdditionUsageBase extends SymbolLocationMetadata {
|
|
218
218
|
/**
|
|
219
219
|
* The type of this usage. Use `definition` when the usage consists both a `declaration` and an `implementation`.
|
|
@@ -269,9 +269,9 @@ declare namespace SymbolAdditionUsageWithNode {
|
|
|
269
269
|
* which is accessible by any later elements but not saved to the global `SymbolTable`.
|
|
270
270
|
* Later elements represent different levels of `Block` visibility scopes.
|
|
271
271
|
*/
|
|
272
|
-
export
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
export type SymbolStack = [SymbolTable, ...SymbolTable[]];
|
|
273
|
+
type QueryCallback<S extends Symbol | undefined = Symbol | undefined> = (this: SymbolQuery, symbol: S, query: SymbolQuery) => unknown;
|
|
274
|
+
type QueryMemberCallback = (this: void, query: SymbolQuery) => unknown;
|
|
275
275
|
export declare class SymbolQuery {
|
|
276
276
|
#private;
|
|
277
277
|
readonly category: string;
|
package/lib/symbol/SymbolUtil.js
CHANGED
|
@@ -42,8 +42,8 @@ export class SymbolUtil {
|
|
|
42
42
|
this.#trimmableSymbols.delete(SymbolPath.toString(symbol));
|
|
43
43
|
})
|
|
44
44
|
.on('symbolLocationCreated', ({ symbol, location }) => {
|
|
45
|
-
const cache = (this.#cache[location.contributor ?? 'undefined'] ??=
|
|
46
|
-
|
|
45
|
+
const cache = (this.#cache[location.contributor ?? 'undefined'] ??= Object
|
|
46
|
+
.create(null));
|
|
47
47
|
const fileSymbols = (cache[location.uri] ??= new Set());
|
|
48
48
|
const path = SymbolPath.toString(symbol);
|
|
49
49
|
fileSymbols.add(path);
|
|
@@ -763,7 +763,8 @@ export class SymbolQuery {
|
|
|
763
763
|
if (this.#symbol === undefined) {
|
|
764
764
|
throw new Error(`Tried to query member symbol “${identifier}” from an undefined symbol (path “${this.path.join('.')}”)`);
|
|
765
765
|
}
|
|
766
|
-
const memberDoc = typeof doc === 'string' && doc === this.#doc.uri &&
|
|
766
|
+
const memberDoc = typeof doc === 'string' && doc === this.#doc.uri &&
|
|
767
|
+
!this.#createdWithUri
|
|
767
768
|
? this.#doc
|
|
768
769
|
: doc;
|
|
769
770
|
const memberMap = this.#symbol.members;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spyglassmc/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"pako": "^2.0.4",
|
|
24
24
|
"rfdc": "^1.3.0",
|
|
25
25
|
"vscode-languageserver-textdocument": "^1.0.4",
|
|
26
|
-
"@spyglassmc/locales": "0.3.
|
|
26
|
+
"@spyglassmc/locales": "0.3.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/decompress": "^4.2.3",
|