Azure / Azure/vscode-azureterraform

Add an explicit command to convert JSON to AzAPI configuration

Open
#367 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rich Text Format
Stars
40
Forks
40
Avg merge
9d 1h
Merged PRs (30d)
2

Description

Suggested labels: `enhancement`, `azapi`, `ux`

## Problem

JSON-to-AzAPI conversion currently happens implicitly through the paste handler. There is no Command Palette action that lets a user explicitly say “convert this JSON,” and conversion failures are effectively silent: the original JSON remains in the editor while the error is only written to the extension output channel.

The paste-only behavior is also limiting. A user may want to convert:

- JSON already present in the editor;
- the current selection;
- clipboard contents without first pasting them; or
- a JSON/ARM template file.

## Expected behavior

Provide a command such as `Microsoft Terraform: Convert JSON to AzAPI configuration` that explicitly starts the conversion and makes the input source clear. At minimum, the command should support the current editor selection, with clipboard or file input as follow-up options if appropriate.

The command should show visible feedback when conversion fails or times out, including an actionable link or button to open the Microsoft Terraform output channel. It should avoid replacing the input until conversion succeeds and, ideally, offer a preview or confirmation before replacing a selection/document.

## Current behavior

The extension attempts conversion only after a document-change event that looks like a paste. If the handler does not recognize the paste, the language server is unavailable, or conversion fails, the user receives no editor notification and there is no explicit retry command.

## Acceptance criteria

- An explicit Command Palette command exists for JSON-to-AzAPI conversion.
- The command can convert a selected JSON payload without requiring a paste operation.
- Conversion errors and timeouts are visible in the editor or a notification, not only in the output channel.
- The original content is preserved when conversion fails.
- The existing automatic paste convenience remains available, but is no longer the only way to invoke conversion.

## Environment

- Microsoft Terraform extension: `0.10.3`
- VS Code: `1.131.0`
- Windows (`windows_amd64`)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the existing paste handler and JSON-to-AzAPI conversion entry point, then inspect how the VS Code extension registers commands and writes to the output channel. Add an explicit selection-based command, visible failure feedback, and preservation of the original content when conversion fails, while keeping automatic paste conversion available.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.