This addresses
SOFT ASSERT made fatal: "m_connection.isConnected()" in file
src/plugins/clangcodemodel/clangbackendipcintegration.cpp, line 230
I could not reproduce the issue locally, so I'm leaving the soft asserts
untouched for now.
Change-Id: If1d55ba7bc7e2d1ac20ad992c6d0d43ceb0f5d73
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Extract common stuff into the base class ClangException
* Remove unused exceptions TranslationUnitParseErrorException and
TranslationUnitReparseErrorException
* Do not send error messages to the Qt Creator side. The messages were
only generated when the backend crashed and while it was not yet fully
re-initialized (e.g. do code completion right after crash where the
document was not yet registered at the backend).
Change-Id: I91d98d5ef681ad487f7a2fd66f78fa7cd1e958df
Reviewed-by: David Schulz <david.schulz@qt.io>
The messages
RequestDiagnosticsMessage
RequestHighlightingMessage
and
DiagnosticsChangedMessage
HighlightingChangedMessage
are always send/received together, so merge them into
RequestDocumentAnnotationsMessage
DocumentAnnotationsChangedMessage
Change-Id: I6a0b6281ed1e6efe6cb18386afe99b1d1fb58abf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
We want to reuse the connection client in other plugins. This is the first
step, the next step is refactoring the IPC mechanismn and move it up to
the IpcServer- and IpcClientInterface.
Change-Id: I6eb6db1e9bc18232c8df350a6303afd2edc68da8
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
The connection client can block main thread at start up. This patch is
removing the wait functions and using signals instead.
Change-Id: I847c98b095752f6a875c0365bc27361bc5bdd051
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.
Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
1 struct Foo { int member; };
2 void f(Foo *foo)
3 {
4 foo.<REQUEST COMPLETION> // correct '.' to '->' and provide results
5 }
The preferred approach would be to check if "foo" in line 4 is of
pointer type, but there is no suitable cursor (only CompoundStmt) at
that position since the code is usually not yet parsed and thus invalid.
Thus, just run the completion as is. If there are not any results for a
dot completion, re-run the completion with "." exchanged by "->". This
approach is inherently slower than the preferred approach implemented in
the built-in code model.
The following rare cases are not handled:
1) Requesting completion after white space:
Works: foo.<COMPLETE HERE>
Fails: foo. <COMPLETE HERE>
2) Opening a file and requesting completion (ctrl+space) without prior
editing. No editing before triggering completion means that no
unsaved file is generated on the backend side, which is a
requirement for the correction.
Task-number: QTCREATORBUG-11581
Change-Id: I6bc8e8594778774ab342755fdb01a8a3e5c52ba0
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
The translation unit was updated, but not re-registered.
Handle the editor documents this way:
1. Reset all ClangEditorDocumentProcessors (this will send an
unregister message, but that's not problematic).
2. For the visible editor documents, run their processors so that the
translation units will be re-registered.
3. For the invisible editor documents, mark them dirty. Once the user
makes an invisible document visible again, the processor will run
and also re-register the translation unit.
Change-Id: I23693ac197bd34a183f3a0020eb5372268636599
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
If we send already a completion we should test if there is already one
sent for the same position.
Change-Id: Ie88f89bff0e1da1c5e747827a45154c7ccaecabc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
We reparse first the current and then the visible translation units before
we reparse all other units.
The signals connections are queued to wait for the visible editor update.
Change-Id: I5e2b8bc80568450268ca24e26720b3f5af640995
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Most of the time, the updated diagnostics/highlightings will be send by
the backend on translation unit update.
The other use case is changing the font settings (e.g. color), here we
need to request the highlightings explicitly.
Change-Id: I17a574eaf972c8bef12900241e7b33fe6ffd9dbd
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Provide the language option (e.g. "-x c++-header") when registering a
translation unit for the editor.
Task-number: QTCREATORBUG-14787
Change-Id: Ie06f9fdab302f1b21ba72cdb65b6aabf9f7bc04c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
If an editor is changing all translation units independent of their project
part they must be updated too. So we introduce a new message to update all
translation units with the same file path.
Change-Id: I70d0ea2bbca9fa880111ff7219573e54f3277026
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diagnostics should be not computed after a file change but after creator
is requesting them. Now we wait for the dialog if the file should be
reloaded.
Change-Id: Id0d51874b95e0f8743002a91511d07e0ed47ecdc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Add logging and don't send if sendMode is IgnoreSendRequests.
Change-Id: Ia3df9fd2c1c75cfec720233518401fc9df5e0017
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
If a file is reloaded it should update every translation unit.
Change-Id: Ib61d933e95fcd9fe4d32363ddc06f5edcca55e35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reparsing a document is expensive so we should avoid it by all means. In
this patch we prevent that the same document is send again. It isn't send
too in advance of a code completion if there was no changes before the
the completion position.
Change-Id: I0bb786ba1d4e7ce08611a518cb32f8cf8f4d0037
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
registerCurrentUnsavedFiles was misleading.
Change-Id: I5a2444d81d141ced4b8a0fae7236484c9e919d8d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
We have auto generated buffers from ui files which are not open but have no
file representation. So we need to provide them as unsaved files only.
Change-Id: I48a426c18e06eeda2fa707864f32f293e17ac651
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
It reflects that the translation units and projects have a tied
relationship with an editor.
Change-Id: I3c01d5776980fe079af1fdef82feded83fdf5463
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Includes are now watched by a file watcher. Unsaved file changes are
watched too. If they are changed the translation units which depend on
them are set to a state which require a reparse. Later the diagnostics
of this units are collected and send back to creator.
Change-Id: I2fb5c7dd6644687f22399edd8d18edd6215c9505
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diagnostics are now moved to the clang backend process. Fixits are
supported too.
Change-Id: I20faacf466bbf78dec479220c3d7b336a47bc453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
...the backend is not yet multithreaded and on very slow machines on
heavy load this can sum up.
Change-Id: Ia7f456e8558d60aacbe6a689e884342b466063fa
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
We can not offer proper constructor completion with libclang <= 3.6, so
fall back to normal/global completion.
Change-Id: I90bb8d981ae20ed4c228f829ad4267221b92f8a1
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
The renames will improve the readability of the follo-up change.
Change-Id: If1f5ae2a2798c13ce7268e436dae1b3963f01d5e
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
File paths are not unique since e.g. each qbs group in a file is mapped
to a project part.
Change-Id: I7df3f224dd23046b869f2588b8a34eb26cfc0b1a
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
...on shutdown.
Now the slot will be disconnected on destruction.
Change-Id: Ie511bf5400c41eee3245879ea355293e7bb5c7cd
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>