From f138325fd47eb24bcaa4334f3d1758ebc9fce2ae Mon Sep 17 00:00:00 2001 From: James Pogran Date: Tue, 22 Feb 2022 11:10:56 -0500 Subject: [PATCH] Fix validate on save The `/didSave` handler was missing WithModuleManager and WithExecutorFactory, which the validate command handler needs to find terraform to execute validate. --- internal/langserver/handlers/service.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/langserver/handlers/service.go b/internal/langserver/handlers/service.go index d7652e3d..8ca90c58 100644 --- a/internal/langserver/handlers/service.go +++ b/internal/langserver/handlers/service.go @@ -270,6 +270,7 @@ func (svc *service) Assigner() (jrpc2.Assigner, error) { ctx = lsctx.WithDiagnosticsNotifier(ctx, svc.diagsNotifier) ctx = lsctx.WithExperimentalFeatures(ctx, &expFeatures) ctx = exec.WithExecutorOpts(ctx, svc.tfExecOpts) + ctx = exec.WithExecutorFactory(ctx, svc.tfExecFactory) return handle(ctx, req, svc.TextDocumentDidSave) },