Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown block type: "terraform" (terraform 0.13 unsupported?) #280

Closed
kevincantu opened this issue Oct 23, 2020 · 4 comments
Closed

unknown block type: "terraform" (terraform 0.13 unsupported?) #280

kevincantu opened this issue Oct 23, 2020 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@kevincantu
Copy link

So I'm upgrading to 0.13 just as I've changed editors to VS Code and installed this extension... And I see somewhat limited functionality. While working out other adjustments to settings I've discovered this in the Output tab, that's somewhat startling:

2020/10/23 13:18:19 parser.go:178: parsing config block failed: unknown block type: "terraform"

Part of my ~/Library/Application Support/Code/User/settings.json:

...
    "terraform.languageServer": {
    
        "external": true,
        "pathToBinary": "",
        "args": [
            "serve"
        ],
        "maxNumberOfProblems": 100,
        "trace.server": "off"
    },
    "terraform-ls.rootModules": [
        "~/infra/env-labinfra",
    ],
    "[terraform]": {
        "editor.formatOnSave": true
    }
}

The output of the tab in the console corresponding to terraform-ls: that repo:

2020/10/23 13:17:23 server.go:568: Received 1 new requests
2020/10/23 13:17:23 server.go:174: Processing 1 requests
2020/10/23 13:17:23 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":32},"contentChanges":[{"range":{"start":{"line":24,"character":3},"end":{"line":24,"character":3}},"rangeLength":0,"text":"\n  "}]}
2020/10/23 13:17:23 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":32},"contentChanges":[{"range":{"start":{"line":24,"character":3},"end":{"line":24,"character":3}},"rangeLength":0,"text":"\n  "}]}
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:17:23 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 server.go:568: Received 1 new requests
2020/10/23 13:17:23 server.go:174: Processing 1 requests
2020/10/23 13:17:23 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:23 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 24): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:17:23 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:17:23 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 24): null
2020/10/23 13:17:23 server.go:246: Completed 1 requests [13.690966ms elapsed]
2020/10/23 13:17:23 server.go:568: Received 1 new requests
2020/10/23 13:17:23 server.go:174: Processing 1 requests
2020/10/23 13:17:23 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":33},"contentChanges":[{"range":{"start":{"line":25,"character":0},"end":{"line":25,"character":2}},"rangeLength":2,"text":""}]}
2020/10/23 13:17:23 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":33},"contentChanges":[{"range":{"start":{"line":25,"character":0},"end":{"line":25,"character":2}},"rangeLength":2,"text":""}]}
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:17:23 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 server.go:568: Received 1 new requests
2020/10/23 13:17:23 server.go:174: Processing 1 requests
2020/10/23 13:17:23 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:23 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 25): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:23 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:17:23 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:17:23 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 25): null
2020/10/23 13:17:23 server.go:246: Completed 1 requests [11.822531ms elapsed]
2020/10/23 13:17:27 server.go:568: Received 1 new requests
2020/10/23 13:17:27 server.go:174: Processing 1 requests
2020/10/23 13:17:27 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":34},"contentChanges":[{"range":{"start":{"line":25,"character":0},"end":{"line":26,"character":0}},"rangeLength":1,"text":""}]}
2020/10/23 13:17:27 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":34},"contentChanges":[{"range":{"start":{"line":25,"character":0},"end":{"line":26,"character":0}},"rangeLength":1,"text":""}]}
2020/10/23 13:17:27 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:27 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:17:27 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:27 server.go:568: Received 1 new requests
2020/10/23 13:17:27 server.go:174: Processing 1 requests
2020/10/23 13:17:27 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:27 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 26): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:17:27 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:27 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:27 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:17:27 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:17:27 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 26): null
2020/10/23 13:17:27 server.go:246: Completed 1 requests [13.752661ms elapsed]
2020/10/23 13:17:30 server.go:568: Received 1 new requests
2020/10/23 13:17:30 server.go:174: Processing 1 requests
2020/10/23 13:17:30 server.go:265: Checking request for "textDocument/formatting": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:17:30 rpc_logger.go:29: Incoming request for "textDocument/formatting" (ID 27): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:17:30 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:30 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:17:30 cmd.go:133: [INFO] running Terraform command: /Users/kevincantu/bin/terraform fmt -no-color -
2020/10/23 13:17:30 rpc_logger.go:50: Response to "textDocument/formatting" (ID 27): []
2020/10/23 13:17:30 server.go:246: Completed 1 requests [51.122102ms elapsed]
2020/10/23 13:18:19 server.go:568: Received 1 new requests
2020/10/23 13:18:19 server.go:174: Processing 1 requests
2020/10/23 13:18:19 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":35},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:19 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":35},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:19 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:19 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 server.go:568: Received 1 new requests
2020/10/23 13:18:19 server.go:174: Processing 1 requests
2020/10/23 13:18:19 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":36},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:19 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":36},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:19 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:19 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 server.go:568: Received 1 new requests
2020/10/23 13:18:19 server.go:174: Processing 1 requests
2020/10/23 13:18:19 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:19 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 28): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:19 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:19 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:19 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:19 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 28): null
2020/10/23 13:18:19 server.go:246: Completed 1 requests [10.909443ms elapsed]
2020/10/23 13:18:20 server.go:568: Received 1 new requests
2020/10/23 13:18:20 server.go:174: Processing 1 requests
2020/10/23 13:18:20 server.go:265: Checking request for "textDocument/formatting": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:20 rpc_logger.go:29: Incoming request for "textDocument/formatting" (ID 29): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:20 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 cmd.go:133: [INFO] running Terraform command: /Users/kevincantu/bin/terraform fmt -no-color -
2020/10/23 13:18:20 rpc_logger.go:50: Response to "textDocument/formatting" (ID 29): [{"range":{"start":{"line":18,"character":0},"end":{"line":19,"character":0}},"newText":"      sour                    = \"hashicorp/aws\"\n"}]
2020/10/23 13:18:20 server.go:246: Completed 1 requests [52.19475ms elapsed]
2020/10/23 13:18:20 server.go:568: Received 1 new requests
2020/10/23 13:18:20 server.go:174: Processing 1 requests
2020/10/23 13:18:20 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":37},"contentChanges":[{"range":{"start":{"line":18,"character":28},"end":{"line":18,"character":28}},"rangeLength":0,"text":"  "}]}
2020/10/23 13:18:20 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":37},"contentChanges":[{"range":{"start":{"line":18,"character":28},"end":{"line":18,"character":28}},"rangeLength":0,"text":"  "}]}
2020/10/23 13:18:20 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:20 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 server.go:568: Received 1 new requests
2020/10/23 13:18:20 server.go:174: Processing 1 requests
2020/10/23 13:18:20 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:20 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 30): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:20 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:20 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:20 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:20 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 30): null
2020/10/23 13:18:20 server.go:246: Completed 1 requests [11.540853ms elapsed]
2020/10/23 13:18:24 server.go:568: Received 1 new requests
2020/10/23 13:18:24 server.go:174: Processing 1 requests
2020/10/23 13:18:24 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":38},"contentChanges":[{"range":{"start":{"line":18,"character":28},"end":{"line":18,"character":30}},"rangeLength":2,"text":""}]}
2020/10/23 13:18:24 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":38},"contentChanges":[{"range":{"start":{"line":18,"character":28},"end":{"line":18,"character":30}},"rangeLength":2,"text":""}]}
2020/10/23 13:18:24 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:24 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:24 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 server.go:568: Received 1 new requests
2020/10/23 13:18:25 server.go:174: Processing 1 requests
2020/10/23 13:18:25 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:25 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 31): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:25 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:25 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 31): null
2020/10/23 13:18:25 server.go:246: Completed 1 requests [10.989955ms elapsed]
2020/10/23 13:18:25 server.go:568: Received 1 new requests
2020/10/23 13:18:25 server.go:174: Processing 1 requests
2020/10/23 13:18:25 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":39},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":10}},"rangeLength":0,"text":"e"}]}
2020/10/23 13:18:25 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":39},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":10}},"rangeLength":0,"text":"e"}]}
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:25 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 server.go:568: Received 1 new requests
2020/10/23 13:18:25 server.go:174: Processing 1 requests
2020/10/23 13:18:25 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:25 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 32): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:25 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:25 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 32): null
2020/10/23 13:18:25 server.go:246: Completed 1 requests [11.74286ms elapsed]
2020/10/23 13:18:25 server.go:568: Received 1 new requests
2020/10/23 13:18:25 server.go:174: Processing 1 requests
2020/10/23 13:18:25 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":40},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":10}},"rangeLength":0,"text":"c"}]}
2020/10/23 13:18:25 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":40},"contentChanges":[{"range":{"start":{"line":18,"character":10},"end":{"line":18,"character":10}},"rangeLength":0,"text":"c"}]}
2020/10/23 13:18:25 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:25 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:25 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:26 server.go:568: Received 1 new requests
2020/10/23 13:18:26 server.go:174: Processing 1 requests
2020/10/23 13:18:26 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:26 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 33): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:26 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:26 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:26 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:26 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:26 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 33): null
2020/10/23 13:18:26 server.go:246: Completed 1 requests [13.773507ms elapsed]
2020/10/23 13:18:29 server.go:568: Received 1 new requests
2020/10/23 13:18:29 server.go:174: Processing 1 requests
2020/10/23 13:18:29 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":41},"contentChanges":[{"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:29 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":41},"contentChanges":[{"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":11}},"rangeLength":1,"text":""}]}
2020/10/23 13:18:29 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:29 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:29 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:29 server.go:568: Received 1 new requests
2020/10/23 13:18:29 server.go:174: Processing 1 requests
2020/10/23 13:18:29 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:29 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 34): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:29 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:29 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:29 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:29 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:29 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 34): null
2020/10/23 13:18:29 server.go:246: Completed 1 requests [13.651267ms elapsed]
2020/10/23 13:18:30 server.go:568: Received 1 new requests
2020/10/23 13:18:30 server.go:174: Processing 1 requests
2020/10/23 13:18:30 server.go:265: Checking request for "textDocument/formatting": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:30 rpc_logger.go:29: Incoming request for "textDocument/formatting" (ID 35): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:30 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:30 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:30 cmd.go:133: [INFO] running Terraform command: /Users/kevincantu/bin/terraform fmt -no-color -
2020/10/23 13:18:30 rpc_logger.go:50: Response to "textDocument/formatting" (ID 35): []
2020/10/23 13:18:30 server.go:246: Completed 1 requests [52.112331ms elapsed]
2020/10/23 13:18:34 server.go:568: Received 1 new requests
2020/10/23 13:18:34 server.go:174: Processing 1 requests
2020/10/23 13:18:34 server.go:265: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":42},"contentChanges":[{"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":10}},"rangeLength":0,"text":"_"}]}
2020/10/23 13:18:34 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","version":42},"contentChanges":[{"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":10}},"rangeLength":0,"text":"_"}]}
2020/10/23 13:18:34 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:34 server.go:438: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf","diagnostics":[]}
2020/10/23 13:18:34 root_module.go:354: 1 provider references found for /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:35 server.go:568: Received 1 new requests
2020/10/23 13:18:35 server.go:174: Processing 1 requests
2020/10/23 13:18:35 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:35 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 36): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"}}
2020/10/23 13:18:35 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:35 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:35 parser.go:230: Parsed block type: "terraform"
2020/10/23 13:18:35 parser.go:178: parsing config block failed: unknown block type: "terraform"
2020/10/23 13:18:35 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 36): null
2020/10/23 13:18:35 server.go:246: Completed 1 requests [13.977503ms elapsed]
2020/10/23 13:18:36 server.go:568: Received 1 new requests
2020/10/23 13:18:36 server.go:174: Processing 1 requests
2020/10/23 13:18:36 server.go:265: Checking request for "textDocument/formatting": {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:36 rpc_logger.go:29: Incoming request for "textDocument/formatting" (ID 37): {"textDocument":{"uri":"file:///Users/kevincantu/infra/env-labinfra/backend.tf"},"options":{"tabSize":2,"insertSpaces":true}}
2020/10/23 13:18:36 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:36 root_module_manager.go:149: direct root module lookup succeeded: /Users/kevincantu/infra/env-labinfra
2020/10/23 13:18:36 cmd.go:133: [INFO] running Terraform command: /Users/kevincantu/bin/terraform fmt -no-color -
2020/10/23 13:18:36 rpc_logger.go:50: Response to "textDocument/formatting" (ID 37): []
2020/10/23 13:18:36 server.go:246: Completed 1 requests [51.970257ms elapsed]

It seems to have a problem with my backend.tf:

terraform {
  backend "s3" {
    // your AWS user needs permission:
    // * to reach the manually created S3 bucket and DynamoDB table for this backend, and
    // * to create the resources defined
    shared_credentials_file = "~/.aws/credentials"
    profile                 = "mfa"

    // manually created with versioning enabled
    bucket = "mybucket"
    key    = "labinfra/v1.tfstate"
    region = "us-west-2"

    // manually created with default settings and Partition key of "LockID" (string)
    dynamodb_table = "ecl-terraform-labinfra-v1-state-lock"
  }

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.12"
    }
  }
}

