asyncomplete.vim icon indicating copy to clipboard operation
asyncomplete.vim copied to clipboard

[help] Is it possible to limit completion to one level instead of searching recursively?

Open bravoecho opened this issue 1 year ago • 0 comments

First, thank you for this fantastic plugin, I absolutely love it!

I am experiencing some performance issues when working on large Go files, especially in test. When the dependency tree grows, Vim freezes for several seconds, due to the sheer number of potential matches in some scopes.

I see that completion candidates are searched recursively, which normally is very nice.

However, I was wondering if it would be possible to instruct the search to only look for candidates in the first level instead, to work around this issue when needed. I have been consulting the docs but I couldn't find anything that would do the trick.

Any pointers would be massively appreciated, thank you!

I'm using Vim 9, but it was the same with Vim 8.

I attach the relevant parts of my configuration, just in case.

vimrc
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

" ...

let g:lsp_use_lua = has('nvim-0.4.0') || (has('lua') && has('patch-8.2.0775'))
let g:lsp_async_completion = 1

let g:lsp_diagnostics_enabled = 0
let g:lsp_diagnostics_highlights_enabled = 0
let g:lsp_document_highlight_enabled = 0
let g:lsp_completion_documentation_enabled = 0
let g:lsp_document_code_action_signs_enabled = 0
let g:lsp_fold_enabled = 0
let g:lsp_signature_help_delay = 100

if executable('gopls')
  au User lsp_setup call lsp#register_server({
    \ 'name': 'gopls',
    \ 'cmd': {server_info->['gopls', '-remote=auto']},
    \ 'allowlist': ['go'],
    \ })
endif

let g:SuperTabCrMapping       = 1
let g:SuperTabMappingForward  = '&lts-tab&gt'
let g:SuperTabMappingBackward = '&lttab&gt'
  

bravoecho avatar Aug 25 '22 12:08 bravoecho