How to get Terraform arguments list by using keyboard shortcuts in Mac VScode? HashiCorp Terraform plugin does not work

huangapple go评论69阅读模式
英文:

How to get Terraform arguments list by using keyboard shortcuts in Mac VScode? HashiCorp Terraform plugin does not work

问题

我遇到了一个问题,当我尝试检查/获取Terraform块(如resources、Terraform)中的参数时,我的Mac Vscode没有自动显示出一些参数列表供我选择。我想知道如何配置它以及如何使用键盘快捷键组合来提高我的效率?

How to get Terraform arguments list by using keyboard shortcuts in Mac VScode? HashiCorp Terraform plugin does not work

我已经在Mac Vscode中安装了HarshiCorp Terraform插件。

英文:

I have encountered a problem that when i try to check/get the arguments in Terraform blocks like resources, Terraform. My Mac Vscode does not work automatically shows up some argument list for me to choose. And I am wondering how to configure it and what's the combination of keyboard shortcuts to increase my efficiency?

How to get Terraform arguments list by using keyboard shortcuts in Mac VScode? HashiCorp Terraform plugin does not work

I have installed the HarshiCorp Terraform plugin in Mac Vscode.

答案1

得分: 1

您应该在安装Terraform之前在您的计算机上安装它,然后安装HashiCorp的官方Terraform扩展。如果已经安装了,请升级它(似乎他们的错误现在已经修复)。

然后,在您的VS Code中按下CMD+Shift+X,确保您的扩展已启用。

此外,根据他们的文档,尝试重新加载扩展:

您可以通过打开命令面板并开始键入"Reload"来重新加载Terraform扩展。将会出现一系列命令,请选择"Reload Window"。这将重新加载Visual Studio Code窗口,而不会关闭整个编辑器,并不会丢失当前在编辑器中打开的任何工作。


安装Terraform和扩展后,您应该在运行terraform init的同一目录中打开VS Code,因为它将加载您本地安装的模块并加载您的提供程序配置。例如,如果您正在从私有注册表中提取模块,模块文档可能无法检测到您的模式,那么它将无法提供自动完成功能。

如果仍然存在问题,请参考以下链接:

https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform#troubleshooting

英文:

You should install Terraform on your machine before, then install Hashicorp's official Terraform extension, if it's already installed upgrade it (seems that their bug is fixed now)

Then, on your VS Code press CMD+Shift+X And make sure that your extension is enabled.

Also, try reloading your extension by reloading your window as their documentation states:

> You can reload the Terraform extension by opening the command palette
> and starting to type Reload. A list of commands will appear, select
> Reload Window. This will reload the Visual Studio Code window without
> closing down the entire editor, and without losing any work currently
> open in the editor.


After you install Terraform and the extension, you should have VS Code open in the same directory where you ran terraform init as it will load your locally installed modules and loads your providers' configuration. For example, if you are pulling modules from a private registry the module documentation may not detect your schemas and then it won't offer autocompletion capabilities.

If you still have issues refer to these links:

https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform#troubleshooting

huangapple
  • 本文由 发表于 2023年2月19日 03:44:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75495966.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定