juliosueiras / vim-terraform-completion

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

terraform completion plugin slows down nvim save and switching between files #68

Open boris-yakimov opened 1 year ago

boris-yakimov commented 1 year ago

Hello,

I've been having some issues where neovim freezes for a few seconds on file save and switching between files.

When checking the processes of what happens when vim freezes I see this : image

A whole bunch of terraform validates and what seems to be an indexing of all downloaded provider files (couldn't see the full process details as it disapears after 2-3 sec). This shows up on every single save and switch between files which, with the plugin takes 3-4 seconds without it, takes less than 1 second.

When removing the vim-terraform-completion plugin issue is resolved and vim doesn't freeze anymore. I use neovim under WSLv2 with Ubuntu 20.04; Nvim v0.6.1.

The vim-terraform-completion plugin is installed via vim-plug.

Here is everything I do in vim related terraform

" Terraform
Plug 'hashivim/vim-terraform'
Plug 'vim-syntastic/syntastic'
Plug 'juliosueiras/vim-terraform-completion'
""" Terraform config
" Allow vim-terraform to align settings automatically with Tabularize.
let g:terraform_align=1
" Allow vim-terraform to automatically fold (hide until unfolded) sections of terraform code. Defaults to 0 which is off.
"let g:terraform_fold_sections=1
" Allow vim-terraform to automatically format *.tf and *.tfvars files with terraform fmt. You can also do this manually with the :TerraformFmt command.
let g:terraform_fmt_on_save=1