Skip to content

Commit

Permalink
textDocument/didOpen: Enrich warning message (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Jul 6, 2020
1 parent 5a36fdf commit 6ad9609
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions langserver/handlers/did_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6ad9609

Please sign in to comment.