...as it is not needed. Just provide the compilation arguments as part
of the Document.
As a side effect, re-initializing the backend after a crash is cheaper
and will not freeze the UI anymore (referenced bug).
Task-number: QTCREATORBUG-21097
Change-Id: I866e25ef1fd5e4d318df16612a7564469e6baa11
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This is long overdue since some names were simply wrong and/or
misleading. Also, some of the old names were long enough to almost get
crazy.
The renaming starts from ClangCodeModelServerInterface and
ClangCodeModelClientInterface and affects usages and related functions.
For the ClangCodeModelServerInterface, categorize the messages in
- messages that require a response (request*)
- notification messages (the remaining ones)
Change-Id: I5342ed8e0d87404ee72f3c3766fd8ef7505defb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...now that parsing and creating the preamble is faster due to the
skipped function bodies.
As a consequence, we can remove all the extra jobs that were needed to
get an initial AST faster.
Change-Id: I79a66b8a0e8a180850af6daf353d9a679089bbb1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This is in prepration for a follow-up change, which introduces a state
where the Document is not yet parsed (it was reset) but the queue has
jobs.
All jobs get this requirement except those that generate an AST.
Change-Id: Ifcbb704e54108b40797180514c5ad3f3768ef10b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Do what can be done in the constructor instead of relying on the
clients.
Change-Id: I5f475b5309afb37e34d228e54ad3c12f1698d72b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If a parse or reparse operation fails, the corresponding translation
unit is "not intact" anymore and further job requests for that
translation unit will be silently discarded without notifying the
plugin. This is especially problematic when the plugin expects/waits
(for) a certain message.
A parse/reparse can fail due to e.g. an invalid commandline or an
internal crash.
In such a case, ensure to send some dummy results.
Task-number: QTCREATORBUG-18864
Change-Id: Ida9b8066fd55e64027a9b0d8bd5cf365b16a7356
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
...to free some memory.
The translation units of the 7 most recently used documents ("hot
documents", tracked by document visibility) are kept in memory.
Translation units of other documents are suspended and will be resumed
once they become visible again.
The resumption of a translation unit needs the same time as reparse
(since it is a reparse effectively).
The number of hot documents can be modified by the run time environment
variable QTC_CLANG_HOT_DOCUMENTS=N. Visible documents are always hot.
Task-number: QTCREATORBUG-11640
Change-Id: I68ecd2b1373e303372300203e42d90f65a4b39b3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This is in preparation for a follow-up change that will add jobs that
also operate on invisible documents.
Change-Id: I2a0fc3b95cc5ab2e267429134a534df64c901376
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
...to avoid ambiguity in regard to a new enum in a follow-up change.
Change-Id: I4f732b5200ed674b6708510ac8de0a795afe52da
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This could happen, e.g. with this message order:
>>> updateTranslationUnitsForEditor()
add job<1>
run job<1>
>>> updateVisibleTranslationUnits(Utf8String(), {})
>>> updateVisibleTranslationUnits(path, {path})
add job<2>
finish job<1>
run job<2> -- Ops, nothing is changed but job<2> is started
This led to an outdated translation unit (e.g. wrong highlighting).
Now JobQueue checks for duplicates in the queue and checks all the
currently running jobs.
Change-Id: I05843fddcbd21ce0489681c283227c0027ded428
Reviewed-by: David Schulz <david.schulz@qt.io>
This enables a job per translation unit instead of per document.
This does not change any behavior yet.
Change-Id: Iafb8dab5da32b53dbb3010c16241bf89cbb81b38
Reviewed-by: David Schulz <david.schulz@qt.io>