KTextEditor
codecompletionmodelcontrollerinterface.cpp
24 bool CodeCompletionModelControllerInterface::shouldStartCompletion(View *view, const QString &insertedText, bool userInsertion, const Cursor &position)
33 if ((userInsertion && (lastChar.isLetter() || lastChar.isNumber() || lastChar == QLatin1Char('_'))) || lastChar == QLatin1Char('.')
40 Range CodeCompletionModelControllerInterface::completionRange(View *view, const Cursor &position)
48 static constexpr auto options = QRegularExpression::UseUnicodePropertiesOption | QRegularExpression::DontCaptureOption;
74 Range CodeCompletionModelControllerInterface::updateCompletionRange(View *view, const Range &range)
86 QString CodeCompletionModelControllerInterface::filterString(View *view, const Range &range, const Cursor &position)
91 bool 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);
107 bool CodeCompletionModelControllerInterface::shouldExecute(const QModelIndex &index, QChar inserted)
virtual Document * document() const =0
Get the view's document, that means the view is a view of the returned document.
T & first()
virtual bool shouldHideItemsWithEqualNames() const
When multiple completion models are used at the same time, it may happen that multiple models add ite...
Definition: codecompletionmodelcontrollerinterface.cpp:120
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.
Definition: codecompletionmodelcontrollerinterface.cpp:24
virtual void aborted(View *view)
Notification that completion for this model has been aborted.
Definition: codecompletionmodelcontrollerinterface.cpp:102
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const const
virtual QStringList textLines(const Range &range, bool block=false) const =0
Get the document content within the given range.
virtual QString filterString(View *view, const Range &range, const Cursor &position)
This function returns the filter-text used for the current completion.
Definition: codecompletionmodelcontrollerinterface.cpp:86
int count(const T &value) const const
Q_SCRIPTABLE Q_NOREPLY void start()
An object representing a section of text, from one Cursor to another.
Definition: include/ktexteditor/range.h:44
virtual Range updateCompletionRange(View *view, const Range &range)
This function lets the CompletionModel dynamically modify the range.
Definition: codecompletionmodelcontrollerinterface.cpp:74
bool isLetter() const const
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
constexpr Cursor end() const Q_DECL_NOEXCEPT
Get the end position of this range.
Definition: include/ktexteditor/range.h:183
MatchReaction
Definition: codecompletionmodelcontrollerinterface.h:156
virtual MatchReaction matchingItem(const QModelIndex &matched)
Called whenever an item in the completion-list perfectly matches the current filter text.
Definition: codecompletionmodelcontrollerinterface.cpp:114
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...
Definition: codecompletionmodelcontrollerinterface.cpp:107
bool isEmpty() const const
bool isEmpty() const const
bool hasMatch() const const
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
QRegularExpressionMatch match(const QString &subject, int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const const
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
virtual bool shouldAbortCompletion(View *view, const Range &range, const QString ¤tCompletion)
This function decides if the completion should be aborted.
Definition: codecompletionmodelcontrollerinterface.cpp:91
UseUnicodePropertiesOption
int count() const const
constexpr Cursor start() const Q_DECL_NOEXCEPT
Get the start position of this range.
Definition: include/ktexteditor/range.h:173
QString left(int n) const const
virtual Range completionRange(View *view, const Cursor &position)
This function returns the completion range that will be used for the current completion.
Definition: codecompletionmodelcontrollerinterface.cpp:40
bool isNumber() const const
const QChar at(int position) const const
virtual Cursor cursorPosition() const =0
Get the view's current cursor position.
QString mid(int position, int n) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:50:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:50:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.