Skip to content

Commit 0c9c3e4

Browse files
committed
Exposed debug on azd
1 parent a176653 commit 0c9c3e4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Commands/InfraSynth.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ protected override async Task ExecuteAsync(OleMenuCmdEventArgs e, Project projec
2323
var stdOutBuffer = new StringBuilder();
2424
var stdErrBuffer = new StringBuilder();
2525
OutputWindowPane pane = await VS.Windows.GetOutputWindowPaneAsync(Community.VisualStudio.Toolkit.Windows.VSOutputWindowPane.General);
26+
var options = await General.GetLiveInstanceAsync();
2627

2728
var projectPath = FindAzureYaml(project.FullPath);
2829

2930
await VS.StatusBar.StartAnimationAsync(StatusAnimation.Sync);
3031
await VS.StatusBar.ShowProgressAsync(STATUS_MESSAGE, 1, 2);
3132

33+
var command = $"infra synth --force --no-prompt" + (options.AzdDebug ? " --debug" : "");
34+
3235
var result = await Cli.Wrap("azd")
33-
.WithArguments($"infra synth --force --no-prompt")
36+
.WithArguments(command)
3437
.WithWorkingDirectory(projectPath)
3538
.WithStandardOutputPipe(PipeTarget.ToStringBuilder(stdOutBuffer))
3639
.WithStandardErrorPipe(PipeTarget.ToStringBuilder(stdErrBuffer))
@@ -47,6 +50,7 @@ protected override async Task ExecuteAsync(OleMenuCmdEventArgs e, Project projec
4750
else
4851
{
4952
await pane.WriteLineAsync($"[AZD]: infra synth completed");
53+
await pane.WriteLineAsync($"[AZD]: {stdOutBuffer}");
5054
}
5155

5256
await VS.Documents.OpenAsync(Path.Combine(projectPath, "infra", "resources.bicep"));

src/Options/General.cs

+6
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ public class General : BaseOptionModel<General>
2222
[Description("Use a temporary file on disk instead of project location")]
2323
[DefaultValue(true)]
2424
public bool UseTempFile { get; set; } = true;
25+
26+
[Category("Manifest file")]
27+
[DisplayName("Enable azd debug output")]
28+
[Description("Enables azd debug output (--debug) to the infra synth")]
29+
[DefaultValue(false)]
30+
public bool AzdDebug { get; set; } = false;
2531
}

0 commit comments

Comments
 (0)