1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:47:47 +00:00

LanguageServers/Cpp: Allow the creation of DocumentData objects to fail

This fixes langauge-server crashes when trying to parse non-existant
header files, such as #include <new>.
Closes #5569.
This commit is contained in:
Itamar 2021-03-04 13:13:48 +02:00 committed by Andreas Kling
parent a2ac86f5e1
commit 3f0ace6670
2 changed files with 19 additions and 8 deletions

View file

@ -76,8 +76,8 @@ private:
Vector<PropertyInfo> properties_of_type(const DocumentData& document, const String& type) const;
NonnullRefPtrVector<Declaration> get_declarations_in_outer_scope_including_headers(const DocumentData& document) const;
const DocumentData& get_document_data(const String& file) const;
const DocumentData& get_or_create_document_data(const String& file);
const DocumentData* get_document_data(const String& file) const;
const DocumentData* get_or_create_document_data(const String& file);
void set_document_data(const String& file, OwnPtr<DocumentData>&& data);
OwnPtr<DocumentData> create_document_data_for(const String& file);