Skip to content

Commit

Permalink
Add progress reporting for Terraform validate (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Sep 28, 2023
1 parent 8b08cae commit a8816a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/langserver/handlers/command/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/hashicorp/terraform-ls/internal/document"
"github.com/hashicorp/terraform-ls/internal/job"
"github.com/hashicorp/terraform-ls/internal/langserver/cmd"
"github.com/hashicorp/terraform-ls/internal/langserver/progress"
"github.com/hashicorp/terraform-ls/internal/terraform/module"
op "github.com/hashicorp/terraform-ls/internal/terraform/module/operation"
"github.com/hashicorp/terraform-ls/internal/uri"
Expand All @@ -28,6 +29,12 @@ func (h *CmdHandler) TerraformValidateHandler(ctx context.Context, args cmd.Comm

dirHandle := document.DirHandleFromURI(dirUri)

progress.Begin(ctx, "Validating")
defer func() {
progress.End(ctx, "Finished")
}()

progress.Report(ctx, "Running terraform validate ...")
id, err := h.StateStore.JobStore.EnqueueJob(ctx, job.Job{
Dir: dirHandle,
Func: func(ctx context.Context) error {
Expand Down

0 comments on commit a8816a0

Please sign in to comment.