diff --git a/src/clang_complete.cc b/src/clang_complete.cc index 34d04f39..534d82b7 100644 --- a/src/clang_complete.cc +++ b/src/clang_complete.cc @@ -363,6 +363,13 @@ void CompletionDiagnosticsDelayedRefreshMain(ClangCompleteManager* completion_ma if (has_completion_since_sleeping) 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. auto request = MakeUnique(); request->location = location;