forked from qt-creator/qt-creator
Editor: Allow defining custom snippet parser function
Task-number: QTCREATORBUG-22406 Change-Id: I21ae9740d348d4e0869029343d51b70f9df9cdac Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -2720,9 +2720,11 @@ public:
|
||||
QTextCursor cursor;
|
||||
};
|
||||
|
||||
void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, const QString &snippet)
|
||||
void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg,
|
||||
const QString &snippet,
|
||||
const SnippetParser &parse)
|
||||
{
|
||||
SnippetParseResult result = Snippet::parse(snippet);
|
||||
SnippetParseResult result = parse(snippet);
|
||||
if (Utils::holds_alternative<SnippetParseError>(result)) {
|
||||
const auto &error = Utils::get<SnippetParseError>(result);
|
||||
QMessageBox::warning(this, tr("Snippet Parse Error"), error.htmlMessage());
|
||||
|
||||
Reference in New Issue
Block a user