| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2018 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtSCriptTools module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "qscriptcompletiontask_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptcompletiontask_p.h`/ |
| 41 | #include "qscriptcompletiontaskinterface_p_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptcompletiontaskinterface_p_p.h`/ |
| 42 | #include "qscriptdebuggerconsole_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerconsole_p.h`/ |
| 43 | #include "qscriptdebuggerconsolecommand_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h`/ |
| 44 | #include "qscriptdebuggerconsolecommandmanager_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h`/ |
| 45 | #include "qscriptdebuggercommandschedulerjob_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggercommandschedulerjob_p.h`/ |
| 46 | #include "qscriptdebuggercommandschedulerfrontend_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggercommandschedulerfrontend_p.h`/ |
| 47 | #include "qscriptdebuggerjobschedulerinterface_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerjobschedulerinterface_p.h`/ |
| 48 | #include "qscriptdebuggerresponse_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerresponse_p.h`/ |
| 49 | |
| 50 | #include "private/qobject_p.h" |
| 51 | |
| 52 | #include <QtCore/qset.h> |
| 53 | #include <QtCore/qdebug.h> |
| 54 | |
| 55 | #include <algorithm> |
| 56 | |
| 57 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 58 | |
| 59 | class QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate# |
| 60 | : public QScriptCompletionTaskInterfacePrivatecxx . . $ QScriptCompletionTaskInterfacePrivate# |
| 61 | { |
| 62 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QScriptCompletionTask) |
| 63 | public: |
| 64 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#QScriptCompletionTaskPrivate(49f6e7a06ebc5aa8).(); |
| 65 | ~cxx . . $ QScriptCompletionTaskPrivate#`~QScriptCompletionTaskPrivate`(ced63f7c635d850d).QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#(); |
| 66 | |
| 67 | void completeScriptExpressioncxx . . $ QScriptCompletionTaskPrivate#completeScriptExpression(49f6e7a06ebc5aa8).(); |
| 68 | void emitFinishedcxx . . $ QScriptCompletionTaskPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 69 | |
| 70 | QStringcxx . . $ QString# contentscxx . . $ QScriptCompletionTaskPrivate#contents.; |
| 71 | int cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition.; |
| 72 | int frameIndexcxx . . $ QScriptCompletionTaskPrivate#frameIndex.; |
| 73 | QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *commandSchedulercxx . . $ QScriptCompletionTaskPrivate#commandScheduler.; |
| 74 | QScriptDebuggerJobSchedulerInterfacecxx . . $ QScriptDebuggerJobSchedulerInterface# *jobSchedulercxx . . $ QScriptCompletionTaskPrivate#jobScheduler.; |
| 75 | QScriptDebuggerConsolecxx . . $ QScriptDebuggerConsole# *consolecxx . . $ QScriptCompletionTaskPrivate#console.; |
| 76 | }; |
| 77 | |
| 78 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#::QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#QScriptCompletionTaskPrivate(49f6e7a06ebc5aa8).() |
| 79 | : cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition.(0), frameIndexcxx . . $ QScriptCompletionTaskPrivate#frameIndex.(0), commandSchedulercxx . . $ QScriptCompletionTaskPrivate#commandScheduler.(0), |
| 80 | jobSchedulercxx . . $ QScriptCompletionTaskPrivate#jobScheduler.(0), consolecxx . . $ QScriptCompletionTaskPrivate#console.(0) |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#::~cxx . . $ QScriptCompletionTaskPrivate#`~QScriptCompletionTaskPrivate`(ced63f7c635d850d).QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#() |
| 85 | { |
| 86 | } |
| 87 | |
| 88 | class QScriptCompleteExpressionJobcxx . . $ QScriptCompleteExpressionJob# : public QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob# |
| 89 | { |
| 90 | public: |
| 91 | QScriptCompleteExpressionJobcxx . . $ QScriptCompleteExpressionJob#QScriptCompleteExpressionJob(d37e44767857410f).(int frameIndex, const QStringListcxx . . $ QStringList# &path, |
| 92 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate# *task, |
| 93 | QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *scheduler) |
| 94 | : QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#(scheduler), |
| 95 | m_frameIndexcxx . . $ QScriptCompleteExpressionJob#m_frameIndex.(frameIndex), m_path(path), m_taskcxx . . $ QScriptCompleteExpressionJob#m_task.(task) |
| 96 | {} |
| 97 | |
| 98 | void startcxx . . $ QScriptCompleteExpressionJob#start(49f6e7a06ebc5aa8).() |
| 99 | { |
| 100 | QScriptDebuggerCommandSchedulerFrontendcxx . . $ QScriptDebuggerCommandSchedulerFrontend# frontend(commandSchedulercxx . . $ QScriptDebuggerCommandSchedulerJob#commandScheduler(80d89317ed956ed9).(), this); |
| 101 | frontend.scheduleGetCompletionscxx . . $ QScriptDebuggerCommandSchedulerFrontend#scheduleGetCompletions(deb26cb6d7f4f651).(m_frameIndexcxx . . $ QScriptCompleteExpressionJob#m_frameIndex., m_path); |
| 102 | } |
| 103 | void handleResponsecxx . . $ QScriptCompleteExpressionJob#handleResponse(46b5ea012c87a176).(const QScriptDebuggerResponsecxx . . $ QScriptDebuggerResponse# &response, int /*commandId*/) |
| 104 | { |
| 105 | m_taskcxx . . $ QScriptCompleteExpressionJob#m_task.->results = response.resultcxx . . $ QScriptDebuggerResponse#result(23280f95d1ccaa1f).().toStringListcxx . . $ QVariant#toStringList(e1dbd5c4feadc8f5).(); |
| 106 | m_taskcxx . . $ QScriptCompleteExpressionJob#m_task.->emitFinishedcxx . . $ QScriptCompletionTaskPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 107 | finishcxx . . $ QScriptDebuggerJob#finish(49f6e7a06ebc5aa8).(); |
| 108 | } |
| 109 | |
| 110 | private: |
| 111 | int m_frameIndexcxx . . $ QScriptCompleteExpressionJob#m_frameIndex.; |
| 112 | QStringListcxx . . $ QStringList# m_pathcxx . . $ QScriptCompleteExpressionJob#m_path.; |
| 113 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate# *m_taskcxx . . $ QScriptCompleteExpressionJob#m_task.; |
| 114 | }; |
| 115 | |
| 116 | namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/ { |
| 117 | |
| 118 | static bool isIdentCharcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isIdentChar(ab742ecf0fa16847).(const QCharcxx . . $ QChar# &ch) |
| 119 | { |
| 120 | static QCharcxx . . $ QChar# underscore = QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('_'); |
| 121 | return ch.isLetterOrNumbercxx . . $ QChar#isLetterOrNumber(3482b152b9333168).() || (ch ==cxx . . $ `operator==`(a468b2f18a3afe8). underscore); |
| 122 | } |
| 123 | |
| 124 | static bool isPrefixOfcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isPrefixOf(edf9e4f73813982f).(const QStringcxx . . $ QString# &prefix, const QStringcxx . . $ QString# &what) |
| 125 | { |
| 126 | return ((what.lengthcxx . . $ QString#length(455f465bc33b4cdf).() > prefix.lengthcxx . . $ QString#length(455f465bc33b4cdf).()) |
| 127 | && what.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(prefix)); |
| 128 | } |
| 129 | |
| 130 | } // namespace |
| 131 | |
| 132 | class QScriptCompleteScriptsJobcxx . . $ QScriptCompleteScriptsJob# : public QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob# |
| 133 | { |
| 134 | public: |
| 135 | QScriptCompleteScriptsJobcxx . . $ QScriptCompleteScriptsJob#QScriptCompleteScriptsJob(eb89cb52e250282d).(const QStringcxx . . $ QString# &prefix, QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate# *task, |
| 136 | QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *scheduler) |
| 137 | : QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#(scheduler), |
| 138 | m_prefixcxx . . $ QScriptCompleteScriptsJob#m_prefix.(prefix), m_taskcxx . . $ QScriptCompleteScriptsJob#m_task.(task) |
| 139 | {} |
| 140 | |
| 141 | void startcxx . . $ QScriptCompleteScriptsJob#start(49f6e7a06ebc5aa8).() |
| 142 | { |
| 143 | QScriptDebuggerCommandSchedulerFrontendcxx . . $ QScriptDebuggerCommandSchedulerFrontend# frontend(commandSchedulercxx . . $ QScriptDebuggerCommandSchedulerJob#commandScheduler(80d89317ed956ed9).(), this); |
| 144 | frontend.scheduleGetScriptscxx . . $ QScriptDebuggerCommandSchedulerFrontend#scheduleGetScripts(b126dc7c1de90089).(); |
| 145 | } |
| 146 | void handleResponsecxx . . $ QScriptCompleteScriptsJob#handleResponse(46b5ea012c87a176).(const QScriptDebuggerResponsecxx . . $ QScriptDebuggerResponse# &response, int /*commandId*/) |
| 147 | { |
| 148 | QScriptScriptMapcxx . . $ QScriptScriptMap# scripts = response.resultAsScripts(); |
| 149 | QScriptScriptMap::const_iterator it; |
| 150 | for (it = scripts.constBegin(); it !=cxx . . $ `operator!=`(7ace4fcbb87c2d05). scripts.constEnd(); ++it) { |
| 151 | QStringcxx . . $ QString# fileName = it.value().fileName(); |
| 152 | if (isPrefixOfcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isPrefixOf(edf9e4f73813982f).(m_prefixcxx . . $ QScriptCompleteScriptsJob#m_prefix., fileName)) |
| 153 | m_taskcxx . . $ QScriptCompleteScriptsJob#m_task.->results.append(fileName); |
| 154 | } |
| 155 | m_taskcxx . . $ QScriptCompleteScriptsJob#m_task.->emitFinishedcxx . . $ QScriptCompletionTaskPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 156 | finishcxx . . $ QScriptDebuggerJob#finish(49f6e7a06ebc5aa8).(); |
| 157 | } |
| 158 | private: |
| 159 | QStringcxx . . $ QString# m_prefixcxx . . $ QScriptCompleteScriptsJob#m_prefix.; |
| 160 | QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate# *m_taskcxx . . $ QScriptCompleteScriptsJob#m_task.; |
| 161 | }; |
| 162 | |
| 163 | void QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#::completeScriptExpressioncxx . . $ QScriptCompletionTaskPrivate#completeScriptExpression(49f6e7a06ebc5aa8).() |
| 164 | { |
| 165 | int pos = cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition.; |
| 166 | if ((pos > 0) && contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos-1).isNumbercxx . . $ QChar#isNumber(3482b152b9333168).()) { |
| 167 | // completion of numbers is pointless |
| 168 | emitFinishedcxx . . $ QScriptCompletionTaskPrivate#emitFinished(49f6e7a06ebc5aa8).(); |
| 169 | return; |
| 170 | } |
| 171 | |
| 172 | while ((pos > 0) && isIdentCharcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isIdentChar(ab742ecf0fa16847).(contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos-1))) |
| 173 | --pos; |
| 174 | int pos2 = cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. - 1; |
| 175 | while ((pos2+1 < contentscxx . . $ QScriptCompletionTaskPrivate#contents..sizecxx . . $ QString#size(455f465bc33b4cdf).()) && isIdentCharcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isIdentChar(ab742ecf0fa16847).(contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos2+1))) |
| 176 | ++pos2; |
| 177 | QStringcxx . . $ QString# ident = contentscxx . . $ QScriptCompletionTaskPrivate#contents..midcxx . . $ QString#mid(44b7563da18aea72).(pos, pos2 - pos + 1); |
| 178 | position = pos; |
| 179 | |
| 180 | QStringListcxx . . $ QStringList# pathcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 181 | path.append(ident); |
| 182 | while ((pos > 0) && (contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos-1) ==cxx . . $ `operator==`(a468b2f18a3afe8). QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('.'))) { |
| 183 | --pos; |
| 184 | pos2 = pos; |
| 185 | while ((pos > 0) && isIdentCharcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isIdentChar(ab742ecf0fa16847).(contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos-1))) |
| 186 | --pos; |
| 187 | path.prepend(contentscxx . . $ QScriptCompletionTaskPrivate#contents..midcxx . . $ QString#mid(44b7563da18aea72).(pos, pos2 - pos)); |
| 188 | } |
| 189 | |
| 190 | length = path.last().length(); |
| 191 | type = QScriptCompletionTask::ScriptIdentifierCompletion; |
| 192 | |
| 193 | QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new QScriptCompleteExpressionJobcxx . . $ QScriptCompleteExpressionJob#(frameIndexcxx . . $ QScriptCompletionTaskPrivate#frameIndex., path, this, commandSchedulercxx . . $ QScriptCompletionTaskPrivate#commandScheduler.); |
| 194 | jobSchedulercxx . . $ QScriptCompletionTaskPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job); |
| 195 | } |
| 196 | |
| 197 | void QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#::emitFinishedcxx . . $ QScriptCompletionTaskPrivate#emitFinished(49f6e7a06ebc5aa8).() |
| 198 | { |
| 199 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! q_funccxx . . $ QScriptCompletionTaskPrivate#q_func(18f570cd64866874).()->finishedcxx . . $ QScriptCompletionTaskInterface#finished(49f6e7a06ebc5aa8).(); |
| 200 | } |
| 201 | |
| 202 | QScriptCompletionTaskcxx . . $ QScriptCompletionTask#::QScriptCompletionTaskcxx . . $ QScriptCompletionTask#QScriptCompletionTask(34ca6cd3f3ab3a1c).( |
| 203 | const QStringcxx . . $ QString# &contents, int cursorPosition, int frameIndex, |
| 204 | QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *commandScheduler, |
| 205 | QScriptDebuggerJobSchedulerInterfacecxx . . $ QScriptDebuggerJobSchedulerInterface# *jobScheduler, |
| 206 | QScriptDebuggerConsolecxx . . $ QScriptDebuggerConsole# *console, |
| 207 | QObjectcxx . . $ QObject# *parent) |
| 208 | : QScriptCompletionTaskInterfacecxx . . $ QScriptCompletionTaskInterface#( |
| 209 | *new QScriptCompletionTaskPrivatecxx . . $ QScriptCompletionTaskPrivate#QScriptCompletionTaskPrivate(49f6e7a06ebc5aa8)., parent) |
| 210 | { |
| 211 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptCompletionTask); |
| 212 | d->contentscxx . . $ QScriptCompletionTaskPrivate#contents. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). contents; |
| 213 | d->cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. = cursorPosition; |
| 214 | if ((frameIndex == -1) && console) |
| 215 | d->frameIndexcxx . . $ QScriptCompletionTaskPrivate#frameIndex. = console->currentFrameIndexcxx . . $ QScriptDebuggerConsole#currentFrameIndex(455f465bc33b4cdf).(); |
| 216 | else |
| 217 | d->frameIndexcxx . . $ QScriptCompletionTaskPrivate#frameIndex. = frameIndex; |
| 218 | d->commandSchedulercxx . . $ QScriptCompletionTaskPrivate#commandScheduler. = commandScheduler; |
| 219 | d->jobSchedulercxx . . $ QScriptCompletionTaskPrivate#jobScheduler. = jobScheduler; |
| 220 | d->consolecxx . . $ QScriptCompletionTaskPrivate#console. = console; |
| 221 | } |
| 222 | |
| 223 | QScriptCompletionTaskcxx . . $ QScriptCompletionTask#::~cxx . . $ QScriptCompletionTask#`~QScriptCompletionTask`(ced63f7c635d850d).QScriptCompletionTaskcxx . . $ QScriptCompletionTask#() |
| 224 | { |
| 225 | } |
| 226 | |
| 227 | void QScriptCompletionTaskcxx . . $ QScriptCompletionTask#::startcxx . . $ QScriptCompletionTask#start(49f6e7a06ebc5aa8).() |
| 228 | { |
| 229 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptCompletionTask); |
| 230 | d->type = NoCompletioncxx . . $ QScriptCompletionTaskInterface#NoCompletion.; |
| 231 | // see if we're typing a command |
| 232 | // ### don't hardcode the command prefix |
| 233 | QRegExpcxx . . $ QRegExp# cmdRxcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("^\\s*\\.([a-zA-Z]*)")); |
| 234 | int cmdIndex = cmdRx.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(d->contentscxx . . $ QScriptCompletionTaskPrivate#contents.); |
| 235 | if ((cmdIndex != -1) && d->consolecxx . . $ QScriptCompletionTaskPrivate#console.) { |
| 236 | int len = cmdRx.matchedLengthcxx . . $ QRegExp#matchedLength(455f465bc33b4cdf).(); |
| 237 | QStringcxx . . $ QString# prefix = cmdRx.capturedTextscxx . . $ QRegExp#capturedTexts(669a05bc42dd57cc).().at(1); |
| 238 | if ((d->cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. >= cmdIndex) && (d->cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. <= (cmdIndex+len))) { |
| 239 | // editing command --> get command completions |
| 240 | d->results = d->consolecxx . . $ QScriptCompletionTaskPrivate#console.->commandManagercxx . . $ QScriptDebuggerConsole#commandManager(800766a8ecbf2e42).()->completionscxx . . $ QScriptDebuggerConsoleCommandManager#completions(50afb52245723b61).(prefix); |
| 241 | d->position = cmdRx.poscxx . . $ QRegExp#pos(7864480464b09eea).(1); |
| 242 | d->length = prefix.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); |
| 243 | d->type = CommandNameCompletioncxx . . $ QScriptCompletionTaskInterface#CommandNameCompletion.; |
| 244 | d->appendix = QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).(" "); |
| 245 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! finishedcxx . . $ QScriptCompletionTaskInterface#finished(49f6e7a06ebc5aa8).(); |
| 246 | } else { |
| 247 | QScriptDebuggerConsoleCommandcxx . . $ QScriptDebuggerConsoleCommand# *cmd = d->consolecxx . . $ QScriptCompletionTaskPrivate#console.->commandManagercxx . . $ QScriptDebuggerConsole#commandManager(800766a8ecbf2e42).()->findCommandcxx . . $ QScriptDebuggerConsoleCommandManager#findCommand(c5e30f28890cffb).(prefix); |
| 248 | if (!cmd) { |
| 249 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! finishedcxx . . $ QScriptCompletionTaskInterface#finished(49f6e7a06ebc5aa8).(); |
| 250 | return; |
| 251 | } |
| 252 | // editing an argument |
| 253 | int argNum = 0; |
| 254 | QStringcxx . . $ QString# argcxx . . $ QString#QString(ced63f7c635d850d).; |
| 255 | int pos = cmdIndex + len; |
| 256 | while (pos < d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..sizecxx . . $ QString#size(455f465bc33b4cdf).()) { |
| 257 | while ((pos < d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..sizecxx . . $ QString#size(455f465bc33b4cdf).()) && d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos).isSpacecxx . . $ QChar#isSpace(3482b152b9333168).()) |
| 258 | ++pos; |
| 259 | if (pos < d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..sizecxx . . $ QString#size(455f465bc33b4cdf).()) { |
| 260 | int pos2 = pos + 1; |
| 261 | while ((pos2 < d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..sizecxx . . $ QString#size(455f465bc33b4cdf).()) && !d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..atcxx . . $ QString#at(13af7ae5a875439e).(pos2).isSpacecxx . . $ QChar#isSpace(3482b152b9333168).()) |
| 262 | ++pos2; |
| 263 | if ((d->cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. >= pos) && (d->cursorPositioncxx . . $ QScriptCompletionTaskPrivate#cursorPosition. <= pos2)) { |
| 264 | arg =cxx . . $ QString#`operator=`(4f35bf974e7f8568). d->contentscxx . . $ QScriptCompletionTaskPrivate#contents..midcxx . . $ QString#mid(44b7563da18aea72).(pos, pos2 - pos); |
| 265 | break; |
| 266 | } |
| 267 | pos = pos2; |
| 268 | ++argNum; |
| 269 | } |
| 270 | } |
| 271 | QStringcxx . . $ QString# argType = cmd->argumentTypescxx . . $ QScriptDebuggerConsoleCommand#argumentTypes(e1dbd5c4feadc8f5).().value(argNum); |
| 272 | if (!argType.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 273 | if (argType ==cxx . . $ QString#`operator==`(b3b98e09a392cdf9). QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("command-or-group-name")) { |
| 274 | d->results = d->consolecxx . . $ QScriptCompletionTaskPrivate#console.->commandManagercxx . . $ QScriptDebuggerConsole#commandManager(800766a8ecbf2e42).()->completionscxx . . $ QScriptDebuggerConsoleCommandManager#completions(50afb52245723b61).(arg); |
| 275 | } else if (argType ==cxx . . $ QString#`operator==`(b3b98e09a392cdf9). QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("script-filename")) { |
| 276 | d->position = pos; |
| 277 | d->length = arg.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); |
| 278 | d->type = CommandArgumentCompletioncxx . . $ QScriptCompletionTaskInterface#CommandArgumentCompletion.; |
| 279 | QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new QScriptCompleteScriptsJobcxx . . $ QScriptCompleteScriptsJob#(arg, d, d->commandSchedulercxx . . $ QScriptCompletionTaskPrivate#commandScheduler.); |
| 280 | d->jobSchedulercxx . . $ QScriptCompletionTaskPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job); |
| 281 | } else if (argType ==cxx . . $ QString#`operator==`(b3b98e09a392cdf9). QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("subcommand-name")) { |
| 282 | for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). cmd->subCommandscxx . . $ QScriptDebuggerConsoleCommand#subCommands(e1dbd5c4feadc8f5).().size(); ++i) { |
| 283 | QStringcxx . . $ QString# name = cmd->subCommandscxx . . $ QScriptDebuggerConsoleCommand#subCommands(e1dbd5c4feadc8f5).().at(i); |
| 284 | if (isPrefixOfcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptcompletiontask.cpp`/isPrefixOf(edf9e4f73813982f).(arg, name)) |
| 285 | d->results.append(name); |
| 286 | } |
| 287 | stdcxx . . $ std/::stable_sortcxx . . $ std/stable_sort(249673c20e2b8d5).(d->results.begin(), d->results.end()); |
| 288 | } else if (argType ==cxx . . $ QString#`operator==`(b3b98e09a392cdf9). QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("script")) { |
| 289 | d->completeScriptExpressioncxx . . $ QScriptCompletionTaskPrivate#completeScriptExpression(49f6e7a06ebc5aa8).(); |
| 290 | } else { |
| 291 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! finishedcxx . . $ QScriptCompletionTaskInterface#finished(49f6e7a06ebc5aa8).(); |
| 292 | } |
| 293 | if ((d->type ==cxx . . $ `operator==`(7ace4fcbb87c2d05). NoCompletioncxx . . $ QScriptCompletionTaskInterface#NoCompletion.) && !d->results.isEmpty()) { |
| 294 | d->position = pos; |
| 295 | d->length = arg.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); |
| 296 | d->type = CommandArgumentCompletioncxx . . $ QScriptCompletionTaskInterface#CommandArgumentCompletion.; |
| 297 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! finishedcxx . . $ QScriptCompletionTaskInterface#finished(49f6e7a06ebc5aa8).(); |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | } else { |
| 302 | // assume it's an eval expression |
| 303 | d->completeScriptExpressioncxx . . $ QScriptCompletionTaskPrivate#completeScriptExpression(49f6e7a06ebc5aa8).(); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |