VladRassokhin / intellij-hcl

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

No autocompletion for for_each iterator #252

Closed G-Rath closed 5 years ago

G-Rath commented 5 years ago

Prerequisites

Installation details

IntelliJ Version details IntelliJ IDEA 2019.2.1 (Ultimate Edition) Build #IU-192.6262.58, built on August 21, 2019 Licensed to Gareth Jones Subscription is active until June 22, 2020 Runtime version: 11.0.2+9-b226.7 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1981M Cores: 8 Registry: analyze.exceptions.on.the.fly=true, java.completion.argument.hints.internal=false, git.use.builtin.ssh=true, debugger.watches.in.variables=false, completion.stats.show.ml.ranking.diff=true Non-Bundled Plugins: CMD Support, Key Promoter X, PsiViewer, Switch Structure, com.alayouni.ansiHighlight, com.intellij.apacheConfig, com.jetbrains.foldOtherMethods, com.jetbrains.plugins.ini4idea, com.intellij.plugins.watcher, lermitage.intellij.battery.status, mobi.hsz.idea.gitignore, net.seesharpsoft.intellij.plugins.csv, net.vektah.codeglance, org.asciidoctor.intellij.asciidoc, org.elixir_lang, org.intellij.plugins.hcl, Karma, com.dmarcotte.handlebars, com.intellij.lang.jsgraphql, com.intellij.plugins.html.instantEditing, com.intellij.plugins.webcomponents, com.jetbrains.lang.ejs, com.jetbrains.plugins.jade, com.jetbrains.php, com.jetbrains.php.blade, com.jetbrains.php.drupal, com.jetbrains.php.wordPress, com.jetbrains.twig, de.espend.idea.laravel, net.king2500.plugins.PhpAdvancedAutoComplete, cucumber-javascript, intellij.prettierJS, org.intellij.scala, org.jetbrains.plugins.go, org.jetbrains.plugins.phpstorm-remote-interpreter, org.jetbrains.plugins.vagrant, org.jetbrains.plugins.vue, Dart, org.jetbrains.plugins.node-remote-interpreter, Pythonid, com.emberjs, com.raket.silverstripe, org.jetbrains.plugins.ruby, jones.foldtestblocks.fold-test-blocks, org.psliwa.idea.composer, org.sylfra.idea.plugins.linessorter, org.toml.lang, org.rust.lang, ru.adelf.idea.dotenv, uk.co.ben-gibson.remote.repository.mapper

Terraform Configuration Files

locals {
  admin_locations = [
    {
      cidr_range  = "xx.xxx.xxx.xxx/xx",
      description = "Office"
    }
  ]
}

# Allow SSH from our designated admin locations
dynamic "ingress" {
  for_each = local.admin_locations
  iterator = location

  content {
    from_port   = 22
    to_port     = 22
    protocol    = "tcp"
    cidr_blocks = [location.value.cidr_range]
  }
}

Exception

None, nor anything in the logs.

Expected Behavior

location. suggests "value", and location.value. suggests cidr_range & description.

Actual Behavior

"No suggestions" popup.

The properties that can be used are known, as anything other than .value.cidr_range or .value.description, it'll be marked in red as an error, and I can navigate to the definition using Control + Click.

Steps to Reproduce

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

  1. Place cursor on cidr_blocks line
  2. Remove cidr_range property, and put cursor at end of location.value.
  3. Press Control + Space
VladRassokhin commented 5 years ago

Fixed completion for for_each iterator and iterator.value.<caret>. Will be available in 0.7.7