mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Do not index files starting with git:
This commit is contained in:
parent
3b9371f4b5
commit
ae8cae5ba6
@ -146,4 +146,8 @@ void EmitSemanticHighlighting(QueryDatabase* db,
|
||||
for (auto& entry : grouped_symbols)
|
||||
out.params.symbols.push_back(entry.second);
|
||||
IpcManager::WriteStdout(IpcId::CqueryPublishSemanticHighlighting, out);
|
||||
}
|
||||
}
|
||||
|
||||
bool ShouldIgnoreFileForIndexing(const std::string& path) {
|
||||
return StartsWith(path, "git:");
|
||||
}
|
||||
|
@ -77,4 +77,6 @@ void EmitInactiveLines(WorkingFile* working_file,
|
||||
void EmitSemanticHighlighting(QueryDatabase* db,
|
||||
SemanticHighlightSymbolCache* semantic_cache,
|
||||
WorkingFile* working_file,
|
||||
QueryFile* 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 =
|
||||
@ -54,4 +57,4 @@ struct TextDocumentDidOpenHandler
|
||||
}
|
||||
};
|
||||
REGISTER_MESSAGE_HANDLER(TextDocumentDidOpenHandler);
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
@ -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.
|
||||
//
|
||||
@ -43,4 +46,4 @@ struct TextDocumentDidSaveHandler
|
||||
}
|
||||
};
|
||||
REGISTER_MESSAGE_HANDLER(TextDocumentDidSaveHandler);
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
Loading…
Reference in New Issue
Block a user