diff options
author | David Schulz <david.schulz@qt.io> | 2021-04-16 12:30:47 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2021-05-03 11:12:34 +0000 |
commit | a2dadb3d0bf4f8850cc0dacc34ddc58fd9f2ef35 (patch) | |
tree | 9655572acc562676c4de170fd987d2bff9dfac9b /src/plugins/texteditor/texteditoroverlay.h | |
parent | 4890902abfb9d0063593091972a77d754bb60efc (diff) |
TextEditor: Snippet ranges refactoring
Parsed snippets are now reported in chunks of texts and variables. A
variable has a index that can be used to identify matching variables and
maybe a mangler that can be used to modify the variable when applying
the snippet.
This effictively moves the variable matching logic from the overlay to
the parser of the snippet, which is needed to implement the LSP snippet
parser.
Task-number: QTCREATORBUG-22406
Change-Id: I6999554c6c6d0f1887c98bf732473f01aa1f230c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoroverlay.h')
-rw-r--r-- | src/plugins/texteditor/texteditoroverlay.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h index e995f007c5..d87a0fe7aa 100644 --- a/src/plugins/texteditor/texteditoroverlay.h +++ b/src/plugins/texteditor/texteditoroverlay.h @@ -92,14 +92,11 @@ public: inline int dropShadowWidth() const { return m_dropShadowWidth; } - bool hasCursorInSelection(const QTextCursor &cursor) const; - bool hasFirstSelectionBeginMoved() const; protected: - int selectionIndexForCursor(const QTextCursor &cursor) const; - QString selectionText(int selectionIndex) const; - QTextCursor assembleCursorForSelection(int selectionIndex) const; + QTextCursor cursorForSelection(const OverlaySelection &selection) const; + QTextCursor cursorForIndex(int selectionIndex) const; private: QPainterPath createSelectionPath(const QTextCursor &begin, const QTextCursor &end, const QRect& clip); |