Skip to content

feat(debugger): prompt user for target add-on id if not provided and multiple add-ons active in MC. #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

chmeyer-ms
Copy link
Contributor

In an effort to improve the "it just works" scenarios, this PR presents a QuickPickMenu to the user if the targetModuleUUID is not set (or incorrect) and MC has multiple active add-ons.

  • if a targetModuleUUID is set and MC reports having this plugin, no pop up menu
  • if target is set and MC does not have this plugin, warn and then show pop with available plugins
  • if target is not set but there's only 1 active plugin, connect without menu
  • if target is not set and there are multiple active plugins, show pop up menu

@chmeyer-ms chmeyer-ms self-assigned this Sep 6, 2024
@chmeyer-ms chmeyer-ms changed the title Prompt user for target add-on id if not provided and multiple add-ons active in MC. (feat) prompt user for target add-on id if not provided and multiple add-ons active in MC. Sep 6, 2024
@chmeyer-ms chmeyer-ms changed the title (feat) prompt user for target add-on id if not provided and multiple add-ons active in MC. feat(debugger) prompt user for target add-on id if not provided and multiple add-ons active in MC. Sep 6, 2024
@chmeyer-ms chmeyer-ms changed the title feat(debugger) prompt user for target add-on id if not provided and multiple add-ons active in MC. feat(debugger): prompt user for target add-on id if not provided and multiple add-ons active in MC. Sep 6, 2024
src/Session.ts Outdated
return;
} else {
this.showNotification(
`Minecraft Add-On not found with targetModuleUuid ${this._targetModuleUuid} specified in launch.json. Prompting for debug target.`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should reference the fact that this need to be the script module's UUID, not the add-on's/pack's UUID

return;
} else {
this.showNotification(
'The targetModuleUuid in launch.json is not set to a valid uuid. Set this to a script module uuid (manifest.json) to avoid the selection prompt.',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does code blocks work in the notifications? If so, "The targetModuleUuid in launch.json..." might be better.

src/Session.ts Outdated
};
window.showQuickPick(items, options).then(value => {
if (!value) {
this.terminateSession('could not determine target Minecraft Add-On.', LogLevel.Error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say something like "You must select a target module"?

@chmeyer-ms chmeyer-ms merged commit 1b6a6d1 into main Sep 9, 2024
2 checks passed
@chmeyer-ms chmeyer-ms deleted the chmeyer/dbg_notify branch September 9, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants