- fix: In sdcc project, sdcc keywords are not in completion suggest list.

This commit is contained in:
Roy Qu 2024-04-15 22:17:16 +08:00
parent 8c889a3a1b
commit d8b467b867
3 changed files with 9 additions and 4 deletions

View File

@ -146,6 +146,7 @@ Red Panda C++ Version 2.27
- fix: project options -> compiler set -> static link & auto convert charset options not correctly loaded. - fix: project options -> compiler set -> static link & auto convert charset options not correctly loaded.
- change: Don't generate project resource files for sdcc project. - change: Don't generate project resource files for sdcc project.
- fix: Name of the macro for project private resource header is not correct. - 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.
Red Panda C++ Version 2.26 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -3152,11 +3152,14 @@ void Editor::initParser()
ParserLanguage Editor::calcParserLanguage() ParserLanguage Editor::calcParserLanguage()
{ {
#ifdef ENABLE_SDCC #ifdef ENABLE_SDCC
if (!inProject() Settings::PCompilerSet pSet;
&& pSettings->compilerSets().defaultSet() if (inProject()) {
&& pSettings->compilerSets().defaultSet()->compilerType()==CompilerType::SDCC) { pSet = pSettings->compilerSets().getSet(mProject->options().compilerSet);
return ParserLanguage::SDCC; } else if (!inProject()) {
pSet = pSettings->compilerSets().defaultSet();
} }
if (pSet && pSet->compilerType()==CompilerType::SDCC)
return ParserLanguage::SDCC;
#endif #endif
return mUseCppSyntax?ParserLanguage::CPlusPlus:ParserLanguage::C; return mUseCppSyntax?ParserLanguage::CPlusPlus:ParserLanguage::C;
} }

View File

@ -241,6 +241,7 @@ void resetCppParser(std::shared_ptr<CppParser> parser, int compilerSetIndex)
parser->setEnabled(true); parser->setEnabled(true);
parser->setParseGlobalHeaders(true); parser->setParseGlobalHeaders(true);
parser->setParseLocalHeaders(true); parser->setParseLocalHeaders(true);
// Set options depending on the current compiler set // Set options depending on the current compiler set
if (compilerSetIndex<0) { if (compilerSetIndex<0) {
compilerSetIndex=pSettings->compilerSets().defaultIndex(); compilerSetIndex=pSettings->compilerSets().defaultIndex();