KTextEditor
codecompletionmodelcontrollerinterface.cpp
24bool CodeCompletionModelControllerInterface::shouldStartCompletion(View *view, const QString &insertedText, bool userInsertion, const Cursor &position)
33 if ((userInsertion && (lastChar.isLetter() || lastChar.isNumber() || lastChar == QLatin1Char('_'))) || lastChar == QLatin1Char('.')
48 static constexpr auto options = QRegularExpression::UseUnicodePropertiesOption | QRegularExpression::DontCaptureOption;
74Range CodeCompletionModelControllerInterface::updateCompletionRange(View *view, const Range &range)
91bool CodeCompletionModelControllerInterface::shouldAbortCompletion(View *view, const Range &range, const QString ¤tCompletion)
96 // Do not abort completions when the text has been empty already before and a newline has been entered
98 static const QRegularExpression allowedText(QStringLiteral("^\\w*$"), QRegularExpression::UseUnicodePropertiesOption);
107bool CodeCompletionModelControllerInterface::shouldExecute(const QModelIndex &index, QChar inserted)
virtual Range completionRange(View *view, const Cursor &position)
This function returns the completion range that will be used for the current completion.
virtual void aborted(View *view)
Notification that completion for this model has been aborted.
virtual MatchReaction matchingItem(const QModelIndex &matched)
Called whenever an item in the completion-list perfectly matches the current filter text.
virtual QString filterString(View *view, const Range &range, const Cursor &position)
This function returns the filter-text used for the current completion.
virtual Range updateCompletionRange(View *view, const Range &range)
This function lets the CompletionModel dynamically modify the range.
MatchReaction
Definition codecompletionmodelcontrollerinterface.h:156
virtual bool shouldHideItemsWithEqualNames() const
When multiple completion models are used at the same time, it may happen that multiple models add ite...
virtual bool shouldAbortCompletion(View *view, const Range &range, const QString ¤tCompletion)
This function decides if the completion should be aborted.
virtual bool shouldExecute(const QModelIndex &selected, QChar inserted)
When an item within this model is currently selected in the completion-list, and the user inserted th...
virtual bool shouldStartCompletion(View *view, const QString &insertedText, bool userInsertion, const Cursor &position)
This function decides if the automatic completion should be started when the user entered some text.
virtual QStringList textLines(Range range, bool block=false) const =0
Get the document content within the given range.
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
virtual Document * document() const =0
Get the view's document, that means the view is a view of the returned document.
virtual Cursor cursorPosition() const =0
Get the view's current cursor position.
Q_SCRIPTABLE Q_NOREPLY void start()
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
bool isLetter(char32_t ucs4)
bool isNumber(char32_t ucs4)
qsizetype count() const const
T & first()
bool isEmpty() const const
QRegularExpressionMatch match(QStringView subjectView, qsizetype offset, MatchType matchType, MatchOptions matchOptions) const const
UseUnicodePropertiesOption
bool hasMatch() const const
const QChar at(qsizetype position) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype size() const const
QStringView left(qsizetype length) const const
QStringView mid(qsizetype start, qsizetype length) const const
qsizetype indexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const const
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:17:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:17:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.