52 #include "private/qobject_p.h" 54 #include <QtCore/qset.h> 55 #include <QtCore/qdebug.h> 95 m_frameIndex(frameIndex), m_path(path), m_task(task)
106 m_task->emitFinished();
118 static bool isIdentChar(
const QChar &ch)
138 m_prefix(prefix), m_task(task)
153 m_task->results.
append(fileName);
155 m_task->emitFinished();
172 while ((pos > 0) && isIdentChar(
contents.
at(pos-1)))
185 while ((pos > 0) && isIdentChar(
contents.
at(pos-1)))
199 emit q_func()->finished();
212 d->contents = contents;
213 d->cursorPosition = cursorPosition;
214 if ((frameIndex == -1) && console)
217 d->frameIndex = frameIndex;
218 d->commandScheduler = commandScheduler;
219 d->jobScheduler = jobScheduler;
220 d->console = console;
234 int cmdIndex = cmdRx.
indexIn(
d->contents);
235 if ((cmdIndex != -1) &&
d->console) {
238 if ((
d->cursorPosition >= cmdIndex) && (
d->cursorPosition <= (cmdIndex+len))) {
240 d->results =
d->console->commandManager()->completions(prefix);
241 d->position = cmdRx.
pos(1);
255 int pos = cmdIndex + len;
256 while (pos < d->contents.size()) {
257 while ((pos < d->contents.size()) &&
d->contents.at(pos).isSpace())
259 if (pos < d->contents.size()) {
261 while ((pos2 < d->contents.size()) && !
d->contents.at(pos2).isSpace())
263 if ((
d->cursorPosition >= pos) && (
d->cursorPosition <= pos2)) {
264 arg =
d->contents.mid(pos, pos2 - pos);
274 d->results =
d->console->commandManager()->completions(arg);
280 d->jobScheduler->scheduleJob(job);
285 d->results.append(name);
289 d->completeScriptExpression();
303 d->completeScriptExpression();
int scheduleGetCompletions(int contextIndex, const QStringList &path)
int currentFrameIndex() const
QScriptCompletionTask(const QString &contents, int cursorPosition, int frameIndex, QScriptDebuggerCommandSchedulerInterface *commandScheduler, QScriptDebuggerJobSchedulerInterface *jobScheduler, QScriptDebuggerConsole *console, QObject *parent=0)
#define QT_END_NAMESPACE
This macro expands to.
const QChar at(int i) const
Returns the character at the given index position in the string.
QScriptDebuggerJobSchedulerInterface * jobScheduler
The QRegExp class provides pattern matching using regular expressions.
#define it(className, varName)
The QScriptDebuggerResponse class represents a front-end's response to a QScriptDebuggerCommand.
int length() const
Returns the number of characters in this string.
~QScriptCompletionTaskPrivate()
int pos(int nth=0) const
Returns the position of the nth captured text in the searched string.
int matchedLength() const
Returns the length of the last matched string, or -1 if there was no match.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual QStringList argumentTypes() const
The QChar class provides a 16-bit Unicode character.
QScriptCompleteScriptsJob(const QString &prefix, QScriptCompletionTaskPrivate *task, QScriptDebuggerCommandSchedulerInterface *scheduler)
void handleResponse(const QScriptDebuggerResponse &response, int)
QScriptCompletionTaskPrivate * m_task
The QScriptDebuggerConsole class provides the core functionality of a debugger console.
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
void append(const T &t)
Inserts value at the end of the list.
QScriptScriptMap resultAsScripts() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
QScriptDebuggerConsole * console
QScriptCompleteExpressionJob(int frameIndex, const QStringList &path, QScriptCompletionTaskPrivate *task, QScriptDebuggerCommandSchedulerInterface *scheduler)
int size() const
Returns the number of characters in this string.
QStringList capturedTexts() const
Returns a list of the captured text strings.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
virtual QStringList subCommands() const
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
QScriptCompletionTaskPrivate * m_task
T value(int i) const
Returns the value at index position i in the list.
static bool isPrefixOf(const QString &prefix, const QString &what)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
#define Q_DECLARE_PUBLIC(Class)
QString & append(QChar c)
The QScriptDebuggerConsoleCommand class is the base class of console commands.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QScriptCompletionTaskPrivate()
T & last()
Returns a reference to the last item in the list.
int size() const
Returns the number of items in the list.
QScriptDebuggerCommandSchedulerInterface * commandScheduler
static QString fileName(const QString &fileUrl)
QVariant result() const
Returns the result of this response.
void completeScriptExpression()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void handleResponse(const QScriptDebuggerResponse &response, int)
bool isNumber() const
Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns fals...
bool isLetterOrNumber() const
Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise retu...
virtual int scheduleJob(QScriptDebuggerJob *job)=0
friend class const_iterator