eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.09k stars 448 forks source link

[Bug]: ctags include dirs #3280

Closed alex-rass-88 closed 8 months ago

alex-rass-88 commented 8 months ago

What happened?

A bug happened! codelite/Plugin/CompileCommandsJSON.cpp has wrong code.

Should be something like this: `

        CompilerCommandLineParser cclp(command, workingDirectory);
        for(size_t i = 0; i < cclp.GetIncludes().GetCount(); ++i)
            m_includes.Add(cclp.GetIncludes()[i]);
        for(size_t i = 0; i < cclp.GetMacros().GetCount(); ++i)
            m_macros.Add(cclp.GetMacros()[i]);
        for(size_t i = 0; i < cclp.GetOtherOptions().GetCount(); ++i)
            m_others.Add(cclp.GetOtherOptions()[i]);       

`

Version

Self compiled

Operating system

Linux

Steps to reproduce

No response

Relevant log output

No response

eranif commented 8 months ago

how is this different from the current code?

CompilerCommandLineParser cclp(command, workingDirectory);
m_includes = cclp.GetIncludes();
m_macros = cclp.GetMacros();
m_others = cclp.GetOtherOptions();

m_includes is of type wxArrayString, so assigning it another wxArrayString (e.g. cclp.GetIncludes()) is identical to the code that you wrote

alex-rass-88 commented 8 months ago

Strange. Not all dirs assigned. But after my fix it's all assigned

alex-rass-88 commented 7 months ago

https://github.com/wxWidgets/wxWidgets/blob/edd1d758deb70d7a392a23b00fc3b241960b9049/src/common/arrstr.cpp#L133

Assigning clear array and copy new