Migrate uri handler to use download item definition #42
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.
With the local folder work completed, update the default UriHandler to use the
vscode-fabric.exportArtifactcommand ("Download Item Definition..."). This avoids using the deprecated API that the uri handler had been using, and simplifies the code by deferring more of the work to the command handler.For its part, the command handler was updated to handle artifactId/workspaceId/environment rather than working directly against the assumed artifact node (FWIW, this may be a pattern we should consider for other commands).
When the command is invoked in this manner the appropriate prompts will be shown in a modal dialog without the "Do nothing" option, the reasoning being that the user has already taken a deliberate action to open the item in VS Code rather than potentially just downloading the item for use in a different context.
The change also prompts the user to sign in (if appropriate) prior to using any Fabric API.
Errors are also shown directly to the user in this specific use case via toast rather than silently failing as had been the case in the past (another pattern to consider more broadly)