logic: shallow python indexing (issue #725)

This commit is contained in:
mlangkabel
2019-11-06 19:50:47 +01:00
parent 73f3be72e1
commit 9d556599ab
37 changed files with 284 additions and 98 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
#include "IndexerCommandJava.h"
#include "FileManager.h"
#include "logging.h"
#include "RefreshInfo.h"
#include "SourceGroupSettings.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "SourceGroupSettingsWithJavaStandard.h"
@@ -33,7 +34,7 @@ std::set<FilePath> SourceGroupJava::getAllSourceFilePaths() const
return fileManager.getAllSourceFilePaths();
}
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(const RefreshInfo& info) const
{
const std::wstring languageStandard =
dynamic_cast<const SourceGroupSettingsWithJavaStandard*>(getSourceGroupSettings().get())->getJavaStandard();
@@ -43,7 +44,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
for (const FilePath& sourcePath: getAllSourceFilePaths())
{
if (filesToIndex.find(sourcePath) != filesToIndex.end())
if (info.filesToIndex.find(sourcePath) != info.filesToIndex.end())
{
indexerCommands.push_back(std::make_shared<IndexerCommandJava>(
sourcePath, languageStandard, classPath
+1 -1
View File
@@ -13,7 +13,7 @@ class SourceGroupJava
public:
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:
virtual std::vector<FilePath> getAllSourcePaths() const = 0;
@@ -1,12 +1,13 @@
#include "SourceGroupJavaSonargraph.h"
#include "IndexerCommandJava.h"
#include "ApplicationSettings.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "MessageStatus.h"
#include "SonargraphProject.h"
#include "utilityJava.h"
#include "Application.h"
#include "ApplicationSettings.h"
#include "IndexerCommandJava.h"
#include "MessageStatus.h"
#include "RefreshInfo.h"
#include "SonargraphProject.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "utilityJava.h"
SourceGroupJavaSonargraph::SourceGroupJavaSonargraph(std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings)
: m_settings(settings)
@@ -65,7 +66,7 @@ std::set<FilePath> SourceGroupJavaSonargraph::getAllSourceFilePaths() const
return std::set<FilePath>();
}
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJavaSonargraph::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJavaSonargraph::getIndexerCommands(const RefreshInfo& info) const
{
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
@@ -75,7 +76,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJavaSonargraph::getIndex
{
for (std::shared_ptr<IndexerCommand> indexerCommand : project->getIndexerCommands(m_settings, ApplicationSettings::getInstance()))
{
if (filesToIndex.find(indexerCommand->getSourceFilePath()) != filesToIndex.end())
if (info.filesToIndex.find(indexerCommand->getSourceFilePath()) != info.filesToIndex.end())
{
indexerCommands.push_back(indexerCommand);
}
@@ -17,7 +17,7 @@ public:
bool prepareIndexing() 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;