Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform 0.4.0 doesn't work in Intellij IDEA 2020.1.1 #200

Closed
moleksyuk opened this issue Jul 2, 2020 · 5 comments
Closed

terraform 0.4.0 doesn't work in Intellij IDEA 2020.1.1 #200

moleksyuk opened this issue Jul 2, 2020 · 5 comments
Labels
editor/intellij https://www.jetbrains.com/idea/

Comments

@moleksyuk
Copy link

Server Version

 ~/Workspace/terraform-ls-bug  ./terraform-ls --version
0.4.0

Terraform Version

 ~/Workspace/terraform-ls-bug  terraform --version
Terraform v0.12.28

Client Version

IntelliJ IDEA 2020.1.1 (Ultimate Edition)
Build #IU-201.7223.91, built on April 30, 2020
Licensed to Mykhailo Oleksiuk
Subscription is active until March 24, 2021
Runtime version: 11.0.6+8-b765.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.5

Terraform Configuration Files

no configs

Log Output

File /tmp/tf-exec-{{lsPid}}-{{args}}.log doesn't exist.

Expected Behavior

Setup of terraform-ls has to work.

Actual Behavior

Setup of terraform-ls doesn't to work.

Steps to Reproduce

  1. Created a new project.
  2. Put main.tf file there.
terraform {
  required_version = "0.12.28"

  required_providers {
    aws = "~> 2.49"
  }
}

provider "aws" {
  region = "eu-west-3"
}
  1. Installed LSP plugin - https://plugins.jetbrains.com/plugin/10209-lsp-support

  2. Downloaded the latest version of terraform-ls - https://releases.hashicorp.com/terraform-ls/0.4.0/terraform-ls_0.4.0_darwin_amd64.zip

  3. Unzip and put binary file to the root of project.

  4. Specified asbolute path to binary as /Users/moleksyuk/Workspace/terraform-ls-bug/terraform-ls and all related params accorting to https://github.com/hashicorp/terraform-ls/blob/master/docs/USAGE.md#intellij-ide

  5. Press Apply and getting error: (See screenshot).
    Screenshot 2020-07-02 at 13 42 21

  6. When I add a new *.tf file getting error about 'No root module'. (See screenshot)
    Screenshot 2020-07-02 at 13 42 56

@radeksimko radeksimko added the editor/intellij https://www.jetbrains.com/idea/ label Jul 2, 2020
@radeksimko
Copy link
Member

Hi @moleksyuk
The first screenshot leads me to thinking that this may have something to do with how the IJ plugin launches the server. It looks like this is already a known bug reported here: gtache/intellij-lsp#147

The second one suggests that it eventually did launch it, because the error message comes from the language server.
It means that you likely need to run terraform init in a folder (root module) where you'd typically run it, so that plugins are available for the language server to pull data from. Have you tried that?

@moleksyuk
Copy link
Author

Hi @radeksimko,

The first screenshot leads me to thinking that this may have something to do with how the IJ plugin launches the server. It looks like this is already a known bug reported here: gtache/intellij-lsp#147
👍 thanks

The second one suggests that it eventually did launch it, because the error message comes from the language server.
It means that you likely need to run terraform init in a folder (root module) where you'd typically run it, so that plugins are available for the language server to pull data from. Have you tried that?

Tried to run terraform init but couldn't reproduce it again due to issue with start server. Didn't know how it was launched yesterday 🤷‍♂️.

@ghost ghost removed the waiting-response label Jul 3, 2020
@radeksimko
Copy link
Member

Unfortunately there isn't much the server can do when it comes to being launched. That will have to be addressed on the client side (i.e. in the IntelliJ extension) but I would be happy to look into any issues which happen after the server starts.

I managed to launch it as per instructions - I tried IntelliJ IDEA 2020.1 and language server 0.4.0 - both absolute or relative path. That said I did run into a bug, which I filed under #203 - I wonder if that's what you're also experiencing?

File /tmp/tf-exec-{{lsPid}}-{{args}}.log doesn't exist.

The file logging is not enabled by default, it needs to be enabled by adding -log-file flag, see the Troubleshooting section for more.

Let us know if you manage to launch it and need further investigation/help, otherwise @hashibot will close this issue in 30 days automatically as it's not actionable without further details.

@moleksyuk
Copy link
Author

Got it. Close it and will wait till gtache/intellij-lsp#147 will be fixed.

@ghost ghost removed the waiting-response label Jul 3, 2020
@ghost
Copy link

ghost commented Aug 2, 2020

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.

@ghost ghost locked and limited conversation to collaborators Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor/intellij https://www.jetbrains.com/idea/
Projects
None yet
Development

No branches or pull requests

2 participants