The two cases in which the UI might be blocked are:
* Invocation of the editor context menu
* Rename Symbol Under Cursor
Cancel the future if the backend is restarted and on the other side,
check whether the future is cancelled.
Change-Id: If2315da1f66f15eab1531fcd8da1dff851a9a4e6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
...otherwise an already destructed QTextDocument might be accessed in
the ClangCodeModel::Internal::IpcReceiver::references.
Task-number: QTCREATORBUG-18459
Change-Id: I1868b2fd3a64341794f83eea6c4eeb7c2c1af812
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Saves some cycles when navigating with the text cursor over the
characters.
Change-Id: Ie9a23d97ac09ca45a32178cae5b8945d0c623811
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Let CppUseSelectionsUpdater delegate the work to
*EditorDocumentProcessor so that the clang code model can also provide
results.
Change-Id: I6872afbfeea1a5c4a64fdf19fcb1992f134dde08
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Needed for a follow-up change.
Change-Id: Ibb4815f3411f0d63deac8c32583178470668f67b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
... and some of the related implementation details
Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>
Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.
Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Remove unused member m_snapshot
* QTC_CHECK -> "if (!...)" - the revision might have changed in the mean
time
* Restore previous document in synchronous case
Change-Id: Ie05c044fbb75e92edbf0fdb041178aadde8113c5
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
...instead of the semantic info *document* revision, which might be
older in case the semantic info was re-used.
This fixes the use selections in case the user triggered the undo action
after some changes in the local renaming mode.
Regression introduced by extraction of the CppUseSelectionsUpdater in
commit 89bd4ee
C++: Base parsing on editor document instead of widget
Change-Id: I8f38f6b53c950e25f02675a939876fa3ed0e81f4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This will update the use selections synchronously again in case the user
triggered "Rename Symbol Under Cursor", just as before
commit 89bd4ee
C++: Base parsing on editor document instead of widget
Change-Id: I8d4d3dcc7140a61f9ac611a505db09dc96a17740
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This mainly takes CppEditorSupport apart.
* Parsing is now invoked by CPPEditorDocument itself by listening to
QTextDocument::contentsChanged().
* Upon construction and destruction CPPEditorDocument creates and
deletes an EditorDocumentHandle for (un)registration in the model
manager. This handle provides everything to generate the working copy
and to access the editor document processor.
* A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that
controls parsing, semantic info recalculation and the semantic
highlighting for the document. This is more or less what is left from
CppEditorSupport and can be considered as the backend of a
CPPEditorDocument. CPPEditorDocument itself is quite small.
* BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor
derive from BaseEditorDocumentProcessor and implement the gaps.
* Since the semantic info calculation was bound to the widget, it
also calculated the local uses, which depend on the cursor
position. This calculation got moved into the extracted class
UseSeletionsUpdater in the cppeditor plugin, which is run once the
cursor position changes or the semantic info document is updated.
* Some more logic got extracted:
- SemanticInfoUpdater (logic was in CppEditorSupport)
- SemanticHighlighter (logic was in CppEditorSupport)
* The *Parser and *Processor classes can be easily accessed by the
static function get().
* CppHighlightingSupport is gone since it turned out to be useless.
* The editor dependency in CompletionAssistProviders is gone since we
actually only need the file path now.
Change-Id: I49d3a7bd138c5ed9620123e34480772535156508
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>