src: Apply clang-format and extend use to Java code (#973)
This commit is contained in:
+27
-40
@@ -12,39 +12,39 @@
|
||||
#include "ConsoleLogger.h"
|
||||
#include "FileLogger.h"
|
||||
#include "LanguagePackageManager.h"
|
||||
#include "logging.h"
|
||||
#include "LogManager.h"
|
||||
#include "MessageIndexingInterrupted.h"
|
||||
#include "MessageLoadProject.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "productVersion.h"
|
||||
#include "QtNetworkFactory.h"
|
||||
#include "QtApplication.h"
|
||||
#include "QtCoreApplication.h"
|
||||
#include "QtNetworkFactory.h"
|
||||
#include "QtViewFactory.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "ScopedFunctor.h"
|
||||
#include "SourceGroupFactory.h"
|
||||
#include "SourceGroupFactoryModuleCustom.h"
|
||||
#include "UserPaths.h"
|
||||
#include "Version.h"
|
||||
#include "logging.h"
|
||||
#include "productVersion.h"
|
||||
#include "utility.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utilityQt.h"
|
||||
#include "Version.h"
|
||||
|
||||
#if BUILD_CXX_LANGUAGE_PACKAGE
|
||||
#include "LanguagePackageCxx.h"
|
||||
#include "SourceGroupFactoryModuleCxx.h"
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
# include "LanguagePackageCxx.h"
|
||||
# include "SourceGroupFactoryModuleCxx.h"
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
#include "LanguagePackageJava.h"
|
||||
#include "SourceGroupFactoryModuleJava.h"
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
# include "LanguagePackageJava.h"
|
||||
# include "SourceGroupFactoryModuleJava.h"
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
#include "SourceGroupFactoryModulePython.h"
|
||||
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
# include "SourceGroupFactoryModulePython.h"
|
||||
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
|
||||
void signalHandler(int signum)
|
||||
{
|
||||
@@ -72,26 +72,26 @@ void addLanguagePackages()
|
||||
|
||||
#if BUILD_CXX_LANGUAGE_PACKAGE
|
||||
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleCxx>());
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleJava>());
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModulePython>());
|
||||
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_CXX_LANGUAGE_PACKAGE
|
||||
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageCxx>());
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageJava>());
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QCoreApplication::addLibraryPath(QStringLiteral("."));
|
||||
|
||||
@@ -111,19 +111,14 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
}
|
||||
|
||||
Version version(
|
||||
VERSION_YEAR,
|
||||
VERSION_MINOR,
|
||||
VERSION_COMMIT,
|
||||
GIT_COMMIT_HASH
|
||||
);
|
||||
Version version(VERSION_YEAR, VERSION_MINOR, VERSION_COMMIT, GIT_COMMIT_HASH);
|
||||
QApplication::setApplicationVersion(version.toDisplayString().c_str());
|
||||
|
||||
MessageStatus(
|
||||
std::wstring(L"Starting Sourcetrail ") +
|
||||
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? L"32" : L"64") + L" bit, " +
|
||||
L"version " + version.toDisplayWString()
|
||||
).dispatch();
|
||||
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? L"32" : L"64") +
|
||||
L" bit, " + L"version " + version.toDisplayWString())
|
||||
.dispatch();
|
||||
|
||||
commandline::CommandLineParser commandLineParser(version.toDisplayString());
|
||||
commandLineParser.preparse(argc, argv);
|
||||
@@ -144,9 +139,7 @@ int main(int argc, char *argv[])
|
||||
setupLogging();
|
||||
|
||||
Application::createInstance(version, nullptr, nullptr);
|
||||
ScopedFunctor f([](){
|
||||
Application::destroyInstance();
|
||||
});
|
||||
ScopedFunctor f([]() { Application::destroyInstance(); });
|
||||
|
||||
ApplicationSettingsPrefiller::prefillPaths(ApplicationSettings::getInstance().get());
|
||||
addLanguagePackages();
|
||||
@@ -172,8 +165,8 @@ int main(int argc, char *argv[])
|
||||
commandLineParser.getProjectFilePath(),
|
||||
false,
|
||||
commandLineParser.getRefreshMode(),
|
||||
commandLineParser.getShallowIndexingRequested()
|
||||
).dispatch();
|
||||
commandLineParser.getShallowIndexingRequested())
|
||||
.dispatch();
|
||||
}
|
||||
|
||||
return qtApp.exec();
|
||||
@@ -204,9 +197,7 @@ int main(int argc, char *argv[])
|
||||
QtNetworkFactory networkFactory;
|
||||
|
||||
Application::createInstance(version, &viewFactory, &networkFactory);
|
||||
ScopedFunctor f([](){
|
||||
Application::destroyInstance();
|
||||
});
|
||||
ScopedFunctor f([]() { Application::destroyInstance(); });
|
||||
|
||||
ApplicationSettingsPrefiller::prefillPaths(ApplicationSettings::getInstance().get());
|
||||
addLanguagePackages();
|
||||
@@ -220,11 +211,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageLoadProject(
|
||||
commandLineParser.getProjectFilePath(),
|
||||
false,
|
||||
REFRESH_NONE
|
||||
).dispatch();
|
||||
MessageLoadProject(commandLineParser.getProjectFilePath(), false, REFRESH_NONE).dispatch();
|
||||
}
|
||||
|
||||
return qtApp.exec();
|
||||
|
||||
+12
-12
@@ -2,22 +2,22 @@
|
||||
|
||||
#include "language_packages.h"
|
||||
|
||||
#include "LanguagePackageManager.h"
|
||||
#include "InterprocessIndexer.h"
|
||||
#include "ApplicationSettings.h"
|
||||
#include "AppPath.h"
|
||||
#include "ApplicationSettings.h"
|
||||
#include "ConsoleLogger.h"
|
||||
#include "FileLogger.h"
|
||||
#include "logging.h"
|
||||
#include "InterprocessIndexer.h"
|
||||
#include "LanguagePackageManager.h"
|
||||
#include "LogManager.h"
|
||||
#include "logging.h"
|
||||
|
||||
#if BUILD_CXX_LANGUAGE_PACKAGE
|
||||
#include "LanguagePackageCxx.h"
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
# include "LanguagePackageCxx.h"
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
#include "LanguagePackageJava.h"
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
# include "LanguagePackageJava.h"
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
|
||||
void setupLogging(const FilePath& logFilePath)
|
||||
{
|
||||
@@ -38,10 +38,10 @@ void suppressCrashMessage()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
|
||||
#endif // _WIN32
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int processId = -1;
|
||||
std::string instanceUuid;
|
||||
@@ -94,11 +94,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
#if BUILD_CXX_LANGUAGE_PACKAGE
|
||||
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageCxx>());
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_CXX_LANGUAGE_PACKAGE
|
||||
|
||||
#if BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageJava>());
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
|
||||
|
||||
InterprocessIndexer indexer(instanceUuid, processId);
|
||||
indexer.work();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "ApplicationSettings.h"
|
||||
#include "ColorScheme.h"
|
||||
#include "DialogView.h"
|
||||
#include "FileLogger.h"
|
||||
#include "FileSystem.h"
|
||||
#include "GraphViewStyle.h"
|
||||
#include "IDECommunicationController.h"
|
||||
@@ -30,7 +31,6 @@
|
||||
#include "tracing.h"
|
||||
#include "utilityString.h"
|
||||
#include "utilityUuid.h"
|
||||
#include "FileLogger.h"
|
||||
|
||||
std::shared_ptr<Application> Application::s_instance;
|
||||
std::string Application::s_uuid;
|
||||
@@ -333,8 +333,7 @@ void Application::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
TRACE("app refresh");
|
||||
|
||||
refreshProject(
|
||||
message->all ? REFRESH_ALL_FILES : REFRESH_UPDATED_FILES, false);
|
||||
refreshProject(message->all ? REFRESH_ALL_FILES : REFRESH_UPDATED_FILES, false);
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageRefreshUI* message)
|
||||
@@ -424,7 +423,8 @@ void Application::refreshProject(RefreshMode refreshMode, bool shallowIndexingRe
|
||||
{
|
||||
if (m_project && checkSharedMemory())
|
||||
{
|
||||
m_project->refresh(getDialogView(DialogView::UseCase::INDEXING), refreshMode, shallowIndexingRequested);
|
||||
m_project->refresh(
|
||||
getDialogView(DialogView::UseCase::INDEXING), refreshMode, shallowIndexingRequested);
|
||||
|
||||
if (!m_hasGUI && !m_project->isIndexing())
|
||||
{
|
||||
|
||||
@@ -21,9 +21,9 @@ bool AppPath::setSharedDataPath(const FilePath& path)
|
||||
FilePath AppPath::getCxxIndexerPath()
|
||||
{
|
||||
#if _WIN32
|
||||
const std::wstring cxxIndexerName(L"sourcetrail_indexer.exe");
|
||||
const std::wstring cxxIndexerName(L"sourcetrail_indexer.exe");
|
||||
#else
|
||||
const std::wstring cxxIndexerName(L"sourcetrail_indexer");
|
||||
const std::wstring cxxIndexerName(L"sourcetrail_indexer");
|
||||
#endif
|
||||
|
||||
if (!m_cxxIndexerPath.empty())
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
namespace
|
||||
{
|
||||
template <class Container>
|
||||
void reverseErase(Container & container)
|
||||
void reverseErase(Container& container)
|
||||
{
|
||||
while(!container.empty())
|
||||
while (!container.empty())
|
||||
container.pop_back();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -577,10 +577,15 @@ void CodeController::handleMessage(MessageToNextCodeReference* message)
|
||||
}
|
||||
else if (referenceFileIndex == 0)
|
||||
{
|
||||
if (m_references[referenceIndex].lineNumber == m_localReferences[localReferenceIndex].lineNumber)
|
||||
if (m_references[referenceIndex].lineNumber ==
|
||||
m_localReferences[localReferenceIndex].lineNumber)
|
||||
{
|
||||
if ((next && m_references[referenceIndex].columnNumber < m_localReferences[localReferenceIndex].columnNumber) ||
|
||||
(!next && m_references[referenceIndex].columnNumber > m_localReferences[localReferenceIndex].columnNumber))
|
||||
if ((next &&
|
||||
m_references[referenceIndex].columnNumber <
|
||||
m_localReferences[localReferenceIndex].columnNumber) ||
|
||||
(!next &&
|
||||
m_references[referenceIndex].columnNumber >
|
||||
m_localReferences[localReferenceIndex].columnNumber))
|
||||
{
|
||||
localReferenceIndex = -1;
|
||||
}
|
||||
@@ -591,8 +596,12 @@ void CodeController::handleMessage(MessageToNextCodeReference* message)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((next && m_references[referenceIndex].lineNumber < m_localReferences[localReferenceIndex].lineNumber) ||
|
||||
(!next && m_references[referenceIndex].lineNumber > m_localReferences[localReferenceIndex].lineNumber))
|
||||
if ((next &&
|
||||
m_references[referenceIndex].lineNumber <
|
||||
m_localReferences[localReferenceIndex].lineNumber) ||
|
||||
(!next &&
|
||||
m_references[referenceIndex].lineNumber >
|
||||
m_localReferences[localReferenceIndex].lineNumber))
|
||||
{
|
||||
localReferenceIndex = -1;
|
||||
}
|
||||
@@ -1200,7 +1209,8 @@ std::pair<int, int> CodeController::findClosestReferenceIndex(
|
||||
if (!next)
|
||||
{
|
||||
if (references[i].lineNumber < currentLineNumber ||
|
||||
(references[i].lineNumber == currentLineNumber && references[i].columnNumber < currentColumnNumber))
|
||||
(references[i].lineNumber == currentLineNumber &&
|
||||
references[i].columnNumber < currentColumnNumber))
|
||||
{
|
||||
referenceIndex = static_cast<int>(i);
|
||||
}
|
||||
@@ -1209,8 +1219,10 @@ std::pair<int, int> CodeController::findClosestReferenceIndex(
|
||||
return {referenceIndex, beforeCurrentFile ? -1 : 0};
|
||||
}
|
||||
}
|
||||
else if (references[i].lineNumber > currentLineNumber ||
|
||||
(references[i].lineNumber == currentLineNumber && references[i].columnNumber > currentColumnNumber))
|
||||
else if (
|
||||
references[i].lineNumber > currentLineNumber ||
|
||||
(references[i].lineNumber == currentLineNumber &&
|
||||
references[i].columnNumber > currentColumnNumber))
|
||||
{
|
||||
return {static_cast<int>(i), 0};
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "MessageCodeShowDefinition.h"
|
||||
#include "MessageDeactivateEdge.h"
|
||||
#include "MessageErrorCountClear.h"
|
||||
#include "MessageFocusChanged.h"
|
||||
#include "MessageFlushUpdates.h"
|
||||
#include "MessageFocusChanged.h"
|
||||
#include "MessageFocusIn.h"
|
||||
#include "MessageFocusOut.h"
|
||||
#include "MessageListener.h"
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "MessageActivateTrail.h"
|
||||
#include "MessageActivateTrailEdge.h"
|
||||
#include "MessageDeactivateEdge.h"
|
||||
#include "MessageFocusChanged.h"
|
||||
#include "MessageFlushUpdates.h"
|
||||
#include "MessageFocusChanged.h"
|
||||
#include "MessageFocusIn.h"
|
||||
#include "MessageFocusOut.h"
|
||||
#include "MessageGraphNodeBundleSplit.h"
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
CompositeView::CompositeView(ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId)
|
||||
CompositeView::CompositeView(
|
||||
ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId)
|
||||
: View(viewLayout), m_direction(direction), m_name(name), m_tabId(tabId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public:
|
||||
DIRECTION_VERTICAL
|
||||
};
|
||||
|
||||
CompositeView(ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId);
|
||||
CompositeView(
|
||||
ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId);
|
||||
virtual ~CompositeView();
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
|
||||
@@ -371,7 +371,13 @@ GraphViewStyle::NodeMargins GraphViewStyle::getMarginsOfGroupNode(GroupType type
|
||||
}
|
||||
|
||||
GraphViewStyle::NodeStyle GraphViewStyle::getStyleForNodeType(
|
||||
NodeType type, bool defined, bool isActive, bool isFocused, bool isCoFocused, bool hasChildren, bool hasQualifier)
|
||||
NodeType type,
|
||||
bool defined,
|
||||
bool isActive,
|
||||
bool isFocused,
|
||||
bool isCoFocused,
|
||||
bool hasChildren,
|
||||
bool hasQualifier)
|
||||
{
|
||||
return getStyleForNodeType(
|
||||
type.getNodeStyle(),
|
||||
@@ -685,7 +691,8 @@ GraphViewStyle::EdgeStyle GraphViewStyle::getStyleForEdgeType(
|
||||
if (isTrailEdge && isActive)
|
||||
{
|
||||
style.width = 3;
|
||||
style.color = ColorScheme::getInstance()->getColor("graph/edge/call_trail_focus", style.color);
|
||||
style.color = ColorScheme::getInstance()->getColor(
|
||||
"graph/edge/call_trail_focus", style.color);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -22,9 +22,11 @@ struct CodeScrollParams
|
||||
TOP
|
||||
};
|
||||
|
||||
static CodeScrollParams toReference(const FilePath& filePath, Id locationId, Id scopeLocationId, Target target)
|
||||
static CodeScrollParams toReference(
|
||||
const FilePath& filePath, Id locationId, Id scopeLocationId, Target target)
|
||||
{
|
||||
return CodeScrollParams(Type::TO_REFERENCE, target, filePath, locationId, scopeLocationId, 0, 0, false);
|
||||
return CodeScrollParams(
|
||||
Type::TO_REFERENCE, target, filePath, locationId, scopeLocationId, 0, 0, false);
|
||||
}
|
||||
|
||||
static CodeScrollParams toFile(const FilePath& filePath, Target target)
|
||||
@@ -39,7 +41,8 @@ struct CodeScrollParams
|
||||
|
||||
static CodeScrollParams toValue(size_t value, bool inListMode)
|
||||
{
|
||||
return CodeScrollParams(Type::TO_VALUE, Target::VISIBLE, FilePath(), 0, 0, 0, value, inListMode);
|
||||
return CodeScrollParams(
|
||||
Type::TO_VALUE, Target::VISIBLE, FilePath(), 0, 0, 0, value, inListMode);
|
||||
}
|
||||
|
||||
CodeScrollParams(
|
||||
@@ -50,8 +53,7 @@ struct CodeScrollParams
|
||||
Id scopeLocationId,
|
||||
size_t line,
|
||||
size_t value,
|
||||
bool inListMode
|
||||
)
|
||||
bool inListMode)
|
||||
: type(type)
|
||||
, target(target)
|
||||
, filePath(filePath)
|
||||
|
||||
@@ -166,13 +166,10 @@ NodeTypeSet::MaskType NodeTypeSet::nodeTypeToMask(const NodeType& nodeType)
|
||||
}
|
||||
|
||||
const std::vector<NodeType> NodeTypeSet::s_allNodeTypes = {
|
||||
NodeType(NODE_SYMBOL), NodeType(NODE_TYPE),
|
||||
NodeType(NODE_BUILTIN_TYPE), NodeType(NODE_MODULE),
|
||||
NodeType(NODE_NAMESPACE), NodeType(NODE_PACKAGE),
|
||||
NodeType(NODE_STRUCT), NodeType(NODE_CLASS),
|
||||
NodeType(NODE_INTERFACE), NodeType(NODE_GLOBAL_VARIABLE),
|
||||
NodeType(NODE_FIELD), NodeType(NODE_FUNCTION),
|
||||
NodeType(NODE_METHOD), NodeType(NODE_ENUM),
|
||||
NodeType(NODE_ENUM_CONSTANT), NodeType(NODE_TYPEDEF),
|
||||
NodeType(NODE_TYPE_PARAMETER), NodeType(NODE_FILE),
|
||||
NodeType(NODE_MACRO), NodeType(NODE_UNION)};
|
||||
NodeType(NODE_SYMBOL), NodeType(NODE_TYPE), NodeType(NODE_BUILTIN_TYPE),
|
||||
NodeType(NODE_MODULE), NodeType(NODE_NAMESPACE), NodeType(NODE_PACKAGE),
|
||||
NodeType(NODE_STRUCT), NodeType(NODE_CLASS), NodeType(NODE_INTERFACE),
|
||||
NodeType(NODE_GLOBAL_VARIABLE), NodeType(NODE_FIELD), NodeType(NODE_FUNCTION),
|
||||
NodeType(NODE_METHOD), NodeType(NODE_ENUM), NodeType(NODE_ENUM_CONSTANT),
|
||||
NodeType(NODE_TYPEDEF), NodeType(NODE_TYPE_PARAMETER), NodeType(NODE_FILE),
|
||||
NodeType(NODE_MACRO), NodeType(NODE_UNION)};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef TOKEN_H
|
||||
#define TOKEN_H
|
||||
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "TokenComponent.h"
|
||||
#include "types.h"
|
||||
|
||||
@@ -361,7 +361,8 @@ std::vector<Id> SqliteIndexStorage::addSourceLocations(const std::vector<Storage
|
||||
static_cast<uint16_t>(data.endCol),
|
||||
data.type);
|
||||
|
||||
std::map<TempSourceLocation, uint32_t>& index = m_tempSourceLocationIndices[static_cast<uint32_t>(data.fileNodeId)];
|
||||
std::map<TempSourceLocation, uint32_t>& index =
|
||||
m_tempSourceLocationIndices[static_cast<uint32_t>(data.fileNodeId)];
|
||||
std::map<TempSourceLocation, uint32_t>::const_iterator it = index.find(tempLoc);
|
||||
if (it != index.end())
|
||||
{
|
||||
|
||||
@@ -272,7 +272,8 @@ void Project::load(std::shared_ptr<DialogView> dialogView)
|
||||
}
|
||||
}
|
||||
|
||||
void Project::refresh(std::shared_ptr<DialogView> dialogView, RefreshMode refreshMode, bool shallowIndexingRequested)
|
||||
void Project::refresh(
|
||||
std::shared_ptr<DialogView> dialogView, RefreshMode refreshMode, bool shallowIndexingRequested)
|
||||
{
|
||||
if (m_refreshStage != RefreshStageType::NONE)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
|
||||
void load(std::shared_ptr<DialogView> dialogView);
|
||||
|
||||
void refresh(std::shared_ptr<DialogView> dialogView, RefreshMode refreshMode, bool shallowIndexingRequested);
|
||||
void refresh(
|
||||
std::shared_ptr<DialogView> dialogView, RefreshMode refreshMode, bool shallowIndexingRequested);
|
||||
|
||||
RefreshInfo getRefreshInfo(RefreshMode mode) const;
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ RefreshInfo RefreshInfoGenerator::getRefreshInfoForUpdatedFiles(
|
||||
|
||||
// 2.3) Handle files that are referenced by the files that will be cleared. These will be
|
||||
// re-indexed on the fly. However, we do not
|
||||
// need to clear files that are also referenced by unchanged source files, because otherwise
|
||||
//we will lose these connections.
|
||||
// need to clear files that are also referenced by unchanged source files, because
|
||||
//otherwise we will lose these connections.
|
||||
// 2.3.1) Get all source file paths that will not be cleared.
|
||||
// - Initially this list contains all source file paths the project would index right now.
|
||||
// - Then we remove all source files that will be cleared
|
||||
|
||||
@@ -340,10 +340,10 @@ void ApplicationSettings::setVerboseIndexerLoggingEnabled(bool value)
|
||||
FilePath ApplicationSettings::getLogDirectoryPath() const
|
||||
{
|
||||
return FilePath(getValue<std::wstring>(
|
||||
"application/log_directory_path", UserPaths::getLogPath().getAbsolute().wstr()));
|
||||
"application/log_directory_path", UserPaths::getLogPath().getAbsolute().wstr()));
|
||||
}
|
||||
|
||||
void ApplicationSettings::setLogDirectoryPath(const FilePath &path)
|
||||
void ApplicationSettings::setLogDirectoryPath(const FilePath& path)
|
||||
{
|
||||
setValue<std::wstring>("application/log_directory_path", path.wstr());
|
||||
}
|
||||
|
||||
@@ -19,10 +19,9 @@ namespace commandline
|
||||
CommandLineParser::CommandLineParser(const std::string& version): m_version(version)
|
||||
{
|
||||
po::options_description options("Options");
|
||||
options.add_options()
|
||||
("help,h", "Print this help message")
|
||||
("version,v", "Version of Sourcetrail")
|
||||
("project-file", po::value<std::string>(), "Open Sourcetrail with this project (.srctrlprj)");
|
||||
options.add_options()("help,h", "Print this help message")(
|
||||
"version,v", "Version of Sourcetrail")(
|
||||
"project-file", po::value<std::string>(), "Open Sourcetrail with this project (.srctrlprj)");
|
||||
|
||||
m_options.add(options);
|
||||
m_positional.add("project-file", 1);
|
||||
@@ -30,7 +29,7 @@ CommandLineParser::CommandLineParser(const std::string& version): m_version(vers
|
||||
m_commands.push_back(std::make_unique<commandline::CommandlineCommandConfig>(this));
|
||||
m_commands.push_back(std::make_unique<commandline::CommandlineCommandIndex>(this));
|
||||
|
||||
for (auto& command : m_commands)
|
||||
for (auto& command: m_commands)
|
||||
{
|
||||
command->setup();
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@ CommandlineCommandIndex::~CommandlineCommandIndex() {}
|
||||
void CommandlineCommandIndex::setup()
|
||||
{
|
||||
po::options_description options("Config Options");
|
||||
options.add_options()
|
||||
("help,h", "Print this help message")
|
||||
("incomplete,i", "Also reindex incomplete files (files with errors)")
|
||||
("full,f", "Index full project (omit to only index new/changed files)")
|
||||
("shallow,s", "Build a shallow index is supported by the project")
|
||||
("project-file", po::value<std::string>(), "Project file to index (.srctrlprj)");
|
||||
options.add_options()("help,h", "Print this help message")(
|
||||
"incomplete,i", "Also reindex incomplete files (files with errors)")(
|
||||
"full,f", "Index full project (omit to only index new/changed files)")(
|
||||
"shallow,s", "Build a shallow index is supported by the project")(
|
||||
"project-file", po::value<std::string>(), "Project file to index (.srctrlprj)");
|
||||
|
||||
m_options.add(options);
|
||||
m_positional.add("project-file", 1);
|
||||
|
||||
@@ -14,16 +14,17 @@ SharedMemory::ScopedAccess::ScopedAccess(SharedMemory* memory)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_memory = boost::interprocess::managed_shared_memory(boost::interprocess::open_only, memory->getMemoryName().c_str());
|
||||
m_memory = boost::interprocess::managed_shared_memory(
|
||||
boost::interprocess::open_only, memory->getMemoryName().c_str());
|
||||
}
|
||||
catch (boost::interprocess::interprocess_exception& e)
|
||||
{
|
||||
LOG_ERROR_STREAM(
|
||||
<< "boost exception thrown at ScopedAccess constructor - " << memory->getMemoryName() << ": "
|
||||
<< e.what());
|
||||
<< "boost exception thrown at ScopedAccess constructor - " << memory->getMemoryName()
|
||||
<< ": " << e.what());
|
||||
|
||||
// Behaves the same as the initializer construction, with the error printed out
|
||||
//throw e;
|
||||
// throw e;
|
||||
|
||||
boost::interprocess::permissions permissions;
|
||||
permissions.set_unrestricted();
|
||||
@@ -32,10 +33,8 @@ SharedMemory::ScopedAccess::ScopedAccess(SharedMemory* memory)
|
||||
memory->getMemoryName().c_str(),
|
||||
memory->getInitialMemorySize(),
|
||||
0,
|
||||
permissions
|
||||
);
|
||||
permissions);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SharedMemory::ScopedAccess::~ScopedAccess() {}
|
||||
|
||||
@@ -10,7 +10,10 @@ class MessageLoadProject: public Message<MessageLoadProject>
|
||||
{
|
||||
public:
|
||||
MessageLoadProject(
|
||||
const FilePath& filePath, bool settingsChanged = false, RefreshMode refreshMode = REFRESH_NONE, bool shallowIndexingRequested = false)
|
||||
const FilePath& filePath,
|
||||
bool settingsChanged = false,
|
||||
RefreshMode refreshMode = REFRESH_NONE,
|
||||
bool shallowIndexingRequested = false)
|
||||
: projectSettingsFilePath(filePath)
|
||||
, settingsChanged(settingsChanged)
|
||||
, refreshMode(refreshMode)
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
return "MessageRefreshUIState";
|
||||
}
|
||||
|
||||
MessageRefreshUIState(bool isAfterIndexing) : isAfterIndexing(isAfterIndexing) {}
|
||||
MessageRefreshUIState(bool isAfterIndexing): isAfterIndexing(isAfterIndexing) {}
|
||||
|
||||
bool isAfterIndexing = false;
|
||||
};
|
||||
|
||||
@@ -14,8 +14,7 @@ public:
|
||||
};
|
||||
|
||||
MessageFocusChanged(ViewType type, Id tokenOrLocationId)
|
||||
: type(type)
|
||||
, tokenOrLocationId(tokenOrLocationId)
|
||||
: type(type), tokenOrLocationId(tokenOrLocationId)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
class MessageFocusedSearchView: public Message<MessageFocusedSearchView>
|
||||
{
|
||||
public:
|
||||
MessageFocusedSearchView(bool focusIn)
|
||||
: focusIn(focusIn)
|
||||
MessageFocusedSearchView(bool focusIn): focusIn(focusIn)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
|
||||
@@ -130,9 +130,8 @@ FilePath CanonicalFilePathCache::getDeclarationFilePath(const clang::Decl* decla
|
||||
{
|
||||
return getCanonicalFilePath(fileId, sourceManager);
|
||||
}
|
||||
return getCanonicalFilePath(
|
||||
utility::decodeFromUtf8(
|
||||
sourceManager.getPresumedLoc(declaration->getBeginLoc()).getFilename()));
|
||||
return getCanonicalFilePath(utility::decodeFromUtf8(
|
||||
sourceManager.getPresumedLoc(declaration->getBeginLoc()).getFilename()));
|
||||
}
|
||||
|
||||
std::wstring CanonicalFilePathCache::getDeclarationFileName(const clang::Decl* declaration)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <clang/Frontend/CompilerInstance.h>
|
||||
#include <clang/Frontend/MultiplexConsumer.h>
|
||||
#include <clang/Serialization/ASTWriter.h>
|
||||
#include <clang/Lex/PreprocessorOptions.h>
|
||||
#include <clang/Serialization/ASTWriter.h>
|
||||
|
||||
#include "PreprocessorCallbacks.h"
|
||||
|
||||
@@ -44,7 +44,7 @@ std::unique_ptr<clang::ASTConsumer> GeneratePCHAction::CreateASTConsumer(
|
||||
Sysroot,
|
||||
Buffer,
|
||||
FrontendOpts.ModuleFileExtensions,
|
||||
true, // always allow errors in the PCH
|
||||
true, // always allow errors in the PCH
|
||||
FrontendOpts.IncludeTimestamps,
|
||||
+CI.getLangOpts().CacheGeneratedPCH));
|
||||
Consumers.push_back(CI.getPCHContainerWriter().CreatePCHContainerGenerator(
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define CODEBLOCKS_COMPILER_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class TiXmlElement;
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ void setupPlatform(int argc, char* argv[])
|
||||
|
||||
void setupApp(int argc, char* argv[])
|
||||
{
|
||||
FilePath appPath = FilePath(QCoreApplication::applicationDirPath().toStdWString() + L"/").getAbsolute();
|
||||
FilePath appPath =
|
||||
FilePath(QCoreApplication::applicationDirPath().toStdWString() + L"/").getAbsolute();
|
||||
AppPath::setSharedDataPath(appPath);
|
||||
AppPath::setCxxIndexerPath(appPath);
|
||||
|
||||
@@ -67,7 +68,8 @@ void setupApp(int argc, char* argv[])
|
||||
utility::copyNewFilesFromDirectory(
|
||||
QString::fromStdWString(ResourcePaths::getFallbackPath().wstr()), userDataPath);
|
||||
utility::copyNewFilesFromDirectory(
|
||||
QString::fromStdWString(AppPath::getSharedDataPath().concatenate(L"user/").wstr()), userDataPath);
|
||||
QString::fromStdWString(AppPath::getSharedDataPath().concatenate(L"user/").wstr()),
|
||||
userDataPath);
|
||||
}
|
||||
|
||||
#endif // INCLUDES_DEFAULT_H
|
||||
|
||||
@@ -81,7 +81,13 @@ bool CodeFocusHandler::hasCurrentFocus() const
|
||||
}
|
||||
|
||||
void CodeFocusHandler::setFocusedLocationId(
|
||||
QtCodeArea* area, size_t lineNumber, size_t columnNumber, Id locationId, const std::vector<Id>& tokenIds, bool updateTargetColumn, bool fromMouse)
|
||||
QtCodeArea* area,
|
||||
size_t lineNumber,
|
||||
size_t columnNumber,
|
||||
Id locationId,
|
||||
const std::vector<Id>& tokenIds,
|
||||
bool updateTargetColumn,
|
||||
bool fromMouse)
|
||||
{
|
||||
if (updateTargetColumn)
|
||||
{
|
||||
|
||||
@@ -1066,7 +1066,7 @@ void QtCodeArea::activateAnnotationsOrErrors(
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_showLineNumbers) // for links in project description
|
||||
if (!m_showLineNumbers) // for links in project description
|
||||
{
|
||||
std::set<Id> tokenIds;
|
||||
for (const Annotation* annotation: annotations)
|
||||
|
||||
@@ -94,7 +94,8 @@ protected:
|
||||
Id focusedLocationId);
|
||||
|
||||
void createAnnotations(std::shared_ptr<SourceLocationFile> locationFile);
|
||||
void activateAnnotations(const std::vector<const Annotation*>& annotations, bool fromMouse, int mouseOffsetX);
|
||||
void activateAnnotations(
|
||||
const std::vector<const Annotation*>& annotations, bool fromMouse, int mouseOffsetX);
|
||||
|
||||
int toTextEditPosition(int lineNumber, int columnNumber) const;
|
||||
std::pair<int, int> toLineColumn(int textEditPosition) const;
|
||||
|
||||
@@ -33,7 +33,7 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeNavigator* navigator, boo
|
||||
connect(m_titleBar, &QtCodeFileTitleBar::minimize, this, &QtCodeFile::clickedMinimizeButton);
|
||||
connect(m_titleBar, &QtCodeFileTitleBar::snippet, this, &QtCodeFile::clickedSnippetButton);
|
||||
connect(m_titleBar, &QtCodeFileTitleBar::maximize, this, &QtCodeFile::clickedMaximizeButton);
|
||||
connect(m_titleBar, &QtHoverButton::hoveredIn, [this](){
|
||||
connect(m_titleBar, &QtHoverButton::hoveredIn, [this]() {
|
||||
m_navigator->setFocusedFile(this);
|
||||
m_navigator->setFocus();
|
||||
});
|
||||
|
||||
@@ -177,7 +177,8 @@ void QtCodeFileList::addFile(const CodeFileParams& params)
|
||||
{
|
||||
Id focusedLocationId = 0;
|
||||
const CodeFocusHandler::Focus& currentFocus = m_navigator->getCurrentFocus();
|
||||
if (currentFocus.area && file->getFilePath() == currentFocus.area->getSourceLocationFile()->getFilePath())
|
||||
if (currentFocus.area &&
|
||||
file->getFilePath() == currentFocus.area->getSourceLocationFile()->getFilePath())
|
||||
{
|
||||
focusedLocationId = currentFocus.locationId;
|
||||
}
|
||||
@@ -299,8 +300,14 @@ void QtCodeFileList::scrollTo(
|
||||
|
||||
if (focusTarget)
|
||||
{
|
||||
m_navigator->setFocusedLocationId(snippet->getArea(), lineNumber,
|
||||
snippet->getArea()->getColumnNumberForLocationId(locationId), locationId, {}, false, false);
|
||||
m_navigator->setFocusedLocationId(
|
||||
snippet->getArea(),
|
||||
lineNumber,
|
||||
snippet->getArea()->getColumnNumberForLocationId(locationId),
|
||||
locationId,
|
||||
{},
|
||||
false,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +436,8 @@ void QtCodeFileList::updateSnippetTitleAndScrollBarSlot()
|
||||
|
||||
if (m_firstSnippetTitleBar && m_firstSnippetFile)
|
||||
{
|
||||
m_firstSnippetTitleBar->setIsFocused(m_navigator->getCurrentFocus().file == m_firstSnippetFile);
|
||||
m_firstSnippetTitleBar->setIsFocused(
|
||||
m_navigator->getCurrentFocus().file == m_firstSnippetFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +533,7 @@ void QtCodeFileList::updateFirstSnippetTitleBar(QtCodeFile* file, int fileTitleB
|
||||
&QtCodeFileTitleBar::maximize,
|
||||
file,
|
||||
&QtCodeFile::clickedMaximizeButton);
|
||||
connect(m_firstSnippetTitleBar, &QtHoverButton::hoveredIn, [this, file](){
|
||||
connect(m_firstSnippetTitleBar, &QtHoverButton::hoveredIn, [this, file]() {
|
||||
m_navigator->setFocusedFile(file);
|
||||
m_navigator->setFocus();
|
||||
});
|
||||
|
||||
@@ -217,8 +217,14 @@ void QtCodeFileSingle::scrollTo(
|
||||
|
||||
if (focusTarget && locationId)
|
||||
{
|
||||
m_navigator->setFocusedLocationId(m_area, lineNumber, m_area->getColumnNumberForLocationId(locationId),
|
||||
locationId, {}, false, false);
|
||||
m_navigator->setFocusedLocationId(
|
||||
m_area,
|
||||
lineNumber,
|
||||
m_area->getColumnNumberForLocationId(locationId),
|
||||
locationId,
|
||||
{},
|
||||
false,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,27 +128,27 @@ void QtCodeNavigateable::ensurePercentVisibleAnimated(
|
||||
switch (target)
|
||||
{
|
||||
case CodeScrollParams::Target::VISIBLE:
|
||||
{
|
||||
int visibleTop = visibleY + 50;
|
||||
int visibleBottom = visibleY + visibleHeight - 50;
|
||||
|
||||
int scrollTop = scrollY;
|
||||
int scrollBottom = scrollY + rectHeight;
|
||||
|
||||
if (scrollTop < visibleTop)
|
||||
{
|
||||
int visibleTop = visibleY + 50;
|
||||
int visibleBottom = visibleY + visibleHeight - 50;
|
||||
|
||||
int scrollTop = scrollY;
|
||||
int scrollBottom = scrollY + rectHeight;
|
||||
|
||||
if (scrollTop < visibleTop)
|
||||
{
|
||||
scrollY = scrollTop - 50;
|
||||
}
|
||||
else if (scrollBottom > visibleBottom)
|
||||
{
|
||||
scrollY = visibleTop + scrollBottom - visibleBottom;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
scrollY = scrollTop - 50;
|
||||
}
|
||||
break;
|
||||
else if (scrollBottom > visibleBottom)
|
||||
{
|
||||
scrollY = visibleTop + scrollBottom - visibleBottom;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CodeScrollParams::Target::CENTER:
|
||||
if (rectHeight < visibleHeight / 2)
|
||||
|
||||
@@ -562,10 +562,7 @@ void QtCodeNavigator::activateScreenMatch(size_t matchIndex)
|
||||
|
||||
scrollTo(
|
||||
CodeScrollParams::toReference(
|
||||
p.first->getFilePath(),
|
||||
m_activeScreenMatchId,
|
||||
0,
|
||||
CodeScrollParams::Target::CENTER),
|
||||
p.first->getFilePath(), m_activeScreenMatchId, 0, CodeScrollParams::Target::CENTER),
|
||||
true,
|
||||
true);
|
||||
}
|
||||
@@ -619,15 +616,24 @@ void QtCodeNavigator::scrollTo(const CodeScrollParams& params, bool animated, bo
|
||||
case CodeScrollParams::Type::TO_REFERENCE:
|
||||
func = [=]() {
|
||||
m_current->scrollTo(
|
||||
params.filePath, 0, params.locationId, params.scopeLocationId, animated, params.target, focusTarget);
|
||||
params.filePath,
|
||||
0,
|
||||
params.locationId,
|
||||
params.scopeLocationId,
|
||||
animated,
|
||||
params.target,
|
||||
focusTarget);
|
||||
};
|
||||
break;
|
||||
case CodeScrollParams::Type::TO_FILE:
|
||||
func = [=]() { m_current->scrollTo(params.filePath, 0, 0, 0, animated, params.target, focusTarget); };
|
||||
func = [=]() {
|
||||
m_current->scrollTo(params.filePath, 0, 0, 0, animated, params.target, focusTarget);
|
||||
};
|
||||
break;
|
||||
case CodeScrollParams::Type::TO_LINE:
|
||||
func = [=]() {
|
||||
m_current->scrollTo(params.filePath, params.line, 0, 0, animated, params.target, focusTarget);
|
||||
m_current->scrollTo(
|
||||
params.filePath, params.line, 0, 0, animated, params.target, focusTarget);
|
||||
};
|
||||
break;
|
||||
case CodeScrollParams::Type::TO_VALUE:
|
||||
@@ -664,15 +670,26 @@ void QtCodeNavigator::scrollToFocus()
|
||||
|
||||
if (focus.file)
|
||||
{
|
||||
scrollTo(CodeScrollParams::toFile(focus.file->getFilePath(), CodeScrollParams::Target::VISIBLE), true, false);
|
||||
scrollTo(
|
||||
CodeScrollParams::toFile(focus.file->getFilePath(), CodeScrollParams::Target::VISIBLE),
|
||||
true,
|
||||
false);
|
||||
}
|
||||
else if (focus.scopeLine)
|
||||
{
|
||||
scrollTo(CodeScrollParams::toLine(focus.area->getFilePath(), focus.lineNumber, CodeScrollParams::Target::VISIBLE), true, false);
|
||||
scrollTo(
|
||||
CodeScrollParams::toLine(
|
||||
focus.area->getFilePath(), focus.lineNumber, CodeScrollParams::Target::VISIBLE),
|
||||
true,
|
||||
false);
|
||||
}
|
||||
else if (focus.locationId)
|
||||
{
|
||||
scrollTo(CodeScrollParams::toReference(focus.area->getFilePath(), focus.locationId, 0, CodeScrollParams::Target::VISIBLE), true, false);
|
||||
scrollTo(
|
||||
CodeScrollParams::toReference(
|
||||
focus.area->getFilePath(), focus.locationId, 0, CodeScrollParams::Target::VISIBLE),
|
||||
true,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,9 +726,12 @@ void QtCodeNavigator::keyPressEvent(QKeyEvent* event)
|
||||
if (shift)
|
||||
{
|
||||
MessageToNextCodeReference(
|
||||
currentFilePath, currentFocus.lineNumber, currentFocus.columnNumber,
|
||||
direction == CodeFocusHandler::Direction::DOWN || direction == CodeFocusHandler::Direction::RIGHT
|
||||
).dispatch();
|
||||
currentFilePath,
|
||||
currentFocus.lineNumber,
|
||||
currentFocus.columnNumber,
|
||||
direction == CodeFocusHandler::Direction::DOWN ||
|
||||
direction == CodeFocusHandler::Direction::RIGHT)
|
||||
.dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -726,7 +746,8 @@ void QtCodeNavigator::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
QAbstractScrollArea* scrollArea = currentFocus.area;
|
||||
int step = currentFocus.area ? currentFocus.area->lineHeight() * 3 : 50;
|
||||
if (direction == CodeFocusHandler::Direction::DOWN || direction == CodeFocusHandler::Direction::UP)
|
||||
if (direction == CodeFocusHandler::Direction::DOWN ||
|
||||
direction == CodeFocusHandler::Direction::UP)
|
||||
{
|
||||
if (m_mode == MODE_LIST)
|
||||
{
|
||||
|
||||
@@ -22,8 +22,7 @@ void QtListWidget::wheelEvent(QWheelEvent* event)
|
||||
QScrollBar* bar = verticalScrollBar();
|
||||
bool down = event->angleDelta().y() < 0;
|
||||
|
||||
if (bar->minimum() == bar->maximum() ||
|
||||
(down && bar->value() == bar->maximum()) ||
|
||||
if (bar->minimum() == bar->maximum() || (down && bar->value() == bar->maximum()) ||
|
||||
(!down && bar->value() == bar->minimum()))
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
void defocus();
|
||||
|
||||
void focusInitialNode();
|
||||
void focusTokenId(const std::list<QtGraphNode*>& nodes, const std::list<QtGraphEdge*>& edges, Id tokenId);
|
||||
void focusTokenId(
|
||||
const std::list<QtGraphNode*>& nodes, const std::list<QtGraphEdge*>& edges, Id tokenId);
|
||||
void refocusNode(const std::list<QtGraphNode*>& newNodes, Id oldActiveTokenId, Id newActiveTokenId);
|
||||
|
||||
void focusNext(Direction direction, bool navigateEdges);
|
||||
|
||||
@@ -57,7 +57,8 @@ QtGraphicsView::QtGraphicsView(GraphFocusHandler* focusHandler, QWidget* parent)
|
||||
m_zoomLabelTimer = std::make_shared<QTimer>(this);
|
||||
connect(m_zoomLabelTimer.get(), &QTimer::timeout, this, &QtGraphicsView::hideZoomLabel);
|
||||
|
||||
m_openInTabAction = new QAction(QStringLiteral("Open in New Tab (Ctrl + Shift + Left Click)"), this);
|
||||
m_openInTabAction = new QAction(
|
||||
QStringLiteral("Open in New Tab (Ctrl + Shift + Left Click)"), this);
|
||||
#if defined(Q_OS_MAC)
|
||||
m_openInTabAction->setText(QStringLiteral("Open in New Tab (Cmd + Shift + Left Click)"));
|
||||
#endif
|
||||
|
||||
@@ -48,8 +48,7 @@ void QtGraphNodeComponentClickable::nodeMouseReleaseEvent(QGraphicsSceneMouseEve
|
||||
|
||||
if (!m_mouseMoved)
|
||||
{
|
||||
if (
|
||||
event->modifiers() & Qt::ControlModifier && event->modifiers() & Qt::ShiftModifier &&
|
||||
if (event->modifiers() & Qt::ControlModifier && event->modifiers() & Qt::ShiftModifier &&
|
||||
event->button() == Qt::LeftButton)
|
||||
{
|
||||
m_graphNode->onMiddleClick();
|
||||
|
||||
@@ -147,7 +147,9 @@ void QtProjectWizardContent::showFilesDialog(const std::vector<FilePath>& filePa
|
||||
if (!m_filesDialog)
|
||||
{
|
||||
m_filesDialog = new QtTextEditDialog(
|
||||
getFileNamesTitle(), QString::number(filePaths.size()) + " " + getFileNamesDescription(), m_window);
|
||||
getFileNamesTitle(),
|
||||
QString::number(filePaths.size()) + " " + getFileNamesDescription(),
|
||||
m_window);
|
||||
m_filesDialog->setup();
|
||||
|
||||
m_filesDialog->setText(utility::join(utility::toWStrings(filePaths), L"\n"));
|
||||
|
||||
@@ -80,7 +80,8 @@ bool QtProjectWizardContentCustomCommand::check()
|
||||
if (m_customCommand->text().toStdWString().find(L"%{SOURCE_FILE_PATH}") == std::wstring::npos)
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("The variable %{SOURCE_FILE_PATH} is missing in the custom command."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("The variable %{SOURCE_FILE_PATH} is missing in the custom command."));
|
||||
msgBox.exec();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,8 @@ bool QtProjectWizardContentProjectData::check()
|
||||
if (m_projectFileLocation->getText().isEmpty())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("Please define the location for the Sourcetrail project file."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("Please define the location for the Sourcetrail project file."));
|
||||
msgBox.exec();
|
||||
return false;
|
||||
}
|
||||
@@ -128,10 +129,11 @@ bool QtProjectWizardContentProjectData::check()
|
||||
else if (!paths[0].exists())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(
|
||||
QStringLiteral("The specified location does not exist. Do you want to create the directory?"));
|
||||
msgBox.setText(QStringLiteral(
|
||||
"The specified location does not exist. Do you want to create the directory?"));
|
||||
msgBox.addButton(QStringLiteral("Abort"), QMessageBox::ButtonRole::NoRole);
|
||||
QPushButton* createButton = msgBox.addButton(QStringLiteral("Create"), QMessageBox::ButtonRole::YesRole);
|
||||
QPushButton* createButton = msgBox.addButton(
|
||||
QStringLiteral("Create"), QMessageBox::ButtonRole::YesRole);
|
||||
msgBox.setDefaultButton(createButton);
|
||||
msgBox.setIcon(QMessageBox::Icon::Question);
|
||||
int ret = msgBox.exec();
|
||||
|
||||
@@ -8,7 +8,8 @@ class QtProjectWizardContentRequiredLabel: public QtProjectWizardContent
|
||||
public:
|
||||
QtProjectWizardContentRequiredLabel(QtProjectWizardWindow* window)
|
||||
: QtProjectWizardContent(window)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
// QtProjectWizardContent implementation
|
||||
void populate(QGridLayout* layout, int& row) override
|
||||
|
||||
@@ -32,7 +32,10 @@ void QtProjectWizardContentSourceGroupData::populate(QGridLayout* layout, int& r
|
||||
connect(
|
||||
m_status, &QCheckBox::toggled, this, &QtProjectWizardContentSourceGroupData::changedStatus);
|
||||
layout->addWidget(
|
||||
createFormSubLabel(QStringLiteral("Status")), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
|
||||
createFormSubLabel(QStringLiteral("Status")),
|
||||
row,
|
||||
QtProjectWizardWindow::FRONT_COL,
|
||||
Qt::AlignRight);
|
||||
layout->addWidget(m_status, row, QtProjectWizardWindow::BACK_COL);
|
||||
|
||||
addHelpButton(
|
||||
|
||||
@@ -15,16 +15,22 @@ void QtProjectWizardContentVS::populate(QGridLayout* layout, int& row)
|
||||
|
||||
addHelpButton(
|
||||
QStringLiteral("Create Compilation Database"),
|
||||
QStringLiteral("To create a new Compilation Database from a Visual Studio Solution, a Solution has to be open in Visual "
|
||||
"Studio.\n Sourcetrail will call Visual Studio to open the 'Create Compilation Database' dialog. Please follow "
|
||||
"the instructions in Visual Studio to complete the process.\n Note: Sourcetrail's Visual Studio plugin has to "
|
||||
"be installed. Visual Studio has to be running with an eligible Solution, containing C/C++ projects, loaded."),
|
||||
QStringLiteral("To create a new Compilation Database from a Visual Studio Solution, a "
|
||||
"Solution has to be open in Visual "
|
||||
"Studio.\n Sourcetrail will call Visual Studio to open the 'Create "
|
||||
"Compilation Database' dialog. Please follow "
|
||||
"the instructions in Visual Studio to complete the process.\n Note: "
|
||||
"Sourcetrail's Visual Studio plugin has to "
|
||||
"be installed. Visual Studio has to be running with an eligible Solution, "
|
||||
"containing C/C++ projects, loaded."),
|
||||
layout,
|
||||
row);
|
||||
|
||||
QLabel* descriptionLabel = createFormSubLabel(
|
||||
QStringLiteral("Call Visual Studio to create a Compilation Database from the loaded Solution (requires installed "
|
||||
"<a href=\"https://sourcetrail.com/documentation/index.html#VisualStudio\">Sourcetrail Visual Studio "
|
||||
QLabel* descriptionLabel = createFormSubLabel(QStringLiteral(
|
||||
"Call Visual Studio to create a Compilation Database from the loaded Solution (requires "
|
||||
"installed "
|
||||
"<a href=\"https://sourcetrail.com/documentation/index.html#VisualStudio\">Sourcetrail "
|
||||
"Visual Studio "
|
||||
"Extension</a>)."));
|
||||
descriptionLabel->setObjectName(QStringLiteral("description"));
|
||||
descriptionLabel->setOpenExternalLinks(true);
|
||||
|
||||
@@ -57,7 +57,8 @@ bool QtProjectWizardContentPathCxxPch::check()
|
||||
if (!cdb)
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("Unable to open and read the provided compilation database file."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("Unable to open and read the provided compilation database file."));
|
||||
msgBox.exec();
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFramework
|
||||
std::shared_ptr<SourceGroupSettings> settings,
|
||||
QtProjectWizardWindow* window,
|
||||
bool indicateAsAdditional)
|
||||
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
|
||||
: QtProjectWizardContentPaths(
|
||||
settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
|
||||
{
|
||||
setTitleString(
|
||||
indicateAsAdditional ? QStringLiteral("Additional Framework Search Paths")
|
||||
|
||||
+8
-5
@@ -25,7 +25,8 @@ QtProjectWizardContentPathsHeaderSearch::QtProjectWizardContentPathsHeaderSearch
|
||||
std::shared_ptr<SourceGroupSettings> settings,
|
||||
QtProjectWizardWindow* window,
|
||||
bool indicateAsAdditional)
|
||||
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
|
||||
: QtProjectWizardContentPaths(
|
||||
settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
|
||||
, m_showDetectedIncludesResultFunctor(std::bind(
|
||||
&QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult,
|
||||
this,
|
||||
@@ -363,7 +364,8 @@ void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult(
|
||||
("<p>The following <b>" + std::to_string(additionalHeaderSearchPaths.size()) +
|
||||
"</b> include paths have been "
|
||||
"detected and will be added to the include paths of this Source Group.<b>")
|
||||
.c_str(), m_window);
|
||||
.c_str(),
|
||||
m_window);
|
||||
|
||||
m_filesDialog->setup();
|
||||
m_filesDialog->setReadOnly(true);
|
||||
@@ -392,8 +394,8 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(
|
||||
if (unresolvedIncludes.empty())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(
|
||||
QStringLiteral("<p>All include directives throughout the indexed files have been resolved.</p>"));
|
||||
msgBox.setText(QStringLiteral(
|
||||
"<p>All include directives throughout the indexed files have been resolved.</p>"));
|
||||
msgBox.exec();
|
||||
}
|
||||
else
|
||||
@@ -428,7 +430,8 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(
|
||||
"conditional preprocessor "
|
||||
"directives. This means that some of the unresolved includes may actually not be "
|
||||
"required by the indexer.</p>")
|
||||
.c_str(), m_window);
|
||||
.c_str(),
|
||||
m_window);
|
||||
|
||||
m_filesDialog->setup();
|
||||
m_filesDialog->setCloseVisible(false);
|
||||
|
||||
+12
-6
@@ -166,11 +166,13 @@ bool QtProjectWizardContentPathsIndexedHeaders::check()
|
||||
if (m_list->getPathsAsDisplayed().empty())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("You didn't specify any Header Files & Directories to Index."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("You didn't specify any Header Files & Directories to Index."));
|
||||
msgBox.setInformativeText(QString::fromStdString(
|
||||
"Sourcetrail will only index the source files listed in the " + m_projectKindName +
|
||||
" file and none of the included header files."));
|
||||
QPushButton* yesButton = msgBox.addButton(QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
|
||||
QPushButton* yesButton = msgBox.addButton(
|
||||
QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
|
||||
msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::NoRole);
|
||||
msgBox.setDefaultButton(yesButton);
|
||||
|
||||
@@ -197,7 +199,8 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
|
||||
if (!codeblocksProjectPath.exists())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("The provided Code::Blocks project path does not exist."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("The provided Code::Blocks project path does not exist."));
|
||||
msgBox.setDetailedText(QString::fromStdWString(codeblocksProjectPath.wstr()));
|
||||
msgBox.exec();
|
||||
return;
|
||||
@@ -207,7 +210,8 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
|
||||
"Select from Include Paths",
|
||||
"The list contains all Include Paths found in the Code::Blocks project. Red paths "
|
||||
"do not exist. Select the "
|
||||
"paths containing the header files you want to index with Sourcetrail.", m_window);
|
||||
"paths containing the header files you want to index with Sourcetrail.",
|
||||
m_window);
|
||||
m_filesDialog->setup();
|
||||
|
||||
connect(
|
||||
@@ -241,7 +245,8 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
|
||||
if (!cdbPath.exists())
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("The provided Compilation Database path does not exist."));
|
||||
msgBox.setText(
|
||||
QStringLiteral("The provided Compilation Database path does not exist."));
|
||||
msgBox.setDetailedText(QString::fromStdWString(cdbPath.wstr()));
|
||||
msgBox.exec();
|
||||
return;
|
||||
@@ -251,7 +256,8 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
|
||||
"Select from Include Paths",
|
||||
"The list contains all Include Paths found in the Compilation Database. Red paths "
|
||||
"do not exist. Select the "
|
||||
"paths containing the header files you want to index with Sourcetrail.", m_window);
|
||||
"paths containing the header files you want to index with Sourcetrail.",
|
||||
m_window);
|
||||
m_filesDialog->setup();
|
||||
|
||||
connect(
|
||||
|
||||
@@ -72,10 +72,12 @@ bool QtProjectWizardContentPathsSource::check()
|
||||
{
|
||||
QMessageBox msgBox(m_window);
|
||||
msgBox.setText(QStringLiteral("You didn't specify any 'Files & Directories to Index'."));
|
||||
msgBox.setInformativeText(QStringLiteral(
|
||||
"Sourcetrail will not index any files for this Source Group. Please add paths to files or directories "
|
||||
"that should be indexed."));
|
||||
QPushButton* yesButton = msgBox.addButton(QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
|
||||
msgBox.setInformativeText(
|
||||
QStringLiteral("Sourcetrail will not index any files for this Source Group. Please add "
|
||||
"paths to files or directories "
|
||||
"that should be indexed."));
|
||||
QPushButton* yesButton = msgBox.addButton(
|
||||
QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
|
||||
msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::NoRole);
|
||||
msgBox.setDefaultButton(yesButton);
|
||||
|
||||
|
||||
@@ -44,14 +44,15 @@ std::string QtHighlighter::highlightTypeToString(QtHighlighter::HighlightType ty
|
||||
|
||||
QtHighlighter::HighlightType QtHighlighter::highlightTypeFromString(const std::string& typeStr)
|
||||
{
|
||||
const std::array<HighlightType, 8> types = {HighlightType::COMMENT,
|
||||
HighlightType::DIRECTIVE,
|
||||
HighlightType::FUNCTION,
|
||||
HighlightType::KEYWORD,
|
||||
HighlightType::NUMBER,
|
||||
HighlightType::QUOTATION,
|
||||
HighlightType::TEXT,
|
||||
HighlightType::TYPE};
|
||||
const std::array<HighlightType, 8> types = {
|
||||
HighlightType::COMMENT,
|
||||
HighlightType::DIRECTIVE,
|
||||
HighlightType::FUNCTION,
|
||||
HighlightType::KEYWORD,
|
||||
HighlightType::NUMBER,
|
||||
HighlightType::QUOTATION,
|
||||
HighlightType::TEXT,
|
||||
HighlightType::TYPE};
|
||||
|
||||
for (HighlightType type: types)
|
||||
{
|
||||
@@ -68,14 +69,15 @@ void QtHighlighter::loadHighlightingRules()
|
||||
{
|
||||
ColorScheme* scheme = ColorScheme::getInstance().get();
|
||||
|
||||
const std::array<HighlightType, 8> types = {HighlightType::COMMENT,
|
||||
HighlightType::DIRECTIVE,
|
||||
HighlightType::FUNCTION,
|
||||
HighlightType::KEYWORD,
|
||||
HighlightType::NUMBER,
|
||||
HighlightType::QUOTATION,
|
||||
HighlightType::TEXT,
|
||||
HighlightType::TYPE};
|
||||
const std::array<HighlightType, 8> types = {
|
||||
HighlightType::COMMENT,
|
||||
HighlightType::DIRECTIVE,
|
||||
HighlightType::FUNCTION,
|
||||
HighlightType::KEYWORD,
|
||||
HighlightType::NUMBER,
|
||||
HighlightType::QUOTATION,
|
||||
HighlightType::TEXT,
|
||||
HighlightType::TYPE};
|
||||
|
||||
s_charFormats.clear();
|
||||
for (HighlightType type: types)
|
||||
|
||||
@@ -15,8 +15,8 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout): CodeView(viewLayout)
|
||||
{
|
||||
m_widget = new QtCodeNavigator();
|
||||
|
||||
m_widget->connect(m_widget, &QtCodeNavigator::focusIn, [this](){ setNavigationFocus(true); });
|
||||
m_widget->connect(m_widget, &QtCodeNavigator::focusOut, [this](){ setNavigationFocus(false); });
|
||||
m_widget->connect(m_widget, &QtCodeNavigator::focusIn, [this]() { setNavigationFocus(true); });
|
||||
m_widget->connect(m_widget, &QtCodeNavigator::focusOut, [this]() { setNavigationFocus(false); });
|
||||
}
|
||||
|
||||
void QtCodeView::createWidgetWrapper()
|
||||
|
||||
@@ -69,6 +69,7 @@ void QtCompositeView::showFocusIndicator(bool focus)
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
const std::string& colorName = focus ? "window/focus" : "search/background";
|
||||
utility::setWidgetBackgroundColor(m_focusIndicator, ColorScheme::getInstance()->getColor(colorName));
|
||||
utility::setWidgetBackgroundColor(
|
||||
m_focusIndicator, ColorScheme::getInstance()->getColor(colorName));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ class QWidget;
|
||||
class QtCompositeView: public CompositeView
|
||||
{
|
||||
public:
|
||||
QtCompositeView(ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId);
|
||||
QtCompositeView(
|
||||
ViewLayout* viewLayout, CompositeDirection direction, const std::string& name, Id tabId);
|
||||
~QtCompositeView() = default;
|
||||
|
||||
// View implementation
|
||||
|
||||
@@ -67,8 +67,8 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
|
||||
|
||||
connect(view, &QtGraphicsView::emptySpaceClicked, this, &QtGraphView::clickedInEmptySpace);
|
||||
connect(view, &QtGraphicsView::resized, this, &QtGraphView::resized);
|
||||
connect(view, &QtGraphicsView::focusIn, [this](){ setNavigationFocus(true); });
|
||||
connect(view, &QtGraphicsView::focusOut, [this](){ setNavigationFocus(false); });
|
||||
connect(view, &QtGraphicsView::focusIn, [this]() { setNavigationFocus(true); });
|
||||
connect(view, &QtGraphicsView::focusOut, [this]() { setNavigationFocus(false); });
|
||||
|
||||
m_scrollSpeedChangeListenerHorizontal.setScrollBar(view->horizontalScrollBar());
|
||||
m_scrollSpeedChangeListenerVertical.setScrollBar(view->verticalScrollBar());
|
||||
@@ -1056,7 +1056,8 @@ QtGraphNode* QtGraphView::createNodeRecursive(
|
||||
}
|
||||
else if (node->isExpandToggleNode())
|
||||
{
|
||||
newNode = new QtGraphNodeExpandToggle(node->isExpanded(), static_cast<int>(node->invisibleSubNodeCount));
|
||||
newNode = new QtGraphNodeExpandToggle(
|
||||
node->isExpanded(), static_cast<int>(node->invisibleSubNodeCount));
|
||||
}
|
||||
else if (node->isBundleNode())
|
||||
{
|
||||
|
||||
@@ -28,7 +28,10 @@ std::shared_ptr<MainView> QtViewFactory::createMainView(StorageAccess* storageAc
|
||||
}
|
||||
|
||||
std::shared_ptr<CompositeView> QtViewFactory::createCompositeView(
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name, const Id tabId) const
|
||||
ViewLayout* viewLayout,
|
||||
CompositeView::CompositeDirection direction,
|
||||
const std::string& name,
|
||||
const Id tabId) const
|
||||
{
|
||||
return View::createAndAddToLayout<QtCompositeView>(viewLayout, direction, name, tabId);
|
||||
}
|
||||
|
||||
@@ -36,9 +36,13 @@ private:
|
||||
const QString shortcut;
|
||||
|
||||
Shortcut(const QString& name, const QString& shortcut);
|
||||
static Shortcut defaultOrMac(const QString& name, const QString& defaultShortcut, const QString& macShortcut);
|
||||
static Shortcut defaultOrMac(
|
||||
const QString& name, const QString& defaultShortcut, const QString& macShortcut);
|
||||
static Shortcut winMacOrLinux(
|
||||
const QString& name, const QString& winShortcut, const QString& macShortcut, const QString& linuxShortcut);
|
||||
const QString& name,
|
||||
const QString& winShortcut,
|
||||
const QString& macShortcut,
|
||||
const QString& linuxShortcut);
|
||||
};
|
||||
|
||||
QtShortcutTable* createTableWidget(const std::string& objectName);
|
||||
|
||||
@@ -758,7 +758,8 @@ void QtMainWindow::updateRecentProjectsMenu()
|
||||
{
|
||||
m_recentProjectsMenu->clear();
|
||||
|
||||
const std::vector<FilePath> recentProjects = ApplicationSettings::getInstance()->getRecentProjects();
|
||||
const std::vector<FilePath> recentProjects =
|
||||
ApplicationSettings::getInstance()->getRecentProjects();
|
||||
const size_t recentProjectsCount = ApplicationSettings::getInstance()->getMaxRecentProjectsCount();
|
||||
|
||||
for (size_t i = 0; i < recentProjects.size() && i < recentProjectsCount; ++i)
|
||||
|
||||
@@ -63,8 +63,8 @@ void JavaEnvironmentFactory::createInstance(std::string classPath, std::string&
|
||||
// options[3].optionString = const_cast<char*>("-Dcom.sun.management.jmxremote.port=9010");
|
||||
// options[4].optionString =
|
||||
// const_cast<char*>("-Dcom.sun.management.jmxremote.local.only=false"); options[5].optionString
|
||||
// = const_cast<char*>("-Dcom.sun.management.jmxremote.authenticate=false"); options[6].optionString
|
||||
// = const_cast<char*>("-Dcom.sun.management.jmxremote.ssl=false");
|
||||
// = const_cast<char*>("-Dcom.sun.management.jmxremote.authenticate=false");
|
||||
// options[6].optionString = const_cast<char*>("-Dcom.sun.management.jmxremote.ssl=false");
|
||||
|
||||
vm_args.version = JNI_VERSION_1_8;
|
||||
vm_args.nOptions = optionCount;
|
||||
|
||||
@@ -56,7 +56,8 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupPythonEmpty::getIndexerC
|
||||
|
||||
if (!m_settings->getEnvironmentPath().empty())
|
||||
{
|
||||
args += L" --environment-path=\"" + m_settings->getEnvironmentPathExpandedAndAbsolute().wstr() + L"\"";
|
||||
args += L" --environment-path=\"" +
|
||||
m_settings->getEnvironmentPathExpandedAndAbsolute().wstr() + L"\"";
|
||||
}
|
||||
|
||||
if (ApplicationSettings::getInstance()->getVerboseIndexerLoggingEnabled())
|
||||
|
||||
+29
-139
@@ -142,11 +142,7 @@ TEST_CASE("token copies components when token is copied")
|
||||
|
||||
TEST_CASE("nodes are nodes")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
|
||||
REQUIRE(a.isNode());
|
||||
REQUIRE(!a.isEdge());
|
||||
@@ -154,16 +150,8 @@ TEST_CASE("nodes are nodes")
|
||||
|
||||
TEST_CASE("edges are edges")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(3, Edge::EDGE_USAGE, &a, &b);
|
||||
|
||||
REQUIRE(!e.isNode());
|
||||
@@ -172,43 +160,27 @@ TEST_CASE("edges are edges")
|
||||
|
||||
TEST_CASE("set type of node from constructor")
|
||||
{
|
||||
Node n(
|
||||
1,
|
||||
NodeType(NODE_FUNCTION),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node n(1, NodeType(NODE_FUNCTION), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
REQUIRE(NodeType(NODE_FUNCTION) == n.getType());
|
||||
}
|
||||
|
||||
TEST_CASE("set type of node from non indexed")
|
||||
{
|
||||
Node n(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node n(2, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
n.setType(NodeType(NODE_CLASS));
|
||||
REQUIRE(NodeType(NODE_CLASS) == n.getType());
|
||||
}
|
||||
|
||||
TEST_CASE("can not change type of node after it was set")
|
||||
{
|
||||
Node n(
|
||||
3,
|
||||
NodeType(NODE_NAMESPACE),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node n(3, NodeType(NODE_NAMESPACE), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
n.setType(NodeType(NODE_CLASS));
|
||||
REQUIRE(NodeType(NODE_CLASS) != n.getType());
|
||||
}
|
||||
|
||||
TEST_CASE("node can be copied and keeps same id")
|
||||
{
|
||||
Node n(
|
||||
4,
|
||||
NodeType(NODE_NAMESPACE),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node n(4, NodeType(NODE_NAMESPACE), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node n2(n);
|
||||
|
||||
REQUIRE(&n != &n2);
|
||||
@@ -219,27 +191,15 @@ TEST_CASE("node can be copied and keeps same id")
|
||||
|
||||
TEST_CASE("node type bit masking")
|
||||
{
|
||||
Node n(
|
||||
1,
|
||||
NodeType(NODE_NAMESPACE),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node n(1, NodeType(NODE_NAMESPACE), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
REQUIRE(n.isType(NODE_FUNCTION | NODE_NAMESPACE | NODE_CLASS));
|
||||
REQUIRE(!n.isType(NODE_FUNCTION | NODE_METHOD | NODE_CLASS));
|
||||
}
|
||||
|
||||
TEST_CASE("get type of edges")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(3, Edge::EDGE_USAGE, &a, &b);
|
||||
|
||||
REQUIRE(Edge::EDGE_USAGE == e.getType());
|
||||
@@ -247,16 +207,8 @@ TEST_CASE("get type of edges")
|
||||
|
||||
TEST_CASE("edge can be copied and keeps same id")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(3, Edge::EDGE_USAGE, &a, &b);
|
||||
Edge e2(e, &a, &b);
|
||||
|
||||
@@ -267,16 +219,8 @@ TEST_CASE("edge can be copied and keeps same id")
|
||||
|
||||
TEST_CASE("edge type bit masking")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(3, Edge::EDGE_USAGE, &a, &b);
|
||||
|
||||
REQUIRE(e.isType(Edge::EDGE_MEMBER | Edge::EDGE_CALL | Edge::EDGE_USAGE));
|
||||
@@ -285,21 +229,9 @@ TEST_CASE("edge type bit masking")
|
||||
|
||||
TEST_CASE("node finds child node")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node c(
|
||||
3,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"C", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node c(3, NodeType(NODE_SYMBOL), NameHierarchy(L"C", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(4, Edge::EDGE_MEMBER, &a, &b);
|
||||
Edge e2(5, Edge::EDGE_MEMBER, &a, &c);
|
||||
|
||||
@@ -311,21 +243,9 @@ TEST_CASE("node finds child node")
|
||||
|
||||
TEST_CASE("node can not find child node")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node c(
|
||||
3,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"C", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node c(3, NodeType(NODE_SYMBOL), NameHierarchy(L"C", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(4, Edge::EDGE_MEMBER, &a, &b);
|
||||
Edge e2(5, Edge::EDGE_MEMBER, &a, &c);
|
||||
|
||||
@@ -336,21 +256,9 @@ TEST_CASE("node can not find child node")
|
||||
|
||||
TEST_CASE("node visits child nodes")
|
||||
{
|
||||
Node a(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node b(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node c(
|
||||
3,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"C", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
Node a(1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node b(2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node c(3, NodeType(NODE_SYMBOL), NameHierarchy(L"C", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Edge e(4, Edge::EDGE_MEMBER, &a, &b);
|
||||
Edge e2(5, Edge::EDGE_MEMBER, &a, &c);
|
||||
|
||||
@@ -366,15 +274,9 @@ TEST_CASE("graph saves nodes")
|
||||
{
|
||||
Graph graph;
|
||||
Node* a = graph.createNode(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node* b = graph.createNode(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
|
||||
REQUIRE(2 == graph.getNodeCount());
|
||||
REQUIRE(0 == graph.getEdgeCount());
|
||||
@@ -393,15 +295,9 @@ TEST_CASE("graph saves edges")
|
||||
Graph graph;
|
||||
|
||||
Node* a = graph.createNode(
|
||||
1,
|
||||
NodeType(NODE_FUNCTION),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
1, NodeType(NODE_FUNCTION), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
Node* b = graph.createNode(
|
||||
2,
|
||||
NodeType(NODE_FUNCTION),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
2, NodeType(NODE_FUNCTION), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
|
||||
Edge* e = graph.createEdge(3, Edge::EDGE_CALL, a, b);
|
||||
|
||||
@@ -417,15 +313,9 @@ TEST_CASE("graph removes nodes")
|
||||
Graph graph;
|
||||
|
||||
Node* a = graph.createNode(
|
||||
1,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"A", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
1, NodeType(NODE_SYMBOL), NameHierarchy(L"A", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
graph.createNode(
|
||||
2,
|
||||
NodeType(NODE_SYMBOL),
|
||||
NameHierarchy(L"B", NAME_DELIMITER_CXX),
|
||||
DEFINITION_EXPLICIT);
|
||||
2, NodeType(NODE_SYMBOL), NameHierarchy(L"B", NAME_DELIMITER_CXX), DEFINITION_EXPLICIT);
|
||||
|
||||
REQUIRE(2 == graph.getNodeCount());
|
||||
REQUIRE(0 == graph.getEdgeCount());
|
||||
|
||||
@@ -311,8 +311,9 @@ TEST_CASE("caseInsensitiveLess should return false when both wstrings are equal"
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_cd!", L"ab_cd!"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return false when both wstrings have"
|
||||
"different cases but after lower casing are equal")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return false when both wstrings have"
|
||||
"different cases but after lower casing are equal")
|
||||
{
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_CD!", L"aB_cD!"));
|
||||
}
|
||||
@@ -337,32 +338,44 @@ TEST_CASE("caseInsensitiveLess should return false when second wstring is prefix
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_cd!e", L"ab_cd!"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return true when after lower casing first wstring, first is prefix of second")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return true when after lower casing first wstring, first is prefix "
|
||||
"of second")
|
||||
{
|
||||
REQUIRE(utility::caseInsensitiveLess(L"aB_cd!", L"ab_cd!e"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return true when after lower casing second wstring, first is prefix of second")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return true when after lower casing second wstring, first is "
|
||||
"prefix of second")
|
||||
{
|
||||
REQUIRE(utility::caseInsensitiveLess(L"ab_cd!", L"ab_cD!e"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return true when after lower casing both wstrings, first is prefix of second")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return true when after lower casing both wstrings, first is prefix "
|
||||
"of second")
|
||||
{
|
||||
REQUIRE(utility::caseInsensitiveLess(L"aB_cd!", L"ab_cD!E"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return false when after lower casing first wstring, second is prefix of first")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return false when after lower casing first wstring, second is "
|
||||
"prefix of first")
|
||||
{
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_Cd!e", L"ab_cd!"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return false when after lower casing second wstring, second is prefix of first")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return false when after lower casing second wstring, second is "
|
||||
"prefix of first")
|
||||
{
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_cd!e", L"Ab_cd!"));
|
||||
}
|
||||
|
||||
TEST_CASE("caseInsensitiveLess should return false when after lower casing both wstrings, second is prefix of first")
|
||||
TEST_CASE(
|
||||
"caseInsensitiveLess should return false when after lower casing both wstrings, second is "
|
||||
"prefix of first")
|
||||
{
|
||||
REQUIRE_FALSE(utility::caseInsensitiveLess(L"ab_cD!E", L"aB_cd!"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user