* added radio buttons to start indexing dialog * don't block task scheduler thread while start indexing dialog is visible * don't force whole project refresh on settings change * added help button to start indexing dialog explaining indexing modes * disable unavailable modes when project needs full refresh * improved label texts on indexing dialogs * added --incomplete flag to index command of commandline API * fixed deletion of window stack elements
85 lines
2.5 KiB
C++
85 lines
2.5 KiB
C++
#include "project/SourceGroupCxxEmpty.h"
|
|
|
|
#include "data/indexer/IndexerCommandCxxManual.h"
|
|
#include "settings/ApplicationSettings.h"
|
|
#include "utility/utility.h"
|
|
|
|
SourceGroupCxxEmpty::SourceGroupCxxEmpty(std::shared_ptr<SourceGroupSettingsCxxEmpty> settings)
|
|
: m_settings(settings)
|
|
{
|
|
}
|
|
|
|
SourceGroupCxxEmpty::~SourceGroupCxxEmpty()
|
|
{
|
|
}
|
|
|
|
SourceGroupType SourceGroupCxxEmpty::getType() const
|
|
{
|
|
return m_settings->getType(); // may be either C or Cpp
|
|
}
|
|
|
|
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerCommands(const std::set<FilePath>& filesToIndex)
|
|
{
|
|
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
|
|
|
|
std::vector<FilePath> systemHeaderSearchPaths;
|
|
utility::append(systemHeaderSearchPaths, m_settings->getHeaderSearchPathsExpandedAndAbsolute());
|
|
utility::append(systemHeaderSearchPaths, appSettings->getHeaderSearchPathsExpanded());
|
|
|
|
// Add the source paths as HeaderSearchPaths as well, so clang will also look here when searching include files.
|
|
for (const FilePath& sourcePath: m_settings->getSourcePathsExpandedAndAbsolute())
|
|
{
|
|
if (sourcePath.isDirectory())
|
|
{
|
|
systemHeaderSearchPaths.push_back(sourcePath);
|
|
}
|
|
}
|
|
|
|
std::vector<FilePath> frameworkSearchPaths;
|
|
utility::append(frameworkSearchPaths, m_settings->getFrameworkSearchPathsExpandedAndAbsolute());
|
|
utility::append(frameworkSearchPaths, appSettings->getFrameworkSearchPathsExpanded());
|
|
|
|
std::vector<std::string> compilerFlags;
|
|
{
|
|
const std::string targetFlag = m_settings->getTargetFlag();
|
|
if (!targetFlag.empty())
|
|
{
|
|
compilerFlags.push_back(targetFlag);
|
|
}
|
|
}
|
|
|
|
utility::append(compilerFlags, m_settings->getCompilerFlags());
|
|
|
|
std::set<FilePath> indexedPaths = getIndexedPaths();
|
|
std::set<FilePath> excludedPaths = getExcludedPaths();
|
|
|
|
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
|
|
for (const FilePath& sourcePath: getAllSourceFilePaths())
|
|
{
|
|
if (filesToIndex.find(sourcePath) != filesToIndex.end())
|
|
{
|
|
indexerCommands.push_back(std::make_shared<IndexerCommandCxxManual>(
|
|
sourcePath,
|
|
indexedPaths,
|
|
excludedPaths,
|
|
m_settings->getStandard(),
|
|
systemHeaderSearchPaths,
|
|
frameworkSearchPaths,
|
|
compilerFlags,
|
|
m_settings->getShouldApplyAnonymousTypedefTransformation()
|
|
));
|
|
}
|
|
}
|
|
|
|
return indexerCommands;
|
|
}
|
|
|
|
std::shared_ptr<SourceGroupSettingsCxx> SourceGroupCxxEmpty::getSourceGroupSettingsCxx()
|
|
{
|
|
return m_settings;
|
|
}
|
|
|
|
std::vector<FilePath> SourceGroupCxxEmpty::getAllSourcePaths() const
|
|
{
|
|
return m_settings->getSourcePathsExpandedAndAbsolute();
|
|
} |