Skip to content

Add UI file processing, symbol table tracking, and diagnostics scaffolding for resource_pack/ui/*#327

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-symbol-table-for-ui-definitions
Draft

Add UI file processing, symbol table tracking, and diagnostics scaffolding for resource_pack/ui/*#327
Copilot wants to merge 2 commits intomainfrom
copilot/add-symbol-table-for-ui-definitions

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

The language server had no awareness of resource_pack/ui/ files — no file type detection, no symbol table entries, and no diagnostic hooks, leaving UI definitions completely unvalidated.

Changes

bedrock-project — FileType & Detection

  • Added ui variant to FileType enum
  • Added ui/ folder regex match in FileType.detect()
  • Added test cases for ui/hud_screen.json detection

bedrock-project — Internal Types

  • New internal/resource-pack/ui.ts: UI interface + UI.is() type guard; detects files by presence of a namespace string or object-valued element definitions

bedrock-project — Symbol Table (project/resource-pack/ui/)

  • UIElement project type extending BaseObject
  • process() function extracts all element identifiers as namespace.element_name IDs, stripping @inheritance suffixes from keys
  • ResourcePack gains ui_elements: DataSet<UIElement>, wired into process(), getDataset(), deleteFolder(), deleteFile(), find(), and forEach()
  • ResourcePackCollection gains ui_elements: DataSetConnector

bedrock-diagnoser — Diagnostics Hook

  • New diagnostics/resource-pack/ui/entry.ts stub: diagnose_ui_document() — ready to add @-inheritance resolution and $-variable tracking
  • FileType.ui case wired into the ResourcePack.diagnose_document() switch

Example: how UI elements are indexed into the symbol table

// resource_pack/ui/hud_screen.json
{
  "namespace": "hud",
  "root_panel": { "type": "panel" },
  "health_bar@common.bar": { "size": [81, 9] }
}

Produces entries: hud.root_panel, hud.health_bar in ui_elements.

Original prompt

This section details on the original issue you should resolve

<issue_title>Build symbol table for @-resolution and $-tracking</issue_title>
<issue_description>## Overview
This issue tracks implementing diagnostics, project provider, and language server support for resource pack UI definitions in Minecraft Bedrock.


Motivation

  • The language server currently does NOT validate, lint, or offer diagnostics for any files in resource_pack/ui/*, even though these power most custom screens and modded menus.
  • Users are flying blind for JSON errors, misspelled UI types, broken @ inheritance, missing bindings, or misplaced variables.

Definition of Done

  • UI files are processed by the diagnostics project and symbol table for @-resolution and $-tracking are tracked in the database

Links

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… pack UI definitions

Co-authored-by: DaanV2 <2393905+DaanV2@users.noreply.github.com>
Copilot AI changed the title [WIP] Add symbol table for @-resolution and $-tracking support Add UI file processing, symbol table tracking, and diagnostics scaffolding for resource_pack/ui/* Mar 20, 2026
Copilot AI requested a review from DaanV2 March 20, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build symbol table for @-resolution and $-tracking

2 participants