Vscode-terraform: Unknown token: IDENT string

Created on 28 May 2019  Â·  8Comments  Â·  Source: hashicorp/vscode-terraform

I am using vscode-terraform 1.3.11 with this Terraform configuration:

variable "prefix" {
  type = string
}

That is producing this error in the PROBLEMS tab:

Unknown token: 2:10 IDENT string [2,10]

As far as I can tell from the Terraform Documentation, this should be valid.

If I run the same code through terraform validate and tflint, I get no reported errors:

$ terraform validate
Success! The configuration is valid.

$ tflint
Awesome! Your code is following the best practices :)

$ terraform --version
Terraform v0.12.0
+ provider.aws v2.12.0

$ tflint --version
TFLint version 0.8.0

I have both terraform.lintPath and terraform.path set to point to the correct versions of terraform and tflint.

Most helpful comment

This bug still happens in version 1.4.0 with lsp server

All 8 comments

terraform 0.12 syntax is not yet supported, see issue #157

On Tue, May 28, 2019 at 4:29 PM Marc notifications@github.com wrote:

I am using vscode-terraform 1.3.11 with this Terraform configuration:

variable "prefix" {
type = string
}

That is producing this error in the PROBLEMS tab:

Unknown token: 2:10 IDENT string [2,10]

As far as I can tell from the Terraform Documentation
https://www.terraform.io/docs/configuration/variables.html#declaring-an-input-variable,
this should be valid.

If I run the same code through terraform validate and tflint, I get no
reported errors:

$ terraform validate
Success! The configuration is valid.

$ tflint
Awesome! Your code is following the best practices :)

$ terraform --version
Terraform v0.12.0

  • provider.aws v2.12.0

$ tflint --version
TFLint version 0.8.0

I have both terraform.lintPath and terraform.path set to point to the
correct versions of terraform and tflint.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mauve/vscode-terraform/issues/179?email_source=notifications&email_token=AAGCJGDDWCPX2GRSHIGJUZLPXU6V7A5CNFSM4HQD73E2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWH2TVQ,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGCJGC4LP76NA4HTNBJRHDPXU6V7ANCNFSM4HQD73EQ
.

Thanks for the quick reply, I'll follow that thread.

This bug still happens in version 1.4.0 with lsp server

This is annoying and I believe it is affecting how codelens is working.

Still an issue, seeing type = list(string) as invalid, code runs with no issues

Having this issue as well, code runs but VScode gives me an error (Unkown token: IDENT string).

Having this issue as well, latest versions of VSCode + extension + language server.

I love the auto complete functionality, but these random errors are extremely irritating, especially for someone who is trying to learn Terraform for the first time.

also getting these errors. for now i just turned off the linter by going to the settings and changing tflint binary to empty. this lets me still have syntax highlighting/etc at least

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacobisaliveandwell picture jacobisaliveandwell  Â·  3Comments

visokoo picture visokoo  Â·  3Comments

chrisgallivan picture chrisgallivan  Â·  4Comments

bnm22 picture bnm22  Â·  6Comments

avinashkavi447 picture avinashkavi447  Â·  7Comments