provider "aws" {
  profile                 = "mfa"
  region                  = var.aws_region
  shared_credentials_file = "~/.aws/credentials"
}

Which can, with 0.13, be init / plan / applied without objections.

Formatting on save works!

But what i expect is that schema errors should be detected and displayed. Actually, however, they're not!

I can change that to required_providersxxxxx and save the file and see no problems in VS Code, when a terraform plan reveals:

% terraform plan

Error: Unsupported block type

  on backend.tf line 17, in terraform:
  17:   required_providersxxxx {

Blocks of type "required_providersxxxx" are not expected here.

So something is wrong.

@radeksimko radeksimko transferred this issue from hashicorp/vscode-terraform Oct 26, 2020
@radeksimko
Copy link
Member

Hi @kevincantu
You are right that our schema support in general (which affects completion amongst other things) is currently limited.

There are differences between Terraform core versions (in terms of schema/syntax), which will need to be reflected in the underlying HCL decoder. For now we only support the essential blocks which don't differ between versions and for which we have schema (by obtaining it from providers) - which is provider, resource and data blocks.

"provider": &providerBlockFactory{
logger: p.logger,
schemaReader: p.schemaReader,
providerRefs: p.providerRefs,
},
"resource": &resourceBlockFactory{
logger: p.logger,
schemaReader: p.schemaReader,
providerRefs: p.providerRefs,
},
"data": &datasourceBlockFactory{
logger: p.logger,
schemaReader: p.schemaReader,
providerRefs: p.providerRefs,
},

Supporting other blocks, such as the terraform block is one of the current priorities and it is something I'm working on. I will provide an update here once I have something to share.

@radeksimko radeksimko added this to the v0.9.0 milestone Nov 11, 2020
@radeksimko radeksimko added the enhancement New feature or request label Nov 11, 2020
@radeksimko
Copy link
Member

Version 0.9.0 which was released yesterday provides completion based on version-aware core schema, which includes the terraform block.

Screenshot 2020-11-11 at 15 36 39

The only part of the block that is not completable yet is the body of the backend block. That task is however tracked under #285

VS Code should automatically update LS to the latest version on the next launch, or if you restart it.

With that in mind I'm going to close this issue.

@kevincantu
Copy link
Author

Awesome! 🐬

@ghost
Copy link

ghost commented Dec 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants