1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:08:11 +00:00

LanguageServers: Allow set_declarations_of_document callback to be null

This commit is contained in:
Itamar 2021-05-14 09:42:52 +03:00 committed by Andreas Kling
parent 545b6af305
commit e9fc5d6cc3

View file

@ -19,7 +19,8 @@ AutoCompleteEngine::~AutoCompleteEngine()
}
void AutoCompleteEngine::set_declarations_of_document(const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations)
{
VERIFY(set_declarations_of_document_callback);
if (!set_declarations_of_document_callback)
return;
// Optimization - Only notify callback if declarations have changed
if (auto previous_declarations = m_all_declarations.get(filename); previous_declarations.has_value()) {