diff --git a/src/command_line.cc b/src/command_line.cc index beb72729..0dc470ae 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -15,7 +15,6 @@ #include "typed_bidi_message_queue.h" #include "working_files.h" -#include #include #include #include @@ -1877,17 +1876,14 @@ void LanguageServerMain() { int main(int argc, char** argv) { - // TODO: Move to IndexInit(), remove clang-c include. - clang_enableStackTraces(); - clang_toggleCrashRecovery(1); - - //bool loop = true; //while (loop) // std::this_thread::sleep_for(std::chrono::milliseconds(10)); //std::this_thread::sleep_for(std::chrono::seconds(3)); PlatformInit(); + IndexInit(); + RegisterMessageTypes(); // if (argc == 1) { diff --git a/src/indexer.cc b/src/indexer.cc index eb18017e..0a1503cf 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1464,3 +1464,9 @@ std::vector> Parse(FileConsumer::SharedState* file_ } return result; } + + +void IndexInit() { + clang_enableStackTraces(); + clang_toggleCrashRecovery(1); +} \ No newline at end of file diff --git a/src/indexer.h b/src/indexer.h index 3ac8ec8c..8b0c1459 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -455,3 +455,4 @@ struct IndexedFile { }; std::vector> Parse(FileConsumer::SharedState* file_consumer_shared, std::string filename, std::vector args, bool dump_ast = false); +void IndexInit(); \ No newline at end of file