浏览代码

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.
Vyacheslav Pukhanov 4 年之前
父节点
当前提交
663fd9abb4
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp

+ 1 - 0
Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp

@@ -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;