Push cursor position to end when updating delayed diagnostics

This commit is contained in:
Jacob Dufault 2017-07-19 00:20:19 -07:00
parent 08fb60a675
commit 64580decab

View File

@ -363,6 +363,13 @@ void CompletionDiagnosticsDelayedRefreshMain(ClangCompleteManager* completion_ma
if (has_completion_since_sleeping) if (has_completion_since_sleeping)
continue; continue;
// Push completion request to the end of the line. clang may report errors
// if completing in the middle of the line. Not a perfect hueristic, but
// probably good enough.
// TODO: Consider scanning for a semicolon if this doesn't work well in
// practice.
location.position.character = 10000;
// Make completion request to get refreshed diagnostics. // Make completion request to get refreshed diagnostics.
auto request = MakeUnique<ClangCompleteManager::CompletionRequest>(); auto request = MakeUnique<ClangCompleteManager::CompletionRequest>();
request->location = location; request->location = location;