@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.
Files changed (64) hide show
  1. package/lib/common/Dev.js +2 -2
  2. package/lib/common/ReadonlyProxy.d.ts +2 -2
  3. package/lib/common/StateProxy.d.ts +2 -2
  4. package/lib/common/externals/NodeJsExternals.js +4 -1
  5. package/lib/common/externals/downloader.d.ts +2 -2
  6. package/lib/common/externals/index.d.ts +2 -2
  7. package/lib/common/util.d.ts +7 -7
  8. package/lib/common/util.js +2 -2
  9. package/lib/node/AstNode.d.ts +1 -1
  10. package/lib/node/AstNode.js +3 -1
  11. package/lib/node/CommentNode.d.ts +2 -2
  12. package/lib/node/ResourceLocationNode.d.ts +1 -1
  13. package/lib/node/ResourceLocationNode.js +6 -8
  14. package/lib/node/StringNode.d.ts +3 -3
  15. package/lib/node/StringNode.js +4 -1
  16. package/lib/parser/Parser.d.ts +5 -5
  17. package/lib/parser/float.d.ts +1 -1
  18. package/lib/parser/integer.d.ts +1 -1
  19. package/lib/parser/long.d.ts +1 -1
  20. package/lib/parser/string.js +4 -1
  21. package/lib/parser/util.d.ts +7 -7
  22. package/lib/parser/util.js +7 -2
  23. package/lib/processor/ColorInfoProvider.d.ts +3 -3
  24. package/lib/processor/ColorInfoProvider.js +4 -2
  25. package/lib/processor/InlayHintProvider.d.ts +1 -1
  26. package/lib/processor/SignatureHelpProvider.d.ts +1 -1
  27. package/lib/processor/binder/Binder.d.ts +1 -1
  28. package/lib/processor/binder/builtin.d.ts +2 -2
  29. package/lib/processor/binder/builtin.js +3 -1
  30. package/lib/processor/binder/index.d.ts +1 -1
  31. package/lib/processor/binder/index.js +1 -1
  32. package/lib/processor/checker/Checker.d.ts +3 -3
  33. package/lib/processor/checker/builtin.d.ts +1 -1
  34. package/lib/processor/checker/builtin.js +2 -1
  35. package/lib/processor/colorizer/Colorizer.d.ts +3 -3
  36. package/lib/processor/completer/Completer.d.ts +1 -1
  37. package/lib/processor/completer/builtin.js +8 -4
  38. package/lib/processor/formatter/Formatter.d.ts +1 -1
  39. package/lib/processor/formatter/Formatter.js +3 -1
  40. package/lib/processor/linter/Linter.d.ts +1 -1
  41. package/lib/processor/util.d.ts +1 -1
  42. package/lib/service/CacheService.d.ts +1 -1
  43. package/lib/service/CacheService.js +2 -2
  44. package/lib/service/Config.d.ts +9 -9
  45. package/lib/service/Config.js +5 -2
  46. package/lib/service/Dependency.d.ts +3 -3
  47. package/lib/service/FileService.d.ts +1 -1
  48. package/lib/service/FileService.js +7 -3
  49. package/lib/service/Project.d.ts +5 -5
  50. package/lib/service/Project.js +9 -4
  51. package/lib/service/Service.js +12 -3
  52. package/lib/service/SymbolRegistrar.d.ts +1 -1
  53. package/lib/service/UriProcessor.d.ts +3 -3
  54. package/lib/service/fileUtil.d.ts +2 -2
  55. package/lib/source/IndexMap.d.ts +1 -1
  56. package/lib/source/Location.d.ts +1 -1
  57. package/lib/source/Offset.d.ts +1 -1
  58. package/lib/source/Range.d.ts +1 -1
  59. package/lib/source/Source.d.ts +4 -4
  60. package/lib/symbol/Symbol.d.ts +12 -12
  61. package/lib/symbol/Symbol.js +9 -7
  62. package/lib/symbol/SymbolUtil.d.ts +4 -4
  63. package/lib/symbol/SymbolUtil.js +4 -3
  64. package/package.json +2 -2
@@ -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
- //#region Mcdoc Categories
4
+ // #region Mcdoc Categories
5
5
  export const McdocCategories = Object.freeze([
6
6
  'mcdoc',
7
7
  'mcdoc/dispatcher',
8
8
  ]);
9
- //#endregion
10
- //#region Registry Categories
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
- //#endregion
73
- //#region Data Pack Categories
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
- //#endregion
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 ? { category: symbol.category, path: symbol.path } : undefined;
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
- declare type SymbolAdditionUsage = SymbolAdditionUsageWithRange | SymbolAdditionUsageWithNode;
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 declare type SymbolStack = [SymbolTable, ...SymbolTable[]];
273
- declare type QueryCallback<S extends Symbol | undefined = Symbol | undefined> = (this: SymbolQuery, symbol: S, query: SymbolQuery) => unknown;
274
- declare type QueryMemberCallback = (this: void, query: SymbolQuery) => unknown;
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;
@@ -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
- Object.create(null));
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 && !this.#createdWithUri
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.1",
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.1"
26
+ "@spyglassmc/locales": "0.3.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/decompress": "^4.2.3",