Commit Graph

4400 Commits

Author SHA1 Message Date
Marco Bubke
c209aaf22e Clang: Fix highlighting issues
...for macros, typedefs and enums.
	
Change-Id: I926e7238695caefd7f4463dbe0cf5b428aa98c1a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-07 08:41:03 +00:00
Robert Loehning
8abd9fae80 Squish: Update openCmakeProject()
Change-Id: I21f5e40b2da0b2a9b37752c2f5e15c4efd687ca5
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2015-12-03 13:43:07 +00:00
Christian Stenger
696b8e9cc6 Squish: Raise timeout for qml refactoring
As the navigation treeview is updated asynchronously this might
take more time.

Change-Id: I5002fc547158147d921a5d19098f2cfc3a14336f
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2015-12-03 09:50:57 +00:00
Marco Bubke
493a2a6189 Clang: Fix slowness of code completion after opening the file
Task-number: QTCREATORBUG-15429
Change-Id: I9a8a582fb3c59a960425f83eb8e7b436f15d1c1a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-02 12:37:25 +00:00
Robert Loehning
66e7b77d88 Squish: Update selection of code model
Change-Id: Iee76086dfd886dd8d61db3cfe4600a5eedd36cb7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-01 14:38:36 +00:00
Marco Bubke
a992a1064c Clang: Update document annotations only if document is visible
So no reparsing is happen for invisible files.

Change-Id: I8bf3fe8aed38b30ceeabc50ba2f216acc4b8b718
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-01 13:59:53 +00:00
Marco Bubke
514a96c75f Clang: Don't reparse before code completion
Task-number: QTCREATORBUG-15365
Change-Id: I37f623449fa95268f1a0a5d5e66d75df0582c183
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-30 15:49:19 +00:00
Nikolai Kosjar
ed4bfff644 Clang: Rename "Editor Updates" to "Document Annotations"
"Editor Updates" are not to the point since what we generate is for the
document.

Change-Id: I94ceeca5c85c7cf01cc659ca55320d07010c8617
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-30 11:11:32 +00:00
Nikolai Kosjar
1410bf3faf Clang: Use "clang" prefix plugin files
...for consistency and to avoid future file name clashes.

Change-Id: If595c8debfa1ceb01a1bb0ed34649fa513660503
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-30 11:04:07 +00:00
Nikolai Kosjar
6a1fc699fd Clang: Tests: Use google test dir from qmake variable
...so that we can compile the tests without environment variables:

    qmake LLVM_INSTALL_DIR=/the/path1 GOOGLETEST_DIR=/the/path2

Change-Id: I40633988d325720397dea28bd13b957a31712a9d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-30 09:58:36 +00:00
Christian Stenger
e2097fe8ec Tests: Fix compile for OSX...
...as the define points to a path containing a whitespace which confuses
moc this must be escaped.

Change-Id: If5fe0e7b3eeb0f4a46df4df3eb8236c94587ea88
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-30 07:18:31 +00:00
Marco Bubke
a610c6740b Clang: Fix names for visibility changes in translation units
Change-Id: Iafee06b8f39610f4245ad86eec2b6d442acc61e2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-27 12:27:47 +00:00
Christian Stenger
ce2a891c48 Tests: Fix sdktool test
Change-Id: Idc21354d3f546c1aaff7d1481c80190c6c1c366c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-27 10:16:28 +00:00
Nikolai Kosjar
6cab8e6f4a Clang: Tests on MSVC2013: Disable warning 'unreferenced formal parameter'
Change-Id: Id3889a2529e5d816617806ade20323504e019384
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 15:34:34 +00:00
Marco Bubke
7ce9ef9db4 Clang: Integrate highlighting results from backend
Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 15:19:27 +00:00
Nikolai Kosjar
216f110385 Clang: Tests on MSVC2013: Fix file name clashes
The following files conflicted:

	src\tools\clangbackend\ipcsource\translationunit.cpp
	src\libs\3rdparty\cplusplus\TranslationUnit.cpp

	src\libs\3rdparty\cplusplus\Type.cpp
	src\tools\clangbackend\ipcsource\type.cpp

	src\libs\3rdparty\cplusplus\Symbol.cpp
    src\plugins\clangcodemodel\symbol.cpp

Change-Id: If7865570cd70e39e25cc8d508f771c8023288f0c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 13:54:21 +00:00
Nikolai Kosjar
6687b60a99 Clang: Tests on MSVC2013: Fix string literal concatenation
Change-Id: I1b1cefbace16cf0161bfe522d2ac37704e374713
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 13:17:32 +00:00
Marco Bubke
8c3959534d Clang: Add current and visible editor message
Change-Id: Ifd88bc032388ae7a8d3dbc0f1f5746665074cc18
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-25 14:48:35 +00:00
Marco Bubke
9310c02bc8 Clang: Add better diagnostic sending
We send first the current editor, next the visible editors and the end
everything else.

Change-Id: I4a7b5924ffe563d6a74251739ddedcd005ce046c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-25 14:23:44 +00:00
Marco Bubke
2e499b73d6 Clang: Filter scope operators
Scope operators are not really user defined.

Change-Id: I1ab08dc3db7c39b98da02b6ef10bf78b75a6856d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-25 14:18:42 +00:00
Nikolai Kosjar
609bc2a389 Clang: Avoid needless reparse after first parse
Change-Id: Ie97818f29d1df61380cd1c22ef2598091050b10d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-23 14:22:39 +00:00
Robert Loehning
114e52b3f0 Squish: Update video's title in tst_WELP04
Change-Id: Ibf9d75324332be4e3223323ed8aa4cc34b01612e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-23 11:41:29 +00:00
Nikolai Kosjar
0498fb68ff C++: Revert lookup to 3.4.2
...which was least buggy.

The bugs fixed by the changes we revert here (highlighting/completion
for code involving templates) were minor compared to ones we currently
have. Those bugs will be addressed by the clang code model anyway.

Relevant commits were collected via:

  $ cd ${QTC}/src/libs/cplusplus
  $ git log \
   --no-merges \
   --format=oneline \
   v3.4.2..HEAD \
   -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \
      ../../plugins/cpptools/cppcompletion_test.cpp

From this list the following were skipped due to irrelevance:

  88c5b47e53 # CppTools: Minor cleanup in completion tests
  e5255a1f5c # CppTools: Add a test for ObjC not replacing dot with arrow
  5b12c8d63a # CppTools: Support ObjC in member access operator tests
  9fef4fb9ca # CPlusPlus: Fix warnings about overriding visit(...) methods

There were only minor conflicts while reverting those.

This changes touches so many files because there were quite some
cleanups and renames after the 3.4.2 release.

Task-number: QTCREATORBUG-14889
Task-number: QTCREATORBUG-15211
Task-number: QTCREATORBUG-15213
Task-number: QTCREATORBUG-15257
Task-number: QTCREATORBUG-15264
Task-number: QTCREATORBUG-15291
Task-number: QTCREATORBUG-15329
Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-19 14:48:38 +00:00
Lassi Hämäläinen
10e947f65f C++: Fix crashes with the pattern "enum class operator A"
Parser parsed the pattern as an enum declaration the name of
which is a conversion operator. Add check to disallow keywords
after enum-key (enum, enum class, enum struct).
Add tests tst_AST::enumDeclaration and
invalidEnumClassDeclaration.

Task-number: QTCREATORBUG-15341
Change-Id: Ia037f00184c1d7e5b0374f39331bb6748f8d90b1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-18 15:09:40 +00:00
Marco Bubke
bcd93b594e Clang: Extract highlighting information
Prepare the move of the semantic highlighting to the clang back end. We
have it under tests too so it should be quite easy to make changes or
corrections.

Change-Id: I5706a8a06fde5a9ba2eba3a8ba62782102ac0bd3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-17 12:41:37 +00:00
Marco Bubke
7fb4315da2 Clang: Adapt to new Google Test project directories
Google mock moved to github and merged with Google Test.

Change-Id: I66639532be1cd399c47dfd4511430b2d65b76b23
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-16 14:39:12 +00:00
Nikolai Kosjar
f7741ef63c Clang: Report only diagnostics that can be shown in the editor
Change-Id: I9c258159d240c6ba7eeff34702d8512d9220b3af
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-16 14:18:37 +00:00
Adam Strzelecki
9b3723d6f4 CppTools: Do not highlight instantiation as call
Underlying C++ model sometimes marks C++ object instantiation using initializer
as a (forward) function declaration. This leads to incorrect highlighting of
object variables as if they were function calls.

C++ model however marks in this case (and not any other case) such symbols as
ambiguous function types, see CPlusPlus::Bind::visit. This change skips such
ambiguous functions for highlighting as function call.

Also add test case for related bug report.

Task-number: QTCREATORBUG-15212
Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-16 10:18:05 +00:00
Orgad Shaneh
0bcddcd014 C++: Limit template instantiation depth
A recursive template generates infinite expansions.

Consider the following example:

template <class R1>
struct Base
{
};

template<typename R>
struct Derived :
  Base<
    typename Derived<typename Base<R>::type>::type,
    typename Derived<typename Base<R>::type>::type
  >::type
{};

R is instantiated as Base<R>::type, which causes another
instantiation of R into Base<Base<R>> etc...

This is not a solution, but a workaround.

Task-number: QTCREATORBUG-15141
Change-Id: Ib04f70275e07919e2cb6c7fb61a2045bd52f4a7d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:40:20 +00:00
Orgad Shaneh
3ab5527a83 C++: Produce copyable debug output in CheckSymbols test
Change-Id: I338352eaf6372316d2dc8f0f3ad961b7e8d8cbdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:15:49 +00:00
hjk
0f9e2baa1b Debugger: Adjust QFileInfo dumper for Qt 5.7 on Linux 32 bit
Change-Id: Idb14d81aa3546af0e7a21922fbb6d551ecbc1b06
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:57:37 +00:00
hjk
aa221121b6 Debugger: Pass down expanded inames in LLDB tests
... as well as the 'autoderef' flag. A lot of dumper tests were
failing even though the dumpers themselves were ok.

Change-Id: I198784d95eb0004e81bfab995121e048b1722c66
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:16:17 +00:00
Niels Weber
58804ad823 Fix two typos in comments
Change-Id: Iacb728715b11ca3a9f82d82cca49889eea9dd59b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-11 06:56:08 +00:00
hjk
d6bb579a41 Debugger: Fix QAtomic* and QShared* dumpers with Qt 5.6/C++11
With C++11 we use std::atomic in the ref counter, giving yet
another possibility of structure member names. Instead of
trying to keep up with that, access the binary data directly.

Change-Id: I572f727eb9dab37ac1ca07594d55bea723050817
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 13:49:25 +00:00
Christian Stenger
9ce0c9cd1e Tests: Provide basic boost version check
Change-Id: I38e38fdb129c172cb0056b6f96146a7e29d7288a
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:52 +00:00
Christian Stenger
e7df1233f0 Tests: Provide way to specify boost library include path
Change-Id: I162343f188c5f9c8849d93faf120a424ec41e6f8
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:45 +00:00
Christian Stenger
8cdc648139 Tests: Fix compilation
Change-Id: Ia63f3afd7ae3e76f78ffea31702ba5968b74b418
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 10:11:49 +00:00
hjk
a4a9529403 Debugger: Make boost::container::list autotest pass again
... by adjusting the expectations on the exact type display
and trying two possible versions of structure member names.

Change-Id: I817aeb787b905cb22c6f68856043a29db3e79e59
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 10:08:20 +00:00
hjk
b8a8fe34a2 Introduce a Qt-free JSON implementation
This is essentially QJson with Qt replaced by std:: features.

This is useful to have in circumstances where a Qt dependency
is undesirable, e.g. for the Qt Creator debugger protocol
implementation in our CDB extension.

Change-Id: Iec79c6b23b1e717ce1b6f4d38755287d1f479c13
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-09 08:25:11 +00:00
hjk
e5e3243dd1 Debugger: Fix std::string display for GCC 5.x
Task-number: QTCREATORBUG-15110
Change-Id: Ic1bcdf1b73e0013068e56a5d8804da42cdb2c237
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-06 14:05:07 +00:00
Nikolai Kosjar
2ca473d59e Clang: Print command line args for debugging
...if qtc.clangbackend.verboselib=true.

Change-Id: Ibba408db955892daf055b2050d810ce55b9d8913
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-06 11:55:12 +00:00
Nikolai Kosjar
23fa5a7efd Clang: Provide the language option to the backend
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>
2015-11-06 11:54:16 +00:00
Nikolai Kosjar
08fcb7f317 Clang: Filter out invalid diagnostic ranges
Apparently libclang might return invalid ranges.

Now we discard the invalid ranges. Since there is a diagnostic location
(in addition to ranges) the editor will still display an indication for
the user.

Task-number: QTCREATORBUG-15272
Change-Id: I351e136b9925a53fb2273a394e17873c5533798d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-06 11:33:12 +00:00
hjk
f58ab8d723 Debugger: Fix std::set<...>::iterator dumper for GCC 5.x and C++11
Change-Id: Icaca7da1f5ae6f958ae0fdaf217bde611d049916
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-06 10:08:48 +00:00
Marco Benelli
30ef3a3afc QmlJs: added a new test case in reformatter test.
Change-Id: I4f6c78cd9d2a2e407ef26e498418617efeee5bba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:15 +00:00
Marco Benelli
b4e42171fd QmlJs: updated .pro file in fileformat test.
Change-Id: I1c6fb32820d8a5e58900c2812f43045bd588aff2
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:04 +00:00
hjk
d5101b5d91 Debugger: Standardize on all-lowercase for protocol options
CamelCase might be more Qt-ish, but the backends tend to use
lowercase only.

Change-Id: I04b9b7305b54226f27b70151115050c4816f911f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:18:50 +00:00
Robert Loehning
9ca4648081 Squish: Replace white box code with GUI interaction
Change-Id: I513142498768dfb3f8373d00f0b04edba0dfd06f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-30 10:46:53 +00:00
Robert Loehning
e94de191b0 Squish: Update objects of Qt version settings
Change-Id: I2fce4d860a70230519d7f56e58d88a03dbb379ba
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-30 10:46:24 +00:00
Robert Loehning
1a9e097c80 Squish: Update tab's name in tst_installed_languages
Change-Id: I22f69a589d8bb32c3fa7d984ada67043340e5e27
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-29 13:13:40 +00:00