From 0867947c70093ab12450bd09a7d3686dcf53397c Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 15 Apr 2024 22:24:57 +0800 Subject: [PATCH] - fix: In sdcc project, parser are not correctly inited as sdcc parser. --- NEWS.md | 1 + RedPandaIDE/utils.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index 7b3fee94..edb3481f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -147,6 +147,7 @@ Red Panda C++ Version 2.27 - change: Don't generate project resource files for sdcc project. - fix: Name of the macro for project private resource header is not correct. - fix: In sdcc project, sdcc keywords are not in completion suggest list. + - fix: In sdcc project, parser are not correctly inited as sdcc parser. Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index 25b14342..f1e2ef06 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -247,6 +247,8 @@ void resetCppParser(std::shared_ptr parser, int compilerSetIndex) compilerSetIndex=pSettings->compilerSets().defaultIndex(); } Settings::PCompilerSet compilerSet = pSettings->compilerSets().getSet(compilerSetIndex); + if (compilerSet && compilerSet->compilerType()==CompilerType::SDCC) + parser->setLanguage(ParserLanguage::SDCC); parser->clearIncludePaths(); bool isCpp = parser->language()==ParserLanguage::CPlusPlus; if (compilerSet) {