Quramy / tsuquyomi

A Vim plugin for TypeScript
http://www.vim.org/scripts/script.php?script_id=5151
1.39k stars 72 forks source link

Error detected ... tsuquyomi#complete: Key not present in dicitionary #212

Open ajcrites opened 6 years ago

ajcrites commented 6 years ago

Whenever I try to use Omnicompletion after first loading a TypeScript file, I get this error.

Error detected while processing function tsuquyomi#complete:
E716: Key not present in Dictionary: 0
E15: Invalid expression: l:res_list[i]
E121: Undefined variable: info
E15: Invalid expression: {'word': info.name, 'menu': info.kind }
E121: Undefined variable: l:item
E116: Invalid arguments for function complete_add

I can load a file and run Omnicompletion <C-x><C-o> for example, and the above error will appear once.

After I clear the error, omnicompletion seems to work okay from then on -- it only happens initially.

Is there any way to prevent this entirely or to do whatever Tsuquyomi needs to do to get Omnicompletion to work properly when the file loads instead of having to do manual Omnicompletion once to get through the error?

patreeceeo commented 5 years ago

I'm also experiencing this exact issue.

patreeceeo commented 5 years ago

Looks like on line 329 of autoload/tsuquyumi tsuquyomi#tsClient#sendCommandSyncResponse is returning {"reloadFinished":1} instead of an array as expected. I can work around this for now by adding an extra identical call to tsuquyomi#tsClient#sendCommandSyncResponse and just use the result of the second call.

johnkchow commented 5 years ago

Looks to be fixed by #254