From 44e7047450276bf4d2c3f60aea3dc4b436374992 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 11 May 2021 10:49:14 +0200 Subject: Editor: Allow defining custom snippet parser function Task-number: QTCREATORBUG-22406 Change-Id: I21ae9740d348d4e0869029343d51b70f9df9cdac Reviewed-by: Christian Stenger --- src/plugins/texteditor/snippets/snippet.h | 39 +------------------------------ 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'src/plugins/texteditor/snippets/snippet.h') diff --git a/src/plugins/texteditor/snippets/snippet.h b/src/plugins/texteditor/snippets/snippet.h index 8334a66a49..a75b3a297e 100644 --- a/src/plugins/texteditor/snippets/snippet.h +++ b/src/plugins/texteditor/snippets/snippet.h @@ -27,8 +27,7 @@ #include -#include -#include +#include "snippetparser.h" #include #include @@ -37,42 +36,6 @@ namespace TextEditor { -class TEXTEDITOR_EXPORT NameMangler -{ -public: - virtual ~NameMangler(); - - virtual Utils::Id id() const = 0; - virtual QString mangle(const QString &unmangled) const = 0; -}; - -class TEXTEDITOR_EXPORT ParsedSnippet -{ -public: - class Part { - public: - Part() = default; - explicit Part(const QString &text) : text(text) {} - QString text; - int variableIndex = -1; // if variable index is >= 0 the text is interpreted as a variable - NameMangler *mangler = nullptr; - }; - QList parts; - QList> variables; -}; - -class TEXTEDITOR_EXPORT SnippetParseError -{ -public: - QString errorMessage; - QString text; - int pos; - - QString htmlMessage() const; -}; - -using SnippetParseResult = Utils::variant; - class TEXTEDITOR_EXPORT Snippet { Q_DECLARE_TR_FUNCTIONS(Snippet) -- cgit v1.2.1