1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 16:45:07 +00:00

CppLanguageServer: Make preprocessor ignore unsupported keywords

During typing the entered keywords can be incomplete and crash
preprocessor. We enable the newly introduced option to prevent
that crash.
This commit is contained in:
Vyacheslav Pukhanov 2021-03-17 21:19:13 +03:00 committed by Andreas Kling
parent 0b5d414eba
commit 663fd9abb4

View file

@ -426,6 +426,7 @@ OwnPtr<ParserAutoComplete::DocumentData> ParserAutoComplete::create_document_dat
document_data->m_filename = move(filename); document_data->m_filename = move(filename);
document_data->m_text = move(text); document_data->m_text = move(text);
document_data->m_preprocessor = make<Preprocessor>(document_data->m_filename, document_data->text()); document_data->m_preprocessor = make<Preprocessor>(document_data->m_filename, document_data->text());
document_data->preprocessor().set_ignore_unsupported_keywords(true);
document_data->preprocessor().process(); document_data->preprocessor().process();
Preprocessor::Definitions all_definitions; Preprocessor::Definitions all_definitions;