UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

68 lines (67 loc) 2.66 kB
/** * CrossReferenceIndexGenerator - Indexes cross-file references into ContentIndex * * ARCHITECTURE: * This generator populates the ContentIndex trie with annotated entries for all * content types that can be referenced across files. This data powers autocomplete * suggestions in both Monaco (web editor) and VS Code. * * REFERENCE TYPES INDEXED: * - Geometry identifiers (from .geo.json files) * - Animation identifiers (from animation files) * - Animation controller identifiers * - Render controller identifiers * - Particle identifiers * - Fog identifiers * - Sound event names (from sound_definitions.json) * - Loot table paths * - Recipe identifiers * - Biome identifiers * - Spawn rule identifiers * - Dialogue paths * - Function paths (.mcfunction files) * - Structure paths * * TYPES ALREADY INDEXED ELSEWHERE (not duplicated here): * - Entity IDs → TypesInfoGenerator (AnnotationCategory.entityTypeSource) * - Block IDs → TypesInfoGenerator (AnnotationCategory.blockTypeSource) * - Item IDs → TypesInfoGenerator (AnnotationCategory.itemTypeSource) * - Feature IDs → TypesInfoGenerator (AnnotationCategory.featureSource) * - Texture file paths → TextureInfoGenerator (AnnotationCategory.textureFile) * * RELATED FILES: * - ContentIndex.ts — The trie data structure and AnnotationCategory enum * - TypesInfoGenerator.ts — Indexes entity, block, item, feature IDs * - TextureInfoGenerator.ts — Indexes texture file paths * - langcore/json/CrossReferenceCompletionSource.ts — Queries this data for completions * * Last updated: February 2026 */ import ProjectInfoItem from "./ProjectInfoItem"; import IProjectInfoGenerator from "./IProjectInfoGenerator"; import Project from "../app/Project"; import ContentIndex from "../core/ContentIndex"; import ProjectInfoSet from "./ProjectInfoSet"; export default class CrossReferenceIndexGenerator implements IProjectInfoGenerator { id: string; title: string; performAddOnValidations: boolean; summarize(_info: any, _infoSet: ProjectInfoSet): void; generate(project: Project, contentIndex: ContentIndex): Promise<ProjectInfoItem[]>; private indexGeometry; private indexAnimationResource; private indexAnimationBehavior; private indexAnimationControllerResource; private indexAnimationControllerBehavior; private indexRenderController; private indexParticle; private indexFog; private indexSoundDefinitions; private indexLootTable; private indexRecipe; private indexBiome; private indexSpawnRule; private indexDialogue; private indexFunction; private indexStructure; }