textDocument/complete: Provide completion in incomplete blocks
radeksimko opened this issue · comments
Server Version
v0.1.0
Terraform Version
v0.12.24
Terraform Configuration Files
provider "aws" {
}
resource "aws_vpc" "name" {
}
data ""
Log Output
2020/04/21 11:11:11 rpc_logger.go:45: Error for "textDocument/completion" (ID 6): [-32098] finding HCL block failed: no block found at hcl.Pos{Line:5, Column:7, Byte:55}
Expected Behavior
A list of all AWS data sources offered as completion candidates.
(assuming that completion of data source names per #19 is implemented)
Actual Behavior
No completion available.
Steps to Reproduce
- Open a folder with the above config
- Open file with the above config from that folder
- Trigger autocompletion on line 5, column 7 (1-indexed) - i.e.
data "<HERE>"
Proposal
hashicorp/hcl#365 is key to make this work - in theory when it's addressed and we upgrade to the HCL version with that patch it should be just resolved.
This is temporarily being de-prioritised in favour of #18 which is slightly easier and quicker to solve and can address at least cases where user uses completion to create the block.
Is this included in any roadmap, or is there a quick fix available?