From bd89355d77ac11cdec2cfc0c8481aa6a38587d70 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/langserver/handlers/service.go b/internal/langserver/handlers/service.go index 7286a72d1..d60ef9198 100644 --- a/internal/langserver/handlers/service.go +++ b/internal/langserver/handlers/service.go @@ -272,7 +272,9 @@ func (svc *service) Assigner() (jrpc2.Assigner, error) { ctx = lsctx.WithDiagnosticsNotifier(ctx, svc.diagsNotifier) ctx = lsctx.WithExperimentalFeatures(ctx, &expFeatures) ctx = lsctx.WithModuleFinder(ctx, svc.modMgr) + ctx = lsctx.WithModuleManager(ctx, svc.modMgr) ctx = exec.WithExecutorOpts(ctx, svc.tfExecOpts) + ctx = exec.WithExecutorFactory(ctx, svc.tfExecFactory) return handle(ctx, req, lh.TextDocumentDidSave) },