Commit Graph

18 Commits

Author SHA1 Message Date
Marco Bubke
88b167c5da Clang: Fix premature reparsing
cxTranslationUnit() is starting a reparsing if it is needed so in the best
case it is useless. But it can be maybe harmful if the translation unit
isn't already created.

Change-Id: Ie733edac58ab8f7eccb1611ca1554209f8aa8718
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-09-30 11:54:46 +00:00
Marco Bubke
a7e3c07580 Clang: Update includes after reparsing
Change-Id: I783cc0b536f880ce736cddf530f0363691cd6e77
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-09-03 12:01:07 +00:00
Marco Bubke
74e24084c8 Clang: Workaround for clang bug to gather inclusions
We have to revert it if the fix is going in.

Change-Id: I28418e6c7cf6c40afdb5025eb1a52c13a0aa1302
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-09-03 11:56:47 +00:00
Marco Bubke
d041a79a18 Clang: Fix some warnings
Change-Id: I73c432e5fe834ce199204c49b1e0afe43ae605ac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-09-03 11:56:05 +00:00
Christian Stenger
e10ba2e289 Clang: Fix missing includes and compiler warnings for MSVC2013
Change-Id: I88d371a5997576bfd29aedc38353df9ea3a3faeb
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-09-01 07:22:46 +00:00
Marco Bubke
0267f2861d Clang: Send the diagnostics delayed
Change-Id: I6065e51d38c262cf59d977c11c6453dec85a6dfe
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 15:01:18 +00:00
Marco Bubke
d4976e1109 Clang: Avoid double reparsing
The document is now always reparsed after a change.

Change-Id: Iad1d9f78d98f75d5e873de35ac487a8dabc4fc4e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 15:00:48 +00:00
Marco Bubke
f2b7371af1 Clang: Reparse only if files are changed
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>
2015-08-31 15:00:07 +00:00
Marco Bubke
aa6aaee510 Clang: Add brief comment support
Change-Id: I5af23b6694d3d0bf45ed0a30b4d91b350f0515df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 14:59:50 +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
Nikolai Kosjar
3b314e50c8 Clang: Suppress printing diagnostics by default
Triggering completion happens often on invalid code, which leads to
diagnostics from libclang. Suppress those by default, but allow to
inspect them with the logging category:

    qtc.clangbackend.verboselib=true

Change-Id: I802ae58fe1b5244f3228ee73a181ea362de20608
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-29 08:53:18 +00:00
Marco Bubke
b3113bbbc6 Clang: Reparse always before you complete the code
There are two ways to hot fix the dependency problem. First version is to
disable the caching(not the preamble) but it is triggering bugs. Second 
version is to enable caching and reparse before every complete. I opted
for the second version because it is the commonly used path for most
implementations. Later we have to minimize the reparse calls but for that 
we need the cooperation of editor.

Change-Id: I878afb896cbf2338cbeb13d9e596a7776dd49854
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-23 09:08:28 +00:00
Marco Bubke
568d7e7c7d Revert "Clang: Reparse the translation unit for unsaved file changes"
We reparse before every code completion so this code can be removed. We
will reuse some of it later.

This reverts commit 2443f18b85.

Change-Id: Ifcadfaa09b87ce5b58bfe5fe3cbaa2a86a59c5a6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-23 09:08:19 +00:00
Marco Bubke
2443f18b85 Clang: Reparse the translation unit for unsaved file changes
Change-Id: I49711ce040a995f193d36961e010decc27c34c4c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-17 09:08:08 +00:00
Marco Bubke
f9899c2da8 Clang: Little speedup for code completion
...by ensuring that the precompiled preamble is created.

Change-Id: I80784b6a79c40a7e452530e8288783f33f881efc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-15 12:20:59 +00:00
Marco Bubke
65c867db3b Clang: Remove option for code completion
Completion should be faster and the test are still running.

Change-Id: If663e80ce349547b0948412e52b9bf4f76cbb011
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-13 10:30:55 +00:00
Marco Bubke
2b84d7611b Clang: Reorder includes
Change-Id: I324e88c0d295114390c1fac2745c0d2d47637ece
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-16 13:53:30 +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