juliosueiras / vim-terraform-completion

A (Neo)Vim Autocompletion and linter for Terraform, a HashiCorp tool
MIT License
336 stars 24 forks source link

How to to make it work with neovim? #44

Closed mcanevet closed 6 years ago

mcanevet commented 6 years ago

I'm using the neovim package v0.2.2 from Debian sid and it looks like it does not have ruby/dyn enabled. At least echo has('ruby/dyn') returns 0. So this plugin does not work because of this. According to :help feature-compile, "Nvim always includes ALL features, in contrast to Vim", so I can't figure out why echo has('ruby/dyn') does not return 1.

mcanevet commented 6 years ago

Never mind I misread the code...

juliosueiras commented 6 years ago

hi, just want to ask, can you explain what was the issue?

mcanevet commented 6 years ago

@juliosueiras I thought it was not working so I looked at the code and somehow my brain read || instead of && here : https://github.com/juliosueiras/vim-terraform-completion/blob/master/autoload/terraformcomplete.vim#L1-L3, so I thought I had to have both ̀rubyANDruby/dynnot eitherrubyORruby/dyn`. When I figured that out, I found that this plugin was actually working from the beginning... Sorry for the the noise.

juliosueiras commented 6 years ago

no problem

esn89 commented 5 years ago

I have a similar problem to you. I have installed the neovim as a ruby gem and it shows 0.

However, I am still unable to get it to work with neovim. I have copied the config exactly. Any ideas?

juliosueiras commented 5 years ago

@esn89 A) can you post the config(just incase) B) run :CheckHealth C) make sure you that you also have json gem install

esn89 commented 5 years ago

Hey @juliosueiras

Thanks for your reply, I have tried the new deoplete but got this error instead:

or detected while processing /Users/esn89/.config/nvim/plugged/vim-terraform-completion/autoload/terraformcomplete.vim:                                                     
line    6:                                                                                                                                                                      
E121: Undefined variable: deoplete#omni_patterns                                                                                                                                
Press ENTER or type command to continue   ```

Here is my :checkhealth

health#deoplete#check

deoplete.nvim

health#LanguageClient#check

health#nvim#check

Configuration

Performance

Remote Plugins

terminal

health#provider#check

Clipboard (optional)

Python 2 provider (optional)

Python 3 provider (optional)

Ruby provider (optional)

Node.js provider (optional)

juliosueiras commented 5 years ago

@esn89 can you try with the new config ?(just updated the deoplete config on README)

esn89 commented 5 years ago

It works, thank you.

However, when I type "res" resource, I get this red error message, any ideas?

https://i.imgur.com/22CJxr8.png

I am using this config:


let g:deoplete#omni_patterns = {}

call deoplete#custom#option('omni_patterns', {
\ 'complete_method': 'omnifunc',
\ 'terraform': '[^ *\t"{=$]\w*',
\})

call deoplete#initialize()```
juliosueiras commented 5 years ago

@esn89 that is normal due to deoplete being async completion, so every keystroke (in terraform case) will trigger autocomplete(since terraform is DSL)

esn89 commented 5 years ago

ah, i see. thanks for your reply, and sorry for being so bothersome :)