From fbf46f57ac8a1217d2fa36c0dc20ca430bce19c7 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Thu, 1 Dec 2022 00:19:33 +0100 Subject: [PATCH] ide: Settings warning about wrong libclang commandline --- uppsrc/ide/Setup.cpp | 8 ++++++++ uppsrc/ide/clang/CurrentFile.cpp | 12 ------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index 81507389f..021b2faa9 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -658,6 +658,14 @@ void Ide::SetupFormat() { FileSetTime(ConfigFile("version"), ToTime(~ide.showtimeafter)); FinishConfig(); SaveConfig(); + + for(int cpp = 0; cpp < 2; cpp++) { + Clang h; + if(!h.Parse(GetHomeDirFile(cpp ? "test.cpp" : "test.c"), "", GetCurrentIncludePath(), GetCurrentDefines(), 0)) { + Exclamation("libclang additional compiler options do not seem do be correct. Assist might not work."); + return; + } + } } void Ide::FinishConfig() diff --git a/uppsrc/ide/clang/CurrentFile.cpp b/uppsrc/ide/clang/CurrentFile.cpp index 700c77451..18dc10867 100644 --- a/uppsrc/ide/clang/CurrentFile.cpp +++ b/uppsrc/ide/clang/CurrentFile.cpp @@ -167,18 +167,6 @@ void CurrentFileThread() current_file_parsing = false; was_parsing = true; } - if(!cfc.clang.tu) { - { - GuiLock __; - IdeShowConsole(); - PutConsole("libclang parser has failed, please fix libclang options"); - } - String h = LibClangCommandLine(); - while(h == LibClangCommandLine()) { - Sleep(500); - if(Thread::IsShutdownThreads()) break; - } - } if(Thread::IsShutdownThreads()) break; if(cfc.clang.tu && autocomplete_do) { Vector item;