I'm getting a bunch or warnings (from Terraform 0.12.17), explaining that:
Terraform 0.11 and earlier required all non-constant expressions to be provided via interpolation syntax, but this pattern is now deprecated. To silence this warning, remove the "${ sequence from the start and the }" sequence from the end of this expression, leaving just the inner expression.
The thing is, when I fix this issue, ie by replacing
user = "${data.aws_iam_user.travis_tests.0.user_name}" with
user = data.aws_iam_user.travis_tests.0.user_name,
then vscode-terraform highlights this as an error, saying:
Unknown token: 105:10 IDENT data.aws_iam_user.travis_tests.0.user_name
The expected behavior would be no error message (the file is all good, Terraform currently accepts both versions of it).
Have you tried using the new splat operator?
user = data.aws_iam_user.travis_tests[0].user_name
I hadn't tried that: I just did, I get an error message from vscode-terraform in both cases (with or without the "${}" stuff)
All 0.12 features require the use of the language server, have you enabled it?
Sent from my iPhone
On 4 Dec 2019, at 16:38, patheticcockroach notifications@github.com wrote:
I hadn't tried that: I just did, I get an error message from vscode-terraform in both cases (with or without the "${}" stuff)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Unfortunately, the LSP appears to be unstable on MacOS. While enabling it did solve this issue for me, the LSP constantly crashes and hasn't been updated recently to resolve the crashing so I had to disable it.
As an alternative, is there a place in the settings that we can specify exceptions to the linter (and, more importantly, some documentation on how to use?). I'd rather just suppress the error message and still be able to use the extension without false positives.
All 0.12 features require the use of the language server, have you enabled it?
…
Sent from my iPhone
On 4 Dec 2019, at 16:38, patheticcockroach @.*> wrote: I hadn't tried that: I just did, I get an error message from vscode-terraform in both cases (with or without the "${}" stuff) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I looked around in order to avoid asking a stupid question, but... I have absolutely no idea how to enable this language server :/
You can enable it by going to command palette in vscode, Install\Update language server and then you have an enable\disable post installation to turn it on\off.
I have tried to use it too but I find the results inconsistent. It doesn't seem to resolve the linting issues when you are not using the old interpolation syntax {$..}.
If you go to 0.12.8 you'll find the warnings are suppressed by default. There is also a compact-warnings message you can enable when you run the plan or apply commands from 0.12.7 onwards (I believe).
I find that with the language server the linting also marks other areas of code as incorrect (for instance I found if I'm referencing a resource group using interpolation and the resource group is configured in another file) it says "variable cant be found" and marks resource group with red line.
Other than these linting issues and the language server inconsistencies, I like the concept of language server.
Regards
Shaun
Thank you. I managed to install the language server, and it didn't change anything about this issue.
Yup, this problem so far is the deal-breaker to go with a simplified syntax.
We just released v2.0.0-rc.1 of the extension. The main features include:
You can find additional information and specifics in the release notes and CHANGELOG.
With this release we expect that many of the prior issues and PRs are no longer relevant or have been addressed, and are therefore being closed. If you feel the action taken on an issue or PR is in error, please comment as such and we can figure out the appropriate way to address it.
We plan to add the final 2.0.0 release to the marketplace soon, but are actively seeking your feedback now on the release candidates. You can download the .vsix from the releases page and manually install it in VS Code to try it out.
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.