Tags: Mojang/minecraft-debugger
Tags
fix(debugger): Always filewatch .map and .js from sourceMapRoot, but … …optionally /reload minecraft. (#249) Enable file watch on `sourceMapRoot` even if /reload is not enabled. This ensures the source map cache is always cleared after build. There are users (editor) that prefer manual /reload in some cases and would need to have updated source maps. Summary: - if no source maps, only enable file watch if /reload is enabled (catches .js changes and reloads MC) - if `globPattern` override is set, enable file watch only if /reload is enabled (this feature was to watch a special pattern) - if `sourceMapRoot` is set, always enable file watch for .map and .js files but don't send /reload unless enabled. From the user's perspective nothing has changed. Source maps are simply cleared more aggressively.
feat(debugger): Update filewatch to look for .map and .js and send /r… …eload to MC (#248) Similar to this PR [here](#246) but leans into VSCode settings for added flexibility. By using VSCode settings, users can choose to save settings globally or per workspace and it also gives us a place for documentation. Thanks for the general glob pattern idea Dingsel. Will this solve your use cases? - file watching is off by default - if enabled then both source map clear and /reload happen on source changes. - if only `localRoot` is defined (no `sourceMapRoot`), the file watch pattern is *.js files from `localRoot` - if `sourceMapRoot` is defined, the file watch pattern is for *.js and *.map from `sourceMapRoot` - if `globPattern` is specified, the root is the workspace. - delay for sending /reload to MC, minimum is 100ms to debounce the file changes. Added a button to the home panel to open Settings UI directly to the debugger page. Addresses issue #130 --------- Co-authored-by: Raphael Landaverde <[email protected]>
feat(diagnostics): Add a reload command and support command keybinds (#… …245) ## Summary - Adds a vscode command to reload in the command pallete `>Minecraft Diagnostics: Reload MC` - Added a keyboard shortcut for this `ctrl shift r` this can be edited by the user in keyboard shortcuts - Added a vscode command which allows users to add custom keyboard shortcuts to run commands from `keybindings.json` - Example `{ "key": "ctrl shift t", "command": "minecraft-debugger.runMinecraftCommand", "args": "say hello" },` - Added an error message if you have an active debug session but try and run an empty command from within the home view ## To test: - Launch a debug session of the extension **Reload** - Try and run the reload command without a session active an observe the warning message - Start a debugging session - Run the reload command from the command pallete, confirm it reloads in game - Run the reload command from hot keys `ctrl shift r`, confirm it reloads in game **Command Keybinds** - Open the `keybindings.json` (stored in Roaming/Code/User/keybindings.json) or command pallete `>Preferences: Open Keyboard Shortcuts (JSON)` - Add a keybinding such as: - ```[{ "key": "ctrl shift t", "command": "minecraft-debugger.runMinecraftCommand", "args": "say hello" }]``` - Save and use the keybind - Confirm Scripting says hello
feat(sourcemaps): Add tests for SourceMap.ts, generate test source ma… …ps (internal and external) and verify line translations. (#242) Add the vitest test framework and tests for SourceMap.ts and Utils.ts New project `test-source-maps` to generate test source maps (both inline and external). Also rolled back some dependabot version updates that don't work. --------- Co-authored-by: Raphael Landaverde <[email protected]>
fix(sourcemaps): Fix inline source map regex match pattern if no tags… … in match string. (#241) Regex was: `const inlineSourceMapRegex = /\/\/# sourceMappingURL=data:application\/json;.*;base64,(.*)$/gm;` Now: `const inlineSourceMapRegex = /\/\/# sourceMappingURL=data:application\/json;.*base64,(.*)$/gm;` Remove the semicolon before base64. Check that the results of mapFileName.split found /scripts/ before indexing the array.
PreviousNext