Closed saurabh-hirani closed 6 years ago
added the option g:terraform_registry_module_completion
Thank you very much for the quick around time! This is a very useful feature.
Oh my, it took me several days to came across this issue and it literally was almost occasional hit.
Long story short: after installing vim-terraform-completion
I found that editing source =
lines of non-local Terraform modules throws eval:6: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
error and freezes vim
. Based on plenty of experiments I ended up at https://github.com/sparklemotion/nokogiri/issues/2066 which helped me to identify line https://github.com/juliosueiras/vim-terraform-completion/blob/master/autoload/terraformcomplete.vim#L985 as being the cause of the problem. Changing this line to d = JSON.parse(URI.open("https://registry.terraform.io/v1/modules?limit=10000&offset=#{offset}").read);
(notice the open
→ URI.open
change) in terraformcomplete#GetAllRegistryModules()
function helped me to eliminate the error and the function name per se led me to this issue here which has the one-size-fits-all fix to use g:terraform_registry_module_completion
option to turn off the whole functionality as it indeed slows down user very much.
@juliosueiras Might worth to align vim-terraform-completion
with what https://github.com/sparklemotion/nokogiri/issues/2066 is about since https://github.com/juliosueiras/vim-terraform-completion/blob/master/autoload/terraformcomplete.vim#L985 is not the only place which uses deprecated call.
Thanks!
Hi,
vim-terraform-completion is a great plugin. Thank you for creating it.
When using it with terraform modules, as soon as the keyword source is written and a value is provided, the plugin tries to search git repos to give a choice to the user. If the user wants to load a local module or provide a versioned module, omnicomplete slows the user down. To get around it, I have currently commented out the following block in
.vim/bundle/vim-terraform-completion/autoload/terraformcomplete.vim
It would be useful if there was a flag to disable this search, while keeping the terraform_completion_keys option enabled.