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

coc and terraform-lsp does not work as expected #93

Open
vhristev opened this issue Feb 11, 2021 · 8 comments
Open

coc and terraform-lsp does not work as expected #93

vhristev opened this issue Feb 11, 2021 · 8 comments

Comments

@vhristev
Copy link

vhristev commented Feb 11, 2021

There is no provider auto-completion how it's shown in the project example video.

by default 2021-02-11 at 17 53 44

~/Desktop/terraform-test/terraform/environmnet/test » ls -la
total 16
drwxr-xr-x  5 vhristev  _lpoperator   160 Feb 11 18:08 .
drwxr-xr-x  3 vhristev  _lpoperator    96 Feb 11 17:39 ..
drwxr-xr-x  3 vhristev  _lpoperator    96 Feb 11 17:40 .terraform
-rw-r--r--  1 vhristev  _lpoperator  1002 Feb 11 17:48 .terraform.lock.hcl
-rw-r--r--  1 vhristev  _lpoperator    29 Feb 11 17:48 main.tf
~ » nvim --version
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPAC

K_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/config -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/src -I/usr/local/include -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/deps-build/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/src/nvim/auto -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/include
Compiled by brew@Catalina

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.4/share/nvim"

Run :checkhealth for more info

Terraform-lsp - i tried with Beta1 Beta2 and older versions.

I can see LSP server is runnig

~ » ps aux | grep terr
vhristev         76420   0.6  0.0  4399240  12712   ??  S     5:49PM   0:00.06 terraform-lsp

coc settings( there is extr } to close entire config )

    // python
    "python.jediEnabled": false,
    // add your languageServer into this list
    "languageserver": {
                "terraform": {
                        "command": "terraform-lsp",
                        "filetypes": [
                                "terraform",
                                "tf"
                        ],
                        "initializationOptions": {},
                        "settings": {}
                }
        }
}
@jmahlik
Copy link

jmahlik commented May 7, 2021

I wonder if there might be a version conflict with terraform somewhere?

@juliosueiras
Copy link
Owner

can you try 0.0.12 ?

@unaryops
Copy link

I'm on 0.0.12 and am experiencing exactly the same issue.

@alexaxms
Copy link

alexaxms commented Mar 1, 2022

same issue for me :c

@juliosueiras
Copy link
Owner

this is the coc config I use

{
   "languageserver" : {
      "terraform" : {
         "args" : [
            "serve"
         ],
         "command" : "terraform-lsp",
         "filetypes" : [
            "terraform",
            "tf"
         ],
         "rootPatterns" : [
            "*.tf",
            "terragrunt.hcl"
         ],
         "trace.server" : "verbose"
      }
   }
}

@juliosueiras
Copy link
Owner

@alexaxms can you try the above(and make sure is on 0.0.12 for the lsp as well as terraform init is already executed)

@alexaxms
Copy link

alexaxms commented Mar 1, 2022

@alexaxms can you try the above(and make sure is on 0.0.12 for the lsp as well as terraform init is already executed)

it's working now, sorry I forgot the terraform init since this stack works without the init.
Thanks!

@juliosueiras
Copy link
Owner

@alexaxms np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants