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

asyncomplete lags during gdscript completion (godot lsp)

Open idbrii opened this issue 1 year ago • 2 comments

When using Godot (which provides its own language server) with asyncomplete, my input frequently hangs. If I disable asyncomplete, the problem goes away. asyncomplete seems to hang for longer than the amount of time it takes to complete manual lsp omnicompletion.

My guess is that godot sends a massive list of potential matches and asyncomplete is processing them synchronously (perhaps to put in the popupmenu?). I think the issue is worse inside comments.

I originally had g:asyncomplete_min_chars = 2 and the problem was far worse -- it hangs on nearly every word.

Here's a log where I type # this is a comme and then it hangs for at least a second.

Minimal vimrc

" Invoke with:
" gvim -Nu ~/.vim/reprovimrc.vim -U NONE +7 C:\code\godot\testgame\new_script.gd

" vim-sensible as a baseline config.
let s:plugins = ['sensible']

let s:plugins += ['asyncomplete']
let s:plugins += ['asyncomplete-lsp']
let s:plugins += ['lsp']
let s:plugins += ['lsp-settings']

set runtimepath-=~/.vim
set runtimepath-=~/.vim/after
set runtimepath-=~/vimfiles
set runtimepath-=~/vimfiles/after
for plugin in s:plugins
    exec "set runtimepath^=~/.vim/bundle/". plugin
    exec "set runtimepath+=~/.vim/bundle/". plugin ."/after"
endfor
set viminfofile=NONE

set hlsearch
colorscheme desert

" https://github.com/mattn/vim-lsp-settings/pull/681
let g:lsp_settings = {}
let g:lsp_settings.godot = { 'tcp': '127.0.0.1:6005'}

set omnifunc=lsp#complete

let g:asyncomplete_log_file = expand('~/.vim-cache/temp/asyncomplete-hang.log')
let g:asyncomplete_min_chars = 5

new_script.gd is trivial. It's just a new script generated from a new godot project:

extends Node


# Called when the node enters the scene tree for the first time.
func _ready():
    pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
    pass

Version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jun 10 2023 22:47:17) MS-Windows 64-bit GUI version with OLE support Included patches: 1-1626

Windows 10

idbrii avatar Jun 12 '23 14:06 idbrii