From 6ad960992b2d7430ab1e6cd036f32990fc2c067a Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 6 Jul 2020 20:49:40 +0100 Subject: [PATCH] textDocument/didOpen: Enrich warning message (#205) --- langserver/handlers/did_open.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/langserver/handlers/did_open.go b/langserver/handlers/did_open.go index aa863a1d2..457324748 100644 --- a/langserver/handlers/did_open.go +++ b/langserver/handlers/did_open.go @@ -33,8 +33,11 @@ func TextDocumentDidOpen(ctx context.Context, params lsp.DidOpenTextDocumentPara candidates := cf.RootModuleCandidatesByPath(f.Dir()) if len(candidates) == 0 { - msg := fmt.Sprintf("No root module found for %s"+ - " functionality may be limited", f.Filename()) + msg := fmt.Sprintf("No root module found for %s."+ + " Functionality may be limited."+ + // Unfortunately we can't be any more specific wrt where + // because we don't gather "init-able folders" in any way + " You may need to run terraform init", f.Filename()) return jrpc2.ServerPush(ctx, "window/showMessage", lsp.ShowMessageParams{ Type: lsp.MTWarning, Message: msg,