universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
326 stars 26 forks source link

Solve popup completion lag on Windows #67

Closed AmaiKinono closed 3 years ago

AmaiKinono commented 3 years ago

This is another attempt to fix #61.

Long story short, I've fixed it, while keeping the readtags process being async. What I put here is my misunderstanding.

accept-process-output can be quitted on Windows. The problem is, using a complex filter function makes it unable to quit for a while after the process is created. This is weird.

I noticed this when I'm preparing to switch from async to synchronous process. Once we don't need the "only get first n tags" functionality, the filter function doesn't interfere with the status of the process. Then it's faster on Windows.

So, after experimenting, what I did last is to simply use the default filter function, which uses a buffer to receive output from readtags. Then popup completion on Windows is just snap:

windows

I noticed this also makes completion on Linux faster.