I recently use clang_complete to complete C ++ code. This is good and fast for a small program, but too slow for my case (I work on a large code base, and usually one file takes a few seconds to compile), even if I used libclang, which can cache some of the analyzed results to speed up the subsequent parsing, if I understood correctly.
Currently, clang_complete will block in ClangComplete until libclang has finished parsing. Although it starts the workflow, the main thread still checks if the user pressed CTRL C or the workflow completed successfully. During this period, vim becomes irresponsible and thus makes this plugin difficult to use.
I want to improve this behavior a bit, for example, ClangComplete will not block, but return empty results if it takes more than 0.2 seconds while the thread is still running. When libclang finishes disassembling it, and it discovers that I am still typing the same termination word, it will display the termination menu.
Difficulties for this:
- how to pop up a menu at that time without causing any subtle race conditions between different streams,
- how does he know if i am all typing the same word of completion? I think vim itself tracks this, because when I print something wrong, for example,
std::strang instead of std::string , then I type backspace to remove the wrong ang , the completion menu will appear again. So how do I access this inner flag?
source share