logic: Show overview of analyzed symbols after launch
* show analysed nodes as bundles in graph * ellide node names longer than 50 chars * sort nodes alphabetic in these bundles * show stats of analysis in code * error are displayed as well in overview * added keywords overview and error * project description can be set in .coatiproject file * description can include links to symbols using [symbol] syntax * updated documentation * increased toc nesting in documentation
This commit is contained in:
@@ -105,7 +105,7 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
|
||||
QColor color("#FFFFFF");
|
||||
|
||||
Node::NodeType nodeType = static_cast<Node::NodeType>(index.sibling(index.row(), index.column() + 3).data().toInt());
|
||||
if (type.size())
|
||||
if (type.size() && type != "command")
|
||||
{
|
||||
color = QColor(GraphViewStyle::getNodeColor(Node::getTypeString(nodeType), false).fill.c_str());
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <qscrollbar.h>
|
||||
|
||||
#include "utility/messaging/type/MessageActivateTokenLocations.h"
|
||||
#include "utility/messaging/type/MessageActivateTokenIds.h"
|
||||
#include "utility/messaging/type/MessageShowFile.h"
|
||||
#include "utility/messaging/type/MessageFocusIn.h"
|
||||
#include "utility/messaging/type/MessageFocusOut.h"
|
||||
@@ -369,21 +370,41 @@ void QtCodeArea::mouseReleaseEvent(QMouseEvent* event)
|
||||
m_eventPosition = event->pos();
|
||||
setIDECursorPosition();
|
||||
}
|
||||
else
|
||||
else if (!m_fileWidget->getErrorMessages().size())
|
||||
{
|
||||
QTextCursor cursor = this->cursorForPosition(event->pos());
|
||||
std::vector<Id> locationIds = findLocationIdsForPosition(cursor.position());
|
||||
if (locationIds.size() && !m_fileWidget->getErrorMessages().size())
|
||||
std::vector<const Annotation*> annotations = getAnnotationsForPosition(cursor.position());
|
||||
|
||||
std::vector<Id> locationIds;
|
||||
std::vector<Id> tokenIds;
|
||||
|
||||
for (const Annotation* annotation : annotations)
|
||||
{
|
||||
if (annotation->locationId > 0)
|
||||
{
|
||||
locationIds.push_back(annotation->locationId);
|
||||
}
|
||||
if (annotation->tokenId > 0)
|
||||
{
|
||||
tokenIds.push_back(annotation->tokenId);
|
||||
}
|
||||
}
|
||||
|
||||
if (locationIds.size())
|
||||
{
|
||||
MessageActivateTokenLocations(locationIds).dispatch();
|
||||
}
|
||||
else if (tokenIds.size())
|
||||
{
|
||||
MessageActivateTokenIds(tokenIds).dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QtCodeArea::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
if (event->button() == Qt::LeftButton && m_fileWidget->getFilePath().str().size())
|
||||
{
|
||||
MessageShowFile(m_fileWidget->getFilePath().str(), (m_fileWidget->getErrorMessages().size() > 0)).dispatch();
|
||||
}
|
||||
@@ -482,21 +503,6 @@ void QtCodeArea::setIDECursorPosition()
|
||||
MessageMoveIDECursor(m_locationFile->getFilePath().str(), lineColumn.first, lineColumn.second).dispatch();
|
||||
}
|
||||
|
||||
std::vector<Id> QtCodeArea::findLocationIdsForPosition(int pos) const
|
||||
{
|
||||
std::vector<Id> locationIds;
|
||||
|
||||
for (const Annotation& annotation : m_annotations)
|
||||
{
|
||||
if (!annotation.isScope && pos >= annotation.start && pos <= annotation.end)
|
||||
{
|
||||
locationIds.push_back(annotation.locationId);
|
||||
}
|
||||
}
|
||||
|
||||
return locationIds;
|
||||
}
|
||||
|
||||
std::vector<const QtCodeArea::Annotation*> QtCodeArea::getAnnotationsForPosition(int pos) const
|
||||
{
|
||||
std::vector<const QtCodeArea::Annotation*> annotations;
|
||||
|
||||
@@ -134,7 +134,6 @@ private:
|
||||
std::string fill;
|
||||
};
|
||||
|
||||
std::vector<Id> findLocationIdsForPosition(int pos) const;
|
||||
std::vector<const Annotation*> getAnnotationsForPosition(int pos) const;
|
||||
|
||||
void createAnnotations(std::shared_ptr<TokenLocationFile> locationFile);
|
||||
|
||||
@@ -57,6 +57,11 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeFileList* parent)
|
||||
|
||||
titleLayout->addWidget(m_title);
|
||||
|
||||
if (m_title->text().size() == 0)
|
||||
{
|
||||
m_title->hide();
|
||||
}
|
||||
|
||||
m_titleBar->setMinimumHeight(m_title->height() + 4);
|
||||
|
||||
m_referenceCount = new QLabel(this);
|
||||
|
||||
@@ -324,7 +324,7 @@ std::shared_ptr<QtGraphNode> QtGraphView::createNodeRecursive(
|
||||
std::shared_ptr<QtGraphNode> newNode;
|
||||
if (node.isGraphNode())
|
||||
{
|
||||
newNode = std::make_shared<QtGraphNodeData>(node.data, node.hasParent, node.childVisible);
|
||||
newNode = std::make_shared<QtGraphNodeData>(node.data, node.name, node.hasParent, node.childVisible);
|
||||
}
|
||||
else if (node.isAccessNode())
|
||||
{
|
||||
|
||||
@@ -7,20 +7,13 @@
|
||||
|
||||
#include "data/graph/token_component/TokenComponentSignature.h"
|
||||
|
||||
QtGraphNodeData::QtGraphNodeData(const Node* data, bool hasParent, bool childVisible)
|
||||
QtGraphNodeData::QtGraphNodeData(const Node* data, const std::string& name, bool hasParent, bool childVisible)
|
||||
: m_data(data)
|
||||
, m_childVisible(childVisible)
|
||||
{
|
||||
this->setAcceptHoverEvents(true);
|
||||
|
||||
if (!hasParent)
|
||||
{
|
||||
this->setName(data->getFullName());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setName(data->getName());
|
||||
}
|
||||
this->setName(name);
|
||||
|
||||
std::string toolTip = data->getTypeString();
|
||||
if (!data->isDefined() && !data->isType(Node::NODE_UNDEFINED))
|
||||
|
||||
@@ -7,7 +7,7 @@ class QtGraphNodeData
|
||||
: public QtGraphNode
|
||||
{
|
||||
public:
|
||||
QtGraphNodeData(const Node* data, bool hasParent, bool childVisible);
|
||||
QtGraphNodeData(const Node* data, const std::string& name, bool hasParent, bool childVisible);
|
||||
virtual ~QtGraphNodeData();
|
||||
|
||||
const Node* getData() const;
|
||||
|
||||
Reference in New Issue
Block a user