summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-06-27 21:46:23 +0300
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-29 00:07:19 +0430
commitab3aa0759a99a35f8920e2de39dec81d39fc24e0 (patch)
treeb9399dacd1b480370c0956956e5024423730911a /Userland/DevTools/HackStudio
parent4123be76391075742d77d50e4930f91476b4aac8 (diff)
downloadserenity-ab3aa0759a99a35f8920e2de39dec81d39fc24e0.zip
LanguageServers: Don't VERIFY that set_todo_entries callback exists
The callback may not exist if the CodeComprehensionEngine is running in the context of tests (i.e CppLanguageServer -t).
Diffstat (limited to 'Userland/DevTools/HackStudio')
-rw-r--r--Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
index aec90ce5af..37093fc2ab 100644
--- a/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
+++ b/Userland/DevTools/HackStudio/LanguageServers/CodeComprehensionEngine.cpp
@@ -19,6 +19,7 @@ CodeComprehensionEngine::~CodeComprehensionEngine()
}
void CodeComprehensionEngine::set_declarations_of_document(const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations)
{
+ // Callback may not be configured if we're running tests
if (!set_declarations_of_document_callback)
return;
@@ -34,7 +35,9 @@ void CodeComprehensionEngine::set_declarations_of_document(const String& filenam
void CodeComprehensionEngine::set_todo_entries_of_document(String const& filename, Vector<Cpp::Parser::TodoEntry>&& todo_entries)
{
- VERIFY(set_todo_entries_of_document_callback);
+ // Callback may not be configured if we're running tests
+ if (!set_todo_entries_of_document_callback)
+ return;
set_todo_entries_of_document_callback(filename, move(todo_entries));
}