hashicorp / terraform-ls

Terraform Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Open a folder with the above config
  2. Open file with the above config from that folder
  3. 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.

commented

Is this included in any roadmap, or is there a quick fix available?