ui/logic/data: show parse errors in CodeView
This change saves the errors while parsing in the Storage and displays them in the CodeView. The error messages can be read in the tooltip on hovering. The error count is visible in the status bar.
This commit is contained in:
@@ -11,8 +11,10 @@ class QPaintEvent;
|
||||
class QPushButton;
|
||||
class QResizeEvent;
|
||||
class QSize;
|
||||
class QtCodeFile;
|
||||
class QtHighlighter;
|
||||
class QWidget;
|
||||
class TokenLocation;
|
||||
class TokenLocationFile;
|
||||
|
||||
class QtCodeSnippet: public QPlainTextEdit
|
||||
@@ -39,8 +41,7 @@ public:
|
||||
uint startLineNumber,
|
||||
const std::string& code,
|
||||
const TokenLocationFile& locationFile,
|
||||
const std::vector<Id>& activeTokenIds,
|
||||
QWidget *parent = 0
|
||||
QtCodeFile* parent
|
||||
);
|
||||
virtual ~QtCodeSnippet();
|
||||
|
||||
@@ -53,19 +54,20 @@ public:
|
||||
int lineNumberAreaWidth() const;
|
||||
void updateLineNumberAreaWidthForDigits(int digits);
|
||||
|
||||
void setActiveTokenIds(const std::vector<Id>& activeTokenIds);
|
||||
void update();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
virtual void showEvent(QShowEvent* event);
|
||||
virtual void enterEvent(QEvent* event);
|
||||
virtual void leaveEvent(QEvent* event);
|
||||
virtual void mouseReleaseEvent(QMouseEvent* event);
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
virtual void mouseMoveEvent(QMouseEvent* event);
|
||||
|
||||
private slots:
|
||||
void updateLineNumberAreaWidth(int newBlockCount);
|
||||
void updateLineNumberArea(const QRect &, int);
|
||||
void clickedTokenLocation();
|
||||
void clickedMaximizeButton();
|
||||
void clearSelection();
|
||||
|
||||
@@ -79,24 +81,28 @@ private:
|
||||
bool isScope;
|
||||
};
|
||||
|
||||
const Annotation* findAnnotationForPosition(int pos) const;
|
||||
void createAnnotations(const TokenLocationFile& locationFile);
|
||||
void annotateText();
|
||||
|
||||
bool locationBelongsToSnippet(TokenLocation* location) const;
|
||||
|
||||
int toTextEditPosition(int lineNumber, int columnNumber) const;
|
||||
int startTextEditPosition() const;
|
||||
int endTextEditPosition() const;
|
||||
|
||||
QtCodeFile* m_parent;
|
||||
|
||||
QWidget* m_lineNumberArea;
|
||||
QtHighlighter* m_highlighter;
|
||||
|
||||
QPushButton* m_maximizeButton;
|
||||
bool m_showMaximizeButton;
|
||||
|
||||
const uint m_startLineNumber;
|
||||
const std::string m_filePath;
|
||||
std::vector<Id> m_activeTokenIds;
|
||||
|
||||
std::vector<Annotation> m_annotations;
|
||||
const Annotation* m_hoveredAnnotation;
|
||||
|
||||
int m_digits;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user