Open robbruce opened 2 months ago
Continuation of https://github.com/hashicorp/vscode-terraform/issues/1624, but that issue was closed
Thanks for the report @robbruce! I'm able to reproduce the bug.
I want to treat this as a separate issue from #1624, because we're in the context of a for expression. Depending on the type of expression (e.g. list, tuple, for, ...) the HCL parser behaves differently when it encounters incomplete configuration. Sometimes we can recover enough information to provide meaningful and correct completions, and sometimes the parser is thrown off by the impartial expression and we end up with a bug like this.
A fix for this will require upstream changes to the HCL parser. https://github.com/hashicorp/hcl-lang/issues/370 has some more context on this issue.
Extension Version
v2.30.1
VS Code Version
Version: 1.87.2 (Universal) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:21:31.043Z (1 mo ago) Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.1.0
Operating System
macOS Sonoma Version 14.1.1
Terraform Version
Terraform v1.8.1 on darwin_arm64
Steps to Reproduce
my_v
the aftervar.
, wait for auto completeExpected Behavior
Within a for loop, when you type
var.my_var
, it completes tovar.var.my_var
Actual Behavior
Within a for loop, when you type
var.my_var
, it should complete tovar.my_var
Terraform Configuration
Project Structure
No response
Gist
No response
Anything Else?
No response
Workarounds
No response
References
No response
Help Wanted
Community Note