diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 4a7e7ca9620..1af9e5cb5f8 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -1757,6 +1757,10 @@ Install an SDK of at least API version %1. Alt+Shift+T,Alt+A Alt+Shift+T,Alt+A + + Ctrl+Meta+T, Ctrl+Meta+A + Ctrl+Meta+T, Ctrl+Meta+A + &Run Selected Tests &Запустить выбранные @@ -1769,6 +1773,10 @@ Install an SDK of at least API version %1. Alt+Shift+T,Alt+R Alt+Shift+T,Alt+R + + Ctrl+Meta+T, Ctrl+Meta+R + Ctrl+Meta+T, Ctrl+Meta+R + Run Tests for Current &File Запустить тесты для текущего &файла @@ -1781,6 +1789,10 @@ Install an SDK of at least API version %1. Alt+Shift+T,Alt+F Alt+Shift+T,Alt+F + + Ctrl+Meta+T, Ctrl+Meta+F + Ctrl+Meta+T, Ctrl+Meta+F + Re&scan Tests &Пересканировать @@ -1789,6 +1801,10 @@ Install an SDK of at least API version %1. Alt+Shift+T,Alt+S Alt+Shift+T,Alt+S + + Ctrl+Meta+T, Ctrl+Meta+S + Ctrl+Meta+T, Ctrl+Meta+S + &Run Test Under Cursor &Запустить тест под курсором @@ -11195,7 +11211,7 @@ Flags: %3 CppTools::TidyChecksTreeModel Web Page - Вэб-страница + Веб-страница @@ -13312,7 +13328,7 @@ Affected are breakpoints %1 Start Debugging Without Deployment - Начать отладку с установкой + Начать отладку без установки Start and Debug External Application... @@ -26820,6 +26836,10 @@ to project "%2". Alt+Shift+L Alt+Shift+L + + Meta+Shift+L + Meta+Shift+L + Hide Empty Directories Скрывать пустые каталоги @@ -36383,7 +36403,7 @@ For more details, see /etc/sysctl.d/10-ptrace.conf Classes for displaying and editing Web content - Классы для отображения и правки вэб-страниц + Классы для отображения и правки веб-страниц WebKit1 and QWidget-based classes from Qt 4 (Qt 5) @@ -45318,6 +45338,10 @@ should a repository require SSH-authentication (see documentation on SSH and the No executable to deploy found in %1. В %1 не обнаружен исполняемый файл для установки. + + Cannot find windeployqt.exe in "%1". + Не удалось найти windeployqt.exe в «%1». + Cannot parse manifest file %1. Не удалось разобрать файл манифеста %1. diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp index 128f450cafa..7ea4a2ddafe 100644 --- a/src/libs/qtcreatorcdbext/containers.cpp +++ b/src/libs/qtcreatorcdbext/containers.cpp @@ -108,7 +108,7 @@ static inline int msvcStdVectorSize(const SymbolGroupValue &v) const std::vector innerTypes = v.innerTypes(); if (innerTypes.empty()) return -1; - const std::string innerType = fixInnerType(SymbolGroupValue::stripPointerType(innerTypes[0]), v); + const std::string innerType = fixInnerType(innerTypes[0], v); const size_t size = SymbolGroupValue::sizeOf(innerType.c_str()); if (size == 0) return -1; diff --git a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp index cdb69be9b93..44572146f13 100644 --- a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp +++ b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp @@ -46,14 +46,14 @@ class DocumentContentCompletionProcessor : public IAssistProcessor { public: DocumentContentCompletionProcessor(const QString &snippetGroupId); + ~DocumentContentCompletionProcessor() override; IAssistProposal *perform(const AssistInterface *interface) override; - bool running() final { return m_running; } + bool running() final { return m_watcher.isRunning(); } private: - TextEditor::SnippetAssistCollector m_snippetCollector; - IAssistProposal *createProposal(const AssistInterface *interface); - bool m_running = false; + QString m_snippetGroup; + QFutureWatcher m_watcher; }; DocumentContentCompletionProvider::DocumentContentCompletionProvider(const QString &snippetGroup) @@ -71,45 +71,39 @@ IAssistProcessor *DocumentContentCompletionProvider::createProcessor() const } DocumentContentCompletionProcessor::DocumentContentCompletionProcessor(const QString &snippetGroupId) - : m_snippetCollector(snippetGroupId, QIcon(":/texteditor/images/snippet.png")) + : m_snippetGroup(snippetGroupId) { } +DocumentContentCompletionProcessor::~DocumentContentCompletionProcessor() +{ + if (m_watcher.isRunning()) + m_watcher.cancel(); +} + +static void createProposal(QFutureInterface &future, const QString text) +{ + const QRegularExpression wordRE("([a-zA-Z_][a-zA-Z0-9_]{2,})"); + + QSet words; + QRegularExpressionMatchIterator it = wordRE.globalMatch(text); + while (it.hasNext()) { + if (future.isCanceled()) + return; + QRegularExpressionMatch match = it.next(); + const QString &word = match.captured(); + if (!words.contains(word)) + words.insert(word); + } + + future.reportResult(words.toList()); +} + IAssistProposal *DocumentContentCompletionProcessor::perform(const AssistInterface *interface) -{ - Utils::onResultReady(Utils::runAsync( - &DocumentContentCompletionProcessor::createProposal, this, interface), - [this](IAssistProposal *proposal){ - m_running = false; - setAsyncProposalAvailable(proposal); - }); - m_running = true; - return nullptr; -} - -static void generateProposalItems(const QString &text, QSet &words, - QList &items) -{ - static const QRegularExpression wordRE("([a-zA-Z_][a-zA-Z0-9_]{2,})"); - - QRegularExpressionMatch match; - int index = text.indexOf(wordRE, 0, &match); - while (index >= 0) { - const QString &word = match.captured(); - if (!words.contains(word)) { - auto item = new AssistProposalItem(); - item->setText(word); - items.append(item); - words.insert(word); - } - index += word.size(); - index = text.indexOf(wordRE, index, &match); - } -} - -IAssistProposal *DocumentContentCompletionProcessor::createProposal( - const AssistInterface *interface) { QScopedPointer assistInterface(interface); + if (running()) + return nullptr; + int pos = interface->position(); QChar chr; @@ -126,14 +120,20 @@ IAssistProposal *DocumentContentCompletionProcessor::createProposal( return nullptr; } - QSet words; - QList items = m_snippetCollector.collect(); - QTextBlock block = interface->textDocument()->firstBlock(); + const QString text = interface->textDocument()->toPlainText(); - while (block.isValid()) { - generateProposalItems(block.text(), words, items); - block = block.next(); - } - - return new GenericProposal(pos, items); + m_watcher.setFuture(Utils::runAsync(&createProposal, text)); + QObject::connect(&m_watcher, &QFutureWatcher::resultReadyAt, + &m_watcher, [this, pos](int index){ + const TextEditor::SnippetAssistCollector snippetCollector( + m_snippetGroup, QIcon(":/texteditor/images/snippet.png")); + QList items = snippetCollector.collect(); + for (const QString &word : m_watcher.resultAt(index)) { + auto item = new AssistProposalItem(); + item->setText(word); + items.append(item); + } + setAsyncProposalAvailable(new GenericProposal(pos, items)); + }); + return nullptr; }