Commit Graph

4400 Commits

Author SHA1 Message Date
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
42d8672626 C++: Add tests
...for two regressions that were introduced by

    commit e0594fc9b9
    C++: Fix expensive lookup for boost

Change-Id: I1fa01e626da480ca53e04b4709fec458378e7aef
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-31 09:26:00 +00:00
Nikita Baryshnikov
4ec9019104 Debugger: fix metatype declaration macro usage
in places where we do not need it.

Change-Id: Ifb7eba6f46bf79f2cfe968ab8b71cca3a7d51efd
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-08-28 11:04:27 +00:00
Christian Kandeler
ed30c612f4 qbs build: Remove workarounds for fixed qbs bug.
That was most likely QBS-755.

Change-Id: I43d0316113fcca79554bfee9eee9b8bd706fce07
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-08-28 08:13:11 +00:00
Marco Bubke
8e2bb1048d Sqlite: Add endsWith to UtfString
Change-Id: I82ea54a1e23625690192a967b5f33451cdc199af
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-25 12:54:38 +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
Christian Kandeler
6406fd3645 Analyzer: Re-design the diagnostics view.
The old one had a number of problems, mainly due to the awkward
delegate that was used for presenting the data. For instance:
    - Only one diagnostic at a time could be looked at
      in detail.
    - Once it had been opened, it was not possible to close
      such a detailed view again, other than by opening a new one.
We now use a tree view for showing the diagnostics, so users
can show and hide details about as many diagnostics as they
wish. That also gets us sensible item selection capabilities,
so features like suppressing several diagnostics at once can
be implemented in the future.

Change-Id: I840fdbfeca4d936ce600c8f6dde58b2ab93b0d00
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-25 08:42:40 +00:00
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
Orgad Shaneh
bf6e9f0550 Fix tests build with GCC 5
Change-Id: Ia2e0a1c69f73446b45915559294e3348e725ce56
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-18 07:46:22 +00:00
hjk
169a224ec7 Debugger: Use "unused" variables in autotests
Change-Id: I89872cd7792aed5e23331af4ae683dffa3c1291d
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-17 13:51:22 +00:00
hjk
76b5095687 Debugger: Also display subentries for pretty printed char arrays
While the formatted value is usually all that's wanted,
having access to the individual chars is handy at times.

Change-Id: I53b0d0ccfe4289b9b54a1caced4e0bd5ac66d9fc
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 14:18:22 +00:00
Marco Bubke
e2423170b2 Clang: Fix tests for master
Change-Id: Id29c61ef4c12f9a0893df911cd42ac09460f5911
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-12 14:47:38 +00:00
hjk
472d584d5d Debugger: Adjust dumper test to changed dumper output
Change-Id: Ib183c960ff7e737636860e007a16972d5f1f232f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-11 10:31:06 +00:00
Robert Loehning
6fe810f514 Squish: Compare sets directly instead of differences
Generates better output with less code.

Change-Id: I3a5fa02c5aca97561e20dc4ddf4153596a3a60ae
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-11 10:01:41 +00:00
Robert Loehning
5dab51ce9f Squish: Fix tst_default_settings for Ubuntu 15.04
Task-number: QTCREATORBUG-14697
Change-Id: Ia8e41325e61ce6a380dbe0c60cf78c11afc2e99c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-10 13:15:24 +00:00
Eike Ziller
4b1cda0f7c Merge remote-tracking branch 'origin/3.5'
Change-Id: I9baaf42531c10c32a2fa78d2504de213e77fdf82
2015-08-10 11:15:29 +02:00
Robert Loehning
1992d0f230 Squish: Improve tst_CSUP02
Change-Id: I6ddafab93381a3ee82c581299175d18dcad55a1b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-07 08:46:39 +00:00
Robert Loehning
630552f9e4 Squish: Add binary test file
Change-Id: I326812f4cd57f4f91197717ae54a18c675c514b4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-07 08:46:09 +00:00
Eike Ziller
37f6b4397d Merge remote-tracking branch 'origin/3.5'
Change-Id: I1ce0fa92e5c469d591d3030d1a4f168dcee232ba
2015-08-06 11:38:13 +02: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
Marco Bubke
66ba8fe6c5 Clang: Disable test CodeCompletionsExtractor.Constructor
It is caused by clang.

Change-Id: Iaf760f590289a2f2a344f25879141bc37fed6881
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-05 10:42:32 +00:00
Andre Hartmann
302eaf0e69 ANSI: Add benchmark
To have an eye on the parsers performance for
further features, fixes and refactorings.

Change-Id: I6e8ebbd098c9b1c9952416bbe0472fe095bd5d7d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-08-05 08:09:55 +00:00
Marco Bubke
0fd213357e Clang: Tests for code completion
Reparsing in Clang is broken in master. We need to test what is working
in which version.

Change-Id: I620acd4a0a5adc951951e0fc3c0a4096ac9844fe
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-04 16:16:45 +00:00
Robert Loehning
fb6baf9188 Squish: Run tst_CSUP02 on Clang code model, too
Task-number: QTCREATORBUG-11591
Change-Id: I8b4a77d6a1184e225bcf3a9a496e1bdb7cb0d81c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-03 12:41:28 +00:00
Nikolai Kosjar
892cb154b2 C++: Do not let ASTPath calculate line/column for generated tokens
ASTPath uses TranslationUnit::getPosition(), which returns reasonable
results for:

    1. non-expanded tokens
    2. expanded but not generated tokens

The expanded *and* generated tokens case is not handled since there is
no reasonable mapping from generated tokens to a continuous line/column
information. Consider:

    #define DECLARE_FOO int foo; // Multiple generated tokens
    DECLARE_FOO // ...can be mapped to this line, but to which columns?

Since the result where not valid for the expanded and generated case,
ASTPath took the wrong branches. Avoid this by skipping generated
tokens.

Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563
Task-number: QTCREATORBUG-13386
Task-number: QTCREATORBUG-13390
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-31 11:01:02 +00:00
Robert Loehning
bb3b649957 Squish: Skipping tst_opencreator_qbs
qtcreator.qbs contains a syntax error
which Creator does not ignore anymore.

Change-Id: Ifddeea5b81080c1388b35f2c2378f0f2eabbd318
Task-number: QTCREATORBUG-14828
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-30 14:04:40 +00:00
Robert Loehning
84952c5a96 Squish: Fix tst_session_handling for Qt 5.5
Change-Id: I9347656c659055472cdda42fe07348c07bc3037e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-28 13:48:37 +00:00
Orgad Shaneh
129918d8ee Clang Tests: Autodetect gtest/gmock on linux
Should work at least on Arch Linux and Debian family.

Requires packages:
* Debian: google-mock, libgtest-dev
* Arch Linux: gtest, gmock (AUR)

Centos provides gmock source in gmock-devel package, but it doesn't provide
gtest source (in gtest-devel), so it must be downloaded and configured.

Change-Id: Ia507e8209848cb05743bb6f5956ce052f5558010
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-28 11:15:28 +00:00
Robert Loehning
c70502d691 Squish: Fix remaining WELP tests for Qt 5.5
Change-Id: Ibe0df94d833ac2a10d43884ada3c1fe3d5de0b98
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-28 09:39:02 +00:00
Nikolai Kosjar
91429aa752 Clang: Fix completion position for clang and proposal
* Rename some members/functions to clarify their meaning.

* Ensure that the position for the proposal widget is at start of the
  identifer, so that the filter prefix will be found correctly in the
  GenericProposalWidget. For certain cases the completion were
  calculated but the widget was never shown:

  Case 1:

    void f()
    {
        <COMPLETION_CURSOR>
    }

  Case 2:

    void f()
    {
        st<COMPLETION_CURSOR>
    }

  Case 3:

    if (true)
      <COMPLETION_CURSOR>

  Case 4:

    foo. mem<COMPLETION_CURSOR>

Change-Id: Ie79e01e8a22f8ec306136ec4ccbfffd544edd573
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-27 13:19:02 +00:00
Nikolai Kosjar
49b1d35778 Clang: Clean up ClangCompletionContextAnalyzer
Change-Id: I899cc5cffc389ef023b35825807bde469bb6d31d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-07-27 13:18:58 +00:00
Robert Loehning
fa67536272 Squish: Fix tst_WELP01 for Qt 5.5
Change-Id: I8589b6b5a4ea9c50a49fc459532f043503786816
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-27 09:45:17 +00:00
Robert Loehning
0bf8768152 Squish: Avoid float rounding issues in tst_qml_js_console
Old value fails with Qt 5.5.0.
Changing binary value 0.00110011 to 0.0011.

Task-number: QTCREATORBUG-14757
Change-Id: I6de62241089d50256cfef6f7cba61389da58b6ed
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-24 11:05:18 +00:00
Christian Kandeler
d489f00f64 Fix qbs build.
Commit d765cd73a2 pulled in more stuff into the diassembler.

Change-Id: I83e0907abaef84a9cebb3c63d957182707af012d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-24 08:04:44 +00:00
Nikolai Kosjar
8a06df6235 Clang: Clean up unittest.pro
Change-Id: Icd3f1ab0b9b9557b0bd4cdfc60130e0c8bd15609
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-23 11:48:32 +00:00
Nikolai Kosjar
e4748fe801 Clang: Typedef some often used types
using CodeCompletions = QVector<CodeCompletion>;
using CodeCompletionChunks = QVector<CodeCompletionChunk>;

Change-Id: Id729a43566c23dc000e44d79ccf4a49e4f235f51
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-23 11:48:26 +00:00
Marco Bubke
ae5d92d618 Clang: Refactor ClangCompletionContextAnalyzer
Change-Id: Ib42ddc672da8b068591129e2e0b9652d3e07ad58
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-23 11:13:05 +00:00
Orgad Shaneh
68409fb982 Debugger: Fix tests compilation
Broken by d765cd73a2

QWidget is included in runconfiguration.h, so QT = widgets is required.

Change-Id: I254ae5dca8f537b5d8e3f8977be50cadcaa053b4
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-23 09:36:50 +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
Robert Loehning
f11d5791a4 Squish: Timing issues in tst_openqt_creator
- speed up the test by not waiting for C++ parsing
- measure the time for parsing qtcreator.pro and fail if too long

Task-number: QTCREATORBUG-10733
Change-Id: I1d00812a3e8e56a5ee6e1828bc60aa6eb3d2da41
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-23 08:26:24 +00:00
Orgad Shaneh
0926d63d56 Sdktool: Only execute tests with -test argument
+ add an autotest that executes it

Change-Id: I7a9e1cd409bccd77776eefb0e832c92c51bc2bd5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-20 08:45:43 +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
5df8085529 Clang: Remove the hint and snippet field from the CodeCompletion
It is not used and is producing overhead.

Change-Id: I1398b18a40c0f5c0b90fe4c058996d7eb109f9f2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-16 12:54:58 +00:00
Nikolai Kosjar
8d23d80139 Clang: Clear the project part completely on remove
Change-Id: I6fdb1766a3b407fbaaf86b0216a0dd710673aec1
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-16 12:31:15 +00:00
Robert Loehning
184b161224 Squish: Adjust expectations when using clang codemodel
Change-Id: I204ff6eb3820f67d50f8f4b77012d538741cec47
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 12:18:37 +00:00
Marco Bubke
0bc18df655 Clang: Do not work on unspecified values in ProjectParts::remove
Change-Id: Icc322bc64988cbc1b5ec4e6d6474b1b6b956c667
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-16 11:51:13 +00:00
Marco Bubke
fbd549f213 Clang: Prevent double spaces for clang snippets
Change-Id: I62f9b9c217570dd6dafc45719e898cc2ac4d2937
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-15 13:53:52 +00:00
Marco Bubke
945c0fbc71 Clang: Add code completion for keyword snippets from clang
Change-Id: I91f7af74d811769424928bce1c586a30b5794d6f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-14 16:24:30 +00:00