Repository navigation
Conversation
Projects can now ship a minecraft-debugger.json at the workspace root. The first supported setting is commandShortcuts, which are shown in the home panel above the user's own command shortcuts. The file is watched for changes and is only loaded in trusted workspaces.
minecraft-debugger.json can now list paths or globs in commandShortcutFiles. JSON files use the same shortcut format and other files are read as one command per line, skipping blank lines and # comments. Referenced files are watched and reloads no longer race each other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've added the possibility of creating a minecraft-debugger.json containing per-project command shortcuts. The same file could be used for something else in the future.
It also allows to load mcfunctions, where every command get loaded separately.
Github Copilot summary if useful:
This pull request introduces support for project-specific Minecraft command shortcuts by allowing projects to define shortcuts in a
minecraft-debugger.jsonfile. These shortcuts are displayed in the extension's UI, can be loaded from additional files, and are only enabled in trusted workspaces. The changes include backend logic for loading and watching these files, frontend updates to display project shortcuts, schema validation, and tests for the new functionality.Project command shortcuts support:
minecraft-debugger.jsonfile at the workspace root; these can be simple strings or objects withcommandand optionallabelfields. Additional shortcuts can be loaded from other files via thecommandShortcutFilesproperty, supporting both JSON and line-based formats. Only loaded in trusted workspaces. (README.md,src/project-settings.ts,schemas/minecraft-debugger.schema.json, [1] [2] [3]ProjectSettingsLoaderclass to watch for changes to project settings and shortcut files, parse their contents, and emit updates. (src/project-settings.ts, src/project-settings.tsR1-R164)src/extension.ts,src/panels/home-view-provider.ts, [1] [2] [3] [4]Frontend integration:
webview-ui/src/home_panel/App.tsx,webview-ui/src/home_panel/controls/CommandSection.tsx, [1] [2] [3] [4] [5] [6] [7]Validation and workspace trust:
minecraft-debugger.jsonto provide validation in editors, and declared that project settings are only loaded in trusted workspaces via the extension manifest. (schemas/minecraft-debugger.schema.json,package.json, [1] [2]Testing:
src/project-settings.test.ts, src/project-settings.test.tsR1-R74)