From a8816a0ffda10207f2bde288c26a42e2f90cc84f Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Fri, 1 Sep 2023 12:51:53 +0200 Subject: [PATCH] Add progress reporting for Terraform validate (#1373) --- internal/langserver/handlers/command/validate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/langserver/handlers/command/validate.go b/internal/langserver/handlers/command/validate.go index 5b61e2237..49aace908 100644 --- a/internal/langserver/handlers/command/validate.go +++ b/internal/langserver/handlers/command/validate.go @@ -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" @@ -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 {