mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 01:21:57 +00:00
Do not index files starting with git:
This commit is contained in:
parent
3b9371f4b5
commit
ae8cae5ba6
@ -147,3 +147,7 @@ void EmitSemanticHighlighting(QueryDatabase* db,
|
||||
out.params.symbols.push_back(entry.second);
|
||||
IpcManager::WriteStdout(IpcId::CqueryPublishSemanticHighlighting, out);
|
||||
}
|
||||
|
||||
bool ShouldIgnoreFileForIndexing(const std::string& path) {
|
||||
return StartsWith(path, "git:");
|
||||
}
|
||||
|
@ -78,3 +78,5 @@ void EmitSemanticHighlighting(QueryDatabase* db,
|
||||
SemanticHighlightSymbolCache* semantic_cache,
|
||||
WorkingFile* working_file,
|
||||
QueryFile* file);
|
||||
|
||||
bool ShouldIgnoreFileForIndexing(const std::string& path);
|
||||
|
@ -24,6 +24,9 @@ struct TextDocumentDidOpenHandler
|
||||
|
||||
Timer time;
|
||||
std::string path = request->params.textDocument.uri.GetPath();
|
||||
if (ShouldIgnoreFileForIndexing(path))
|
||||
return;
|
||||
|
||||
WorkingFile* working_file =
|
||||
working_files->OnOpen(request->params.textDocument);
|
||||
optional<std::string> cached_file_contents =
|
||||
|
@ -22,6 +22,9 @@ struct TextDocumentDidSaveHandler
|
||||
: BaseMessageHandler<Ipc_TextDocumentDidSave> {
|
||||
void Run(Ipc_TextDocumentDidSave* request) override {
|
||||
std::string path = request->params.textDocument.uri.GetPath();
|
||||
if (ShouldIgnoreFileForIndexing(path))
|
||||
return;
|
||||
|
||||
// Send out an index request, and copy the current buffer state so we
|
||||
// can update the cached index contents when the index is done.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user