Fix preload completion session.

This commit is contained in:
Chao Shen 2018-07-25 11:08:00 +08:00 committed by Fangrui Song
parent 3be281416d
commit 0dae2c4a39
2 changed files with 5 additions and 5 deletions

View File

@ -368,8 +368,7 @@ void TryEnsureDocumentParsed(ClangCompleteManager *manager,
WorkingFiles::Snapshot snapshot = session->working_files->AsSnapshot( WorkingFiles::Snapshot snapshot = session->working_files->AsSnapshot(
{StripFileType(session->file.filename)}); {StripFileType(session->file.filename)});
LOG_S(INFO) << "Creating completion session with arguments " LOG_S(INFO) << "create completion session for " << session->file.filename;
<< StringJoin(args, " ");
*tu = ClangTranslationUnit::Create(session->file.filename, args, snapshot, *tu = ClangTranslationUnit::Create(session->file.filename, args, snapshot,
diagnostic); diagnostic);
} }

View File

@ -50,9 +50,6 @@ struct Handler_TextDocumentDidOpen
} }
include_complete->AddFile(working_file->filename); include_complete->AddFile(working_file->filename);
clang_complete->NotifyView(path);
if (g_config->diagnostics.onParse)
clang_complete->DiagnosticsUpdate({params.textDocument.uri});
if (params.args.size()) if (params.args.size())
project->SetFlagsForFile(params.args, path); project->SetFlagsForFile(params.args, path);
@ -64,6 +61,10 @@ struct Handler_TextDocumentDidOpen
clang_complete->FlushSession(entry.filename); clang_complete->FlushSession(entry.filename);
} }
clang_complete->NotifyView(path);
if (g_config->diagnostics.onParse)
clang_complete->DiagnosticsUpdate({params.textDocument.uri});
} }
}; };
REGISTER_MESSAGE_HANDLER(Handler_TextDocumentDidOpen); REGISTER_MESSAGE_HANDLER(Handler_TextDocumentDidOpen);