Commit Graph

26 Commits

Author SHA1 Message Date
Nikolai Kosjar
7b631d484d Clang: Add testUnsavedFilesTrackingByModifyingIncludedFileExternally2
Same test as the first version, but without having the header open in
the editor. This one is also skipped since we can't make it reliable
without adding extra messages.

Follow up changes will improve the names of both tests and will make
them both reliable so that the can be activated again.

Change-Id: Ie3ca52e01aedd612bc07e7429dd64d92eb1a23b5
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-14 10:11:08 +00:00
Marco Bubke
250c8d662b Clang: Add UpdateTranslationUnitsForEditorMessage
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>
2015-10-13 14:03:11 +00:00
Nikolai Kosjar
a5674be613 Clang: Unregister file with project immediately on project close
Ensure that first the editors unregister with the removed project part,
then unregister the project part.

This makes testing and following the message logs easier.

It also fixes the following race condition:
 * Unload project of opened file
 * Immediately close the editor before a new project part is calculated
 ==> The editor is closed, but the translation unit is not properly
     unregistered.

Change-Id: I618930d221323435ba60ac6c051380bccc9fdaf1
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-01 13:44:48 +00:00
Marco Bubke
b412eb81ea Clang: Add revision and completion management
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>
2015-09-28 15:46:15 +00:00
Eike Ziller
c868b9f3ed Merge remote-tracking branch 'origin/3.5'
Change-Id: Ife5fdcd71b0adc99d4297a28a64515e9e93d7864
2015-09-04 09:19:28 +02:00
Nikolai Kosjar
cfebd9bf7f Clang: Tests: Tweak time out for writing file
Change-Id: Iaf1294776be19805934eb152a9e09f3c68b9d5f6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-02 10:40:42 +00:00
Marco Bubke
9e25fa9a66 Clang: Disable ClangCodeCompletionTest::testUpdateBackendAfterRestart
The integration test has to be rewritten!

Change-Id: Id06f9a3ceb54cf6836f4ca1a745e20fefc6a5391
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 15:02:40 +00:00
Marco Bubke
7eee8061f6 Clang: Add unsaved files messages
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>
2015-08-31 15:02:19 +00:00
Marco Bubke
6e14eb6940 Clang: Rename ForCodeCompletion in ForEditor
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>
2015-08-31 15:02:02 +00:00
Marco Bubke
b278dc87ca Clang: Add diagnostics
Diagnostics are now moved to the clang backend process. Fixits are
supported too.

Change-Id: I20faacf466bbf78dec479220c3d7b336a47bc453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 14:59:16 +00:00
Marco Bubke
ec4d002857 Clang: Rename command in message
Change-Id: I1e2671d15b0db3c670b86dd0d4bed5ee09e866f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-25 12:54:27 +00:00
Nikolai Kosjar
64d8ac4880 Clang: Fix showing signature tooltips for functions
...and others in the generic completion widget.

Task-number: QTCREATORBUG-14874
Change-Id: I75122eaf364d740b0a64ca514b31a26c5c8ea673
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-08-10 09:35:01 +00:00
Marco Bubke
8c3c882a8a Clang: Fix parsing of enable_if_t
Task-number: QTCREATORBUG-11864
Change-Id: Ifd0d3482bc4f4373394734d4b173304db32a6a2d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-05 10:50:34 +00:00
Nikolai Kosjar
5643a45a83 Clang: Fallback to global completion if function call completion fails
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>
2015-07-23 11:18:55 +00:00
Nikolai Kosjar
c6b52267f4 Clang: Fix sending (un)register translation unit
Handle the following use cases:

  1. Editor is opened
    --> Register file at backend.

  2. Close editor for which a project part exists
    --> Unregister file with project part.

  3. Close editor for which no project part exists (anymore)
    --> Unregister file with empty/default project part.

Change-Id: I2b253004a920cccef989876538ab552eacf6b45c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-20 13:08:32 +00:00
Nikolai Kosjar
420bc69739 CppTools: Use project part ids instead of file paths
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>
2015-07-20 09:49:14 +00:00
Nikolai Kosjar
95c90dcd42 Clang: Tests: Use global temporary dir to remove test file later
Change-Id: Ic31428db15ebbc3a4fc5d5a24723d3a557b77b58
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-20 09:48:40 +00:00
Nikolai Kosjar
73cee4d64a Clang: Tests: Mini refactorings
Change-Id: I4a058d4c68c126d74badfc699a239ef9b2790f3a
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-17 11:33:49 +00:00
Marco Bubke
89bc1fc4c4 Clang: Rename filePaths in ids
UnregisterProjectPartsForCodeCompletionCommand is using them as ids
and not as file paths.

Change-Id: I13a82c1995c60bdb60c72f4fd794aa354fcbb4ef
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-15 08:57:42 +00:00
Nikolai Kosjar
7f4ce089d3 Clang: Tests: Make waiting for reloaded document more robust
testUnsavedFilesTrackingByModifyingIncludedFileExternally() is flaky.

Apparently the hard coded timeout is not enough for all circumstances.

Change-Id: I9f884e488d3c4bd5398e505ecee122912d946e6b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 09:30:01 +00:00
Nikolai Kosjar
521d7cf7a3 Clang: Send in-memory generated ui header to backend
Change-Id: I59e9b1f10d1a7fe9a75cbe84117aa5cc04460dab
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-09 08:06:26 +00:00
Marco Bubke
ed27414f48 Clang: Split clangcompletion.[h|cpp]
First step for refactor them.

Change-Id: If9de084e39ddf31317035ccbbc1fd57d7797d193
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-06 12:41:01 +00:00
Marco Bubke
5c74f34ebf Clang: Rename ModelManagerSupportClang::instance to instance_forTestsOnly
To make it clear that it is for testing only.

Change-Id: If257b0049e87c834b24073991f173bfc1b3e93e7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-06 12:12:06 +00:00
Marco Bubke
5e2942a5bd Clang: Use member instead of pointer
It makes the resource allocation much more clear.

Change-Id: Ib276e089dc3db551171373d72e9b54c9d87b4c8c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-01 11:52:54 +00:00
Marco Bubke
1402c067b1 Clang: Rename CodeModelBackEnd in ClangBackEnd
Change-Id: I13e8a458634110456375956d4d4da7239c86957f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-16 13:29:27 +00:00
Nikolai Kosjar
23b8a3b2e8 Clang: Use completion through backend process
This makes us independent of libclang crashes for completion.
Re-parsing for highlighting still happens in the Qt Creator process.

Run in verbose mode:
    qtc.clangcodemodel.ipc=true

Run tests:
    -test "ClangCodeModel"

Task-number: QTCREATORBUG-14108
Task-number: QTCREATORBUG-12819
Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-10 10:15:40 +00:00