VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

HCL plugin is broken with Intellij IDEA 2021.2 #349

Closed xfournet closed 3 years ago

xfournet commented 3 years ago

Thank you for opening an issue.

Prerequisites

Installation details

Terraform Configuration Files

terraform {
  required_version = "1.0.3"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "3.51.0"
    }
  }
}

resource "aws_s3_bucket" "this" {
  bucket = "hcl-plugin-is-broken"
  force_destroy = true

  versioning {
    enabled = true
  }

  server_side_encryption_configuration {
    rule {
      apply_server_side_encryption_by_default {
        sse_algorithm = "AES256"
      }
    }
  }
}

data "aws_iam_policy_document" "this" {
  statement {
    sid = "AllowSSLRequestsOnly"
    effect = "Deny"
    principals {
      type = "*"
      identifiers = ["*"]
    }
    actions = ["s3:*"]
    resources = [
      aws_s3_bucket.this.arn,
      "${aws_s3_bucket.this.arn}/*"
    ]
    condition {
      test = "Bool"
      variable = "aws:SecureTransport"
      values = [false]
    }
  }
}

resource "aws_s3_bucket_policy" "this" {
  bucket = aws_s3_bucket.this.id
  policy = data.aws_iam_policy_document.this.json
}

Expected Behavior

File is valid, no warning or errors should be reported by the IDE. It was working correctly with previous IDEA version

Actual Behavior

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create a main.tf file in IDEA with the content above
  2. See the warning and errors
  3. See completion is not working
lukvdborne commented 3 years ago

I tried it with the stable build and have them same issue.

IntelliJ IDEA 2021.2 (Ultimate Edition)
Build #IU-212.4746.92, built on July 27, 2021
Licensed to xxx
Subscription is active until August 12, 2021.
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.5
GC: G1 Young Generation, G1 Old Generation
Memory: 1536M
Cores: 8
Registry: search.everywhere.settings=true
Non-Bundled Plugins: YAML/Ansible support (0.11.2), com.intellij.apacheConfig (212.4746.57), com.intellij.plugins.watcher (212.4746.52), org.intellij.plugins.hcl (0.7.10), org.jetbrains.plugins.localization (212.4746.57), org.jetbrains.plugins.rest (212.4746.57), AWSCloudFormation (212.4746.57), com.intellij.lang.puppet (212.4746.57), org.toml.lang (0.2.151.3997-212), org.elixir_lang (11.10.0), Pythonid (212.4746.96), org.jetbrains.plugins.ruby (212.4746.92), com.intellij.plugins.html.instantEditing (212.4746.57), com.jetbrains.php (212.4746.92), org.jetbrains.plugins.go (212.4746.92), org.rust.lang (0.4.151.3997-212)
Kotlin: 212-1.5.10-release-IJ4746.92
rviniandrade commented 3 years ago

I have the same issue here. How can we roll back the update?


Build #PC-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.10.0-8-amd64
GC: G1 Young Generation, G1 Old Generation
Memory: 984M
Cores: 8
Non-Bundled Plugins: org.intellij.plugins.hcl (0.7.10), ru.adelf.idea.dotenv (2021.2.212)
Current Desktop: KDE```
lukvdborne commented 3 years ago

@rviniandrade I just rolled back using the Toolbox

image
rviniandrade commented 3 years ago

@rviniandrade I just rolled back using the Toolbox

image

Thank you very much @lukvdborne

billylaing commented 3 years ago

Same issue here.

PyCharm 2021.2 (Professional Edition)
Build #PY-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Non-Bundled Plugins: org.intellij.plugins.hcl (0.7.10)
kwitkow commented 3 years ago

Confirmed

IntelliJ IDEA 2021.2 (Ultimate Edition) Build #IU-212.4746.92, built on July 27, 2021 Licensed to *** You have a perpetual fallback license for this version. Subscription is active until July 31, 2022. Runtime version: 11.0.11+9-b1504.13 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.15.7 GC: ParNew, ConcurrentMarkSweep Memory: 1979M Cores: 12 Non-Bundled Plugins: org.intellij.plugins.hcl (0.7.10), com.atlassian.bitbucket.references (2021.2.171), com.intellij.kubernetes (212.4746.57), com.demonwav.minecraft-dev (2021.2-1.5.12), Pythonid (212.4746.96), com.jetbrains.php (212.4746.100) Kotlin: 212-1.5.10-release-IJ4746.92

Fran-E commented 3 years ago

Same issue for me with 2021.2. Rollback on 2021.1.4 done.

Do we have news about this?

Thanks in advance.

craigday commented 3 years ago

Same issue here.

IntelliJ IDEA 2021.2 (Ultimate Edition) Build #IU-212.4746.92, built on July 27, 2021 Runtime version: 11.0.11+9-b1504.13 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 11.4 GC: ParNew, ConcurrentMarkSweep Memory: 1979M Cores: 16 Non-Bundled Plugins: FrameSwitcher (3.26.1-203), Statistic (4.1.7), io.snyk.snyk-intellij-plugin (2.2.1), org.intellij.plugins.hcl (0.7.10), String Manipulation (8.15.203.000.3), com.dmarcotte.handlebars (212.4746.57), Dart (212.4746.57), io.flutter (59.0.4), io.kanro.idea.plugin.protobuf (1.4.1) Kotlin: 212-1.5.10-release-IJ4746.92

kwitkow commented 3 years ago

Rollback is problematic because lots of plugins are also updated and do not work with previous version of IntelliJ :(

billylaing commented 3 years ago

Update: This started working for me again. I confirmed I have the same version of PyCharm and the plugin installed.

PyCharm 2021.2 (Professional Edition)
Build #PY-212.4746.96, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Non-Bundled Plugins: org.intellij.plugins.hcl (0.7.10)
G-Rath commented 3 years ago

I believe 2021.2 made some changes to indexing that meant pre 2021.2 indexes got thrown out - you should be able to fix this issue by reloading the terraform module:

image

Fran-E commented 3 years ago

Thanks G-Rath, reloading the terraform module solve this problem but, for me, it's required at each start. I think there is still something wrong?

G-Rath commented 3 years ago

@Fran-E ugh yeah I get that too when restarting - and JetBrains don't care.

hazmeister commented 3 years ago

Thanks G-Rath, reloading the terraform module solve this problem but, for me, it's required at each start. I think there is still something wrong?

Additionally, I need to close and re-open my project (without fully quitting IntelliJ) after reloading the module. But as other commenters have said, this only seems to last until you relaunch IntelliJ.

As soon as I change file it's forgotten the model again.

jeremysmitherman commented 3 years ago

The model reload works for the current session, but breaks again on restart. Is there anything we can do to help debug this?

sergei-ivanov commented 3 years ago

I opted for a simple way out: I rolled my IntelliJ IDEA back to 2021.1. It was a bit of a hassle, but working Terraform plugin is more important to me than any new features in 2021.2. Lack of commitment on the part of JetBrains is really disappointing here. If they don't have resources to support the plugin, they should offer the stewardship to HashiCorp and give the source code back to the community.

rajaie-sg commented 3 years ago

I emailed JetBrains support asking about the plugin and got this response

Responsible developer is working on the compatibility issue with the latest IntelliJ IDE release. We'll release a new version of the plug-in in a few weeks. Sorry for the inconvenience.

M1kep commented 3 years ago

I believe I'm running into this issue as well. So far I've found that if the first file to be opened is an empty .tf file, the plugin seems to load properly.

M1kep commented 3 years ago

For anybody wondering, here's the error that is logged when the model fails to load:

https://gist.github.com/M1kep/228c6d02e4cbc35b6c4c34379862e6a7

alejandrod-f commented 3 years ago

Same issue here. Mental note: Do not ever upgrade IntelliJ too fast. Is a terrible experience... It always have issues. I can confirm that it's fixed with the reload thing as described by @G-Rath Thanks!!

timja commented 3 years ago

Looks like a new release is out

VladRassokhin commented 3 years ago

Fixed in 0.7.11+

zerubeus commented 2 years ago

this is not fixed at all still have the same problem, I'm in 0.7.14

ikarlashov commented 2 years ago

@VladRassokhin It's broken (again?).

Plugin version: 0.7.14

IntelliJ IDEA 2021.2.1 (Community Edition)
Build #IC-212.5080.55, built on August 24, 2021
Runtime version: 11.0.11+9-b1504.16 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.0.1
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Registry: groovy.process.nested.dfa=false
Non-Bundled Plugins: YAML/Ansible support (0.11.2), org.intellij.plugins.hcl (0.7.14), Docker (212.5080.8), PythonCore (212.5080.74)
Kotlin: 212-1.5.10-release-IJ5080.55

Terraform v1.0.10

0xFate commented 2 years ago

this is not fixed at all still have the same problem, I'm in 0.7.14

or broken again since TF v1.0.10+ same issue on 0.7.14 Terraform v1.1.2

timja commented 2 years ago

This issue was fixed I suggest opening a new issue rather than commenting on an old one.

VladRassokhin commented 2 years ago

Please open new issue indeed with more details than "it's broken", that isn't helpful.