logic: shallow python indexing (issue #725)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "FileManager.h"
|
||||
#include "IndexerCommandCustom.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "RefreshInfo.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "SourceGroupSettingsPythonEmpty.h"
|
||||
#include "SqliteIndexStorage.h"
|
||||
@@ -19,6 +20,12 @@ bool SourceGroupPythonEmpty::allowsPartialClearing() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SourceGroupPythonEmpty::allowsShallowIndexing() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::set<FilePath> SourceGroupPythonEmpty::filterToContainedFilePaths(const std::set<FilePath>& filePaths) const
|
||||
{
|
||||
return SourceGroup::filterToContainedFilePaths(
|
||||
@@ -40,7 +47,7 @@ std::set<FilePath> SourceGroupPythonEmpty::getAllSourceFilePaths() const
|
||||
return fileManager.getAllSourceFilePaths();
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupPythonEmpty::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupPythonEmpty::getIndexerCommands(const RefreshInfo& info) const
|
||||
{
|
||||
std::wstring args = L"";
|
||||
|
||||
@@ -57,10 +64,15 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupPythonEmpty::getIndexerC
|
||||
args += L" --verbose";
|
||||
}
|
||||
|
||||
if (info.shallow)
|
||||
{
|
||||
args += L" --shallow";
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
|
||||
for (const FilePath& sourceFilePath : getAllSourceFilePaths())
|
||||
{
|
||||
if (filesToIndex.find(sourceFilePath) != filesToIndex.end())
|
||||
if (info.filesToIndex.find(sourceFilePath) != info.filesToIndex.end())
|
||||
{
|
||||
indexerCommands.push_back(std::make_shared<IndexerCommandCustom>(
|
||||
INDEXER_COMMAND_PYTHON,
|
||||
|
||||
@@ -14,9 +14,10 @@ public:
|
||||
SourceGroupPythonEmpty(std::shared_ptr<SourceGroupSettingsPythonEmpty> settings);
|
||||
|
||||
bool allowsPartialClearing() const override;
|
||||
bool allowsShallowIndexing() const override;
|
||||
std::set<FilePath> filterToContainedFilePaths(const std::set<FilePath>& filePaths) const override;
|
||||
std::set<FilePath> getAllSourceFilePaths() const override;
|
||||
std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) const override;
|
||||
std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const RefreshInfo& info) const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
|
||||
|
||||
Reference in New Issue
Block a user