Vscode-terraform: Nothing works after update to 2.x

Created on 12 Jun 2020  ยท  15Comments  ยท  Source: hashicorp/vscode-terraform

It's kinda unusable now, and install another version returns 404

:disappointed:

Currently looks like extension doesn't support configuration with multiple environments configs with subfolders, and if I open "project" from env folder then all referenced modules don't work.
My setup (that was working until now):

.
โ”œโ”€โ”€ env
โ”‚   โ”œโ”€โ”€ staging-dev
โ”‚   โ”‚   โ”œโ”€โ”€ main.tf
โ”‚   โ”‚   โ””โ”€โ”€ variables.tf
โ”‚   โ””โ”€โ”€ staging-qa
โ”‚       โ”œโ”€โ”€ main.tf
โ”‚       โ””โ”€โ”€ variables.tf
โ”œโ”€โ”€ modules
โ”‚   โ”œโ”€โ”€ some_module
โ”‚   โ”‚   โ”œโ”€โ”€ main.tf
โ”‚   โ”‚   โ”œโ”€โ”€ outputs.tf
โ”‚   โ”‚   โ””โ”€โ”€ variables.tf
โ””โ”€โ”€ README.md

Most helpful comment

Ran into the same problem...workaround:

All the formatting is back & everything is happy again.

All 15 comments

Same here, very frustrating

.tf file formatting also busted.

I share your frustration. I had to install 1.4 with the .vsix and am still working with 0.11 syntax. At least that way you get some more advanced autocomplete, and even supports multiple configurations in sub-directories (which last I heard has no plans for support in 2.0).

As long as you open a single, initialized configuration, you get the listed features, which are only:

  • Manages installation and updates of the Terraform Language Server (terraform-ls), exposing its features:

    • Initialized provider completion (resource names, data source names, attribute names)

  • Includes syntax highlighting for .tf and .tfvars files (and .hcl) -- including all syntax changes new to Terraform 0.12
  • Closes braces and quotes
  • Includes for_each and variable syntax shortcuts (fore, vare, varm)

But even some of these are kinda broken.

Well if that is true, I hope some one will fork 1.4 and continue from there.

1.4 work wonders for 0.12

2.x is huge disappointment in current state.

On Fri, 12 Jun 2020, 19:26 chriswacker, notifications@github.com wrote:

I share your frustration. I had to install 1.4 with the .vsix and am still
working with 0.11 syntax. At least that way you get some more advanced
autocomplete, and even supports multiple configurations in sub-directories
(which last I heard has no plans for support in 2.0).

As long as you open a single, initialized configuration, you get the
listed features, which are only:

  • Manages installation and updates of the Terraform Language Server
    (terraform-ls), exposing its features:

    • Initialized provider completion (resource names, data source

      names, attribute names)

  • Includes syntax highlighting for .tf and .tfvars files (and .hcl) --
    including all syntax changes new to Terraform 0.12
  • Closes braces and quotes
  • Includes for_each and variable syntax shortcuts (fore, vare, varm)

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/hashicorp/vscode-terraform/issues/386#issuecomment-643395475,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AE53IY5EH3GTOLJR6MR4TETRWJQMJANCNFSM4N4GUEPA
.

I have a similar setup as the OP, this version completely breaks and is unusable.

Auto formatting doesn't work anymore... "There is no formatter for 'terraform' files installed."

No formating, no linting, no code suggestions.

Ran into the same problem...workaround:

All the formatting is back & everything is happy again.

Here are the canonical tracking issues for things raised in this thread:

  • Different folder structures: hashicorp/terraform-ls#32
  • Formatting without initialization: hashicorp/terraform-ls#165
  • Diagnostic support (red squiggles): hashicorp/terraform-ls#27
  • VS Code downgrade issue: microsoft/vscode#99699

Until the VS Code issue is resolved, you can manually downgrade following these instructions: https://github.com/hashicorp/vscode-terraform/wiki/Install-a-Pre-transfer-Version

Ran into the same problem...workaround:

All the formatting is back & everything is happy again.

Thank you so very much. Good to know I am not the only one losing my mind

@paultyng

The formatting does not work at all, not only when there is a missing initialization. And what is about code suggestions? In which Ticket it will be solved? Sorry for asking, but i dont see that and i alredy asked in another issue where this is not been answered.

@feeyu7 I think both of those issues are related to the different folder structure issue (https://github.com/hashicorp/terraform-ls/issues/32). We are working to support multiple different root and nested module configurations (including allowing users to just specify the one they want to use). So even if initialized, the root module detection is not finding the appropriate directory so causing it problems.

Ran into the same problem...workaround:

All the formatting is back & everything is happy again.

Thank you!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brodster2 picture brodster2  ยท  5Comments

bnm22 picture bnm22  ยท  6Comments

fcatacut picture fcatacut  ยท  5Comments

kagarlickij picture kagarlickij  ยท  5Comments

tillig picture tillig  ยท  4Comments