Commit Graph

5234 Commits

Author SHA1 Message Date
Ivan Donchevskii
053b2090b4 Clang: Fix C++ paths search in compiler options builder
Take into account paths from MinGW and NDK Clang.

Fixes: QTCREATORBUG-21540
Change-Id: I00906c75dc4ddeb92fe5942a0222285d8ce2eb9d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-21 13:18:22 +00:00
Orgad Shaneh
5170dd0858 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8bf92c8effdee0e1085730cb975ff88c8ad85fc
2018-11-20 19:13:13 +02:00
Marco Bubke
2a65be107b ClangPchManager: Filter missing includes recursively
Missing includes prevent the creation of PCHs. So removing includes which
directly or indirectly point to missing includes is a requirement for
working PCHs.

Task-number: QTCREATORBUG-21529
Change-Id: Id55be164df590149fe1ab55c2a3a90b8b5e3bfa7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-20 14:25:08 +00:00
Marco Bubke
64a3a130ac Clang: Add BuildDependencyCollector
IncludeCollector is renamed to BuildDependencyCollector. It is now
returning a BuildDependency instead of individual getter. The test coverage
is improved too.

Task-number: QTCREATORBUG-21379
Change-Id: Ifc2d1c40c85772cf498c21968de526f4408b6023
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-20 14:24:03 +00:00
Orgad Shaneh
f73ed6bb54 UnitTest: Fix compilation
Change-Id: I4207a6f8fc162336807c3f037a11578c1f8632ed
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-19 19:43:25 +00:00
Christian Stenger
84576d3098 Dumper: Fix displaying enums with LLDB
Prioritize displaying as enum if a type is known
to be an enum. Otherwise this would just end up
get displayed as string representation of its value.
Enable respective dumper tests.

Change-Id: I3e5406e14a68f02741b6144bb54528b72cc8192d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 14:22:45 +00:00
Christian Kandeler
424923817c SSH: Implement X11 forwarding
Change-Id: Ia7b15e784cb098bc7c6c6be2748d772192187e97
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-19 09:12:31 +00:00
Eike Ziller
3d1d9aae2e Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/winrt/winrtdevicefactory.cpp

Change-Id: I33b8697e2ebf2bea051d7f1144449e0743ee16a5
2018-11-19 10:00:18 +01:00
Orgad Shaneh
0ed6409618 Clang: Remove duplicate CXX flags
Most of the flags appear twice on llvm-config-7 --cxxflags (at least on
Debian).

Change-Id: I9c5630d61472fa37bce998ec541a0ab561b83722
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-15 08:57:34 +00:00
Christian Stenger
3f42cd724e Tests: Allow dumper tests with Qt5.11 and Xcode 10
qmake brings up a warning regarding using Qt5.11 in
combination with Xcode 10. This seems to get handled
as error inside the tests - so, disable the warning.

Change-Id: I6d2918789580fd332048c85e0c4fc75a9635deb6
Reviewed-by: hjk <hjk@qt.io>
2018-11-14 13:50:24 +00:00
Nikolai Kosjar
5b12ada2dc Clang: Fix completion icon for members in member init list
Change-Id: Ib02320dcf4de7cbb8ac6fbf29d1929edae77591a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-14 07:38:19 +00:00
Christian Stenger
c2422f4855 Squish: Fix using locator
Change-Id: Ifbc693439cbcd4146f1b18e67f1f1d6bc49162e5
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-11-13 13:48:39 +00:00
Eike Ziller
3666e3aaeb Merge remote-tracking branch 'origin/4.8'
Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
2018-11-09 13:30:40 +01:00
Robert Loehning
87332d5c8d Squish: Test initialized refs to smart pointers in tst_memberoperator
Change-Id: I7c48ca5c4d05f4ea36dd82bde3a19a386580452a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-08 15:28:38 +00:00
Alexandru Croitor
de32a631c3 [Debugger] Fix bitfield values to show up correctly using lldbengine
The bitpos value returned by lldb is the bit offset relative to the
beginning of the type, there is no need to do an extra modulus
operation.

Adjust dumper test to add the previously failing case.

The failing case happens when the class containing the bitfield has
more members in front of the bitfield.

Change-Id: I93678f78e6799843558ec53342a0ed49cac74f48
Reviewed-by: hjk <hjk@qt.io>
2018-11-08 15:12:10 +00:00
Marco Bubke
9b1e7e440a Clang: Add BuildDependenciesStorage
Task-number: QTCREATORBUG-21378
Change-Id: Ibcb90239d240653b21f12a7b96a7775e5b0b4319
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-08 14:34:02 +00:00
Christian Stenger
ce9b813c37 Squish: Adapt tst_memberoperator to CCM changes
When using the clang code model the operator '.' does no
more automatically change to '->' before applying a proposal.
Instead it points out whether a proposal requires to change
the operator when applying.
So, adapt the test and losen some condition to be able to
keep this test generic and maintainable.

Change-Id: I215fba9bfa98d5d056cd9493d7aa7192fb7a963f
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-11-08 13:19:38 +00:00
Marco Bubke
6eb620238b Clang: Refactor FilePathId
We don't need the directory id any more. It's not used widely any way.

Task-number: QTCREATORBUG-21443
Change-Id: Ia95ea4c72fe9530ac56262f61f17faca04d313ba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-08 12:51:15 +00:00
Ivan Donchevskii
0fabde31ab CompilationDatabase: Speed up parsing project file
Avoid expensive indexOf and check for the exactly same flags
before applying the full filter.

Change-Id: I6936b2022a2b439aad7bf0a65280c3db16d00c34
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-07 12:32:34 +00:00
Marco Bubke
f644ea0a01 ClangPchManager: Add BuildDependenciesProvider
It is still unfinished but I want to add other changes first.

Change-Id: Ife7ac56576f85d800633ea1e8f1c3f4f16486d5f
Task-number: QTCREATORBUG-21377
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-06 11:52:11 +00:00
Christian Stenger
ace6708b88 Debugger: Fix display of null references
Fixes: QTCREATORBUG-21210
Change-Id: I529f38aad9b93707e09ffdd28885e46c2cfd158c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-11-06 11:26:05 +00:00
Eike Ziller
1473bc5891 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggermainwindow.cpp
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/winrt/winrtdevicefactory.cpp
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h
	tests/unit/unittest/unittest.pro

Change-Id: Ie9b80b87a8a4fa81baf72a2daa7919b21371c15e
2018-11-06 09:20:00 +01:00
Christian Stenger
c355379a01 Tests: Fix disassembler auto test
Output has changed with 06a78b6264.

Change-Id: I32d401bf1111fe037b04873ff223cb916b4f886e
Reviewed-by: hjk <hjk@qt.io>
2018-11-05 10:07:59 +00:00
Christian Stenger
02760eafc8 LSP: Fix auto tests for Linux and macOS
Some URI/URL functionality (especially file protocol)
is based on the underlying file system and operating
system respectively.

Change-Id: I6a0956bbef292ff964aec581c2555c54d6d0dbe3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-11-05 09:33:30 +00:00
Ivan Donchevskii
3c3b75cef1 CompilationDatabase: Fix command line parsing
Handle cased when -x{kind} is one option.
Skip -o output files.

Task-number: QTCREATORBUG-18402
Change-Id: Id8a8612bed2db2b35f17b0968a4ff529e7a66194
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-02 14:12:34 +00:00
Christian Stenger
6cdcae528d Squish: Ensure text cursor has safe position
When re-opening a file that had been opened and closed inside
the current active session we open the file at the last used
editor position.
Provide a function to explicitly jump to the first line of an
editor.

Change-Id: I0602d8ef46e80a20385fd1b205812776d6666326
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-11-02 12:02:42 +00:00
Christian Stenger
42ced7ac94 Squish: Test latest added pasting service
Change-Id: I2b062a3c3c0ad172e0f5ad3b37262c9278351a48
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-11-02 12:02:35 +00:00
Andre Hartmann
a59097086b CppLocatorFilter: Fix result sorting
* Fix rating items with startsWith()/contains() higher
* Rate matches in function parameter list lower

Task-number: QTCREATORBUG-19377
Change-Id: I2ea4c3ba96cd086aef82627326fa0888f700850f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-02 09:32:41 +00:00
Ivan Donchevskii
f604c8a77c CompilationDatabase: Support both code models
Extract headers, defines and fileKind from flags in
order to have complete project parts.

Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 14:52:05 +00:00
Robert Loehning
0bc120b87c Squish: Remove redundant line
Change-Id: I819ace3fc7c3223c5bcd52377db3e7833371c7ec
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-01 13:56:47 +00:00
Nikolai Kosjar
d52ac9a708 Clang: Fix unresolved #includes for ui_*.h headers
...with an extra parse.

Previously, the creation of an e.g. "Qt Widgets Application" from the
wizard could show code model errors in mainwindow.cpp. Depending on
timing issues, the first error is either

  1. 'ui_mainwindow.h' file not found (QTCREATORBUG-15187)
    The parse happened before the in-memory ui_mainwindow.h was
    generated by uic. The file system watcher can't help here as the
    #include was not resolved successfully. And libclang's reparse does
    not handle this case (it would need to remember all failed #include
    stats...).
    ==> Detect this case with the help of the include paths and trigger
    a full parse.

  2. or: allocation of incomplete type... (QTCREATORBUG-15187)
    The parse happened after the generation of the in-memory
    ui_mainwindow.h, but before the clangbackend received the unsaved
    file.
    ==> Fix this by also writing the content of the unsaved file to our
    behind-the-scenes-created ui_mainwindow.h.

Fixes: QTCREATORBUG-15187
Fixes: QTCREATORBUG-17002
Change-Id: I4f3a81adaa3d604746977a402c29f83fbc5b0e44
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-31 10:38:27 +00:00
Ivan Donchevskii
93269f3ecd Clang: Add unit-tests for function overloads completion order
Make sure that the same function overloads with different priorities
come together in the completions list.

Fixes the case when we complete the method without '.' or '->'.

Change-Id: Icaf7ea47f5e58b3ae5cc9764ad79c857f6f6e231
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-26 07:22:24 +00:00
Marco Bubke
f8ec57919f ClangPchManager: Add PchTaskGenerator
Task-number: QTCREATORBUG-21358
Change-Id: Ia460ce82c3c896f4d0ac00638d03800a55dd27dc
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:35:11 +00:00
Marco Bubke
ee2122be70 ClangPchManager: Add build dependencies to include collector
It's a first step but we have to refactor the interface later.

Task-number: QTCREATORBUG-21379
Change-Id: Idda666bcaec950203f001c993c54a926779527e0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:35:02 +00:00
Marco Bubke
e571220663 Clang: Add top system includes to include collector
If we want to split the project part we have to filter out the top system
includes.

Task-number: QTCREATORBUG-21345
Change-Id: I258fa33ac39bd94b4699f4f39923d6ad274c1dc7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:34:52 +00:00
Marco Bubke
be3e06cc7e Clang: Fix test
Change-Id: I599d42f3a2584b40cbcec1368db9a2b11b0112d5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:34:44 +00:00
Nikolai Kosjar
d946ff5403 Clang: Fix adding completion snippets after {
...e.g. as in "void f() {".

The criteria whether to change snippets got invalidated with

    commit 8d0391a4f9
    Clang: Treat brace initialization as constructor completion

as the completion operator might be T_LBRACE now instead of T_EOF_SYMBOL
for normal completions.

This fixes the plugin test ClangCodeCompletionTest::testCompleteGlobals.

Add also unit tests.

Change-Id: I85cf522b9b307359c5c3e25198dd228cbb68ded0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 12:13:57 +00:00
Ivan Donchevskii
83a63c7914 Clang: Go through CLANG-UPGRADE-CHECK
Change-Id: Iaaaea598d020a44bcdc60a8d06ee28a1f28386bb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-25 10:34:18 +00:00
Ivan Donchevskii
d05fe2fe15 Clang: Re-enable tests which do not fail anymore
Change-Id: I1f8f396eeb8e97a8910bc2bd454227a395330f31
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-25 10:25:01 +00:00
Christian Stenger
1b231d1dc6 Tests: Fix linking without lib tooling
Change-Id: I51110089b1bed337de54dfa7167b2a5aff761837
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-24 15:30:51 +00:00
Nikolai Kosjar
f1290da3cd Clang: Avoid running pointless UpdateDocumentJobs
Opening a document (without typing in it), switching away and back to it
resulted in running UpdateDocumentJobs for that document for nothing.

As for documents we are going to reset, simply set opened documents
initially dirty.

Change-Id: I8edc2d1fb8f6f92950b4e2067f60609176bd5b26
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-24 12:52:14 +00:00
Nikolai Kosjar
aac1bebace C++: Fix parsing enum specifier II
This amends the obviously wrong
de975aca4f, which did not honored nameless
enum specifiers.

This fixes e.g. "Find Usages" for declarations following "enum {};".

Change-Id: Id98c074156f576b9a63e6c25dab38721ca34e496
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-24 12:47:03 +00:00
Eike Ziller
fd7cba88ef Merge remote-tracking branch 'origin/4.8'
Conflicts:
	doc/src/editors/creator-only/creator-code-pasting.qdoc
	src/plugins/android/androidbuildapkwidget.cpp

Change-Id: Iea8b7135643d14ffe49d10b14bedb8fa5ac48063
2018-10-24 13:58:45 +02:00
Christian Stenger
03fece349b Tests: Fix plugin path for macOS
Change-Id: I085ddbbff09d52878b82f311381c13b94739e84c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-10-24 11:19:46 +00:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00
Christian Kandeler
1c6c64df20 SSH: Turn some manual tests into autotests
Change-Id: Id098709ff74dfc31a26ef42d559ce35d0120c0c3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-10-23 08:28:55 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
Christian Stenger
2d7d08710e Squish: Adapt to debugger related ui changes
Change-Id: I452d4ccab7dc7c196277f008877ee58a1b2c8f7b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-10-18 11:44:01 +00:00
Ivan Donchevskii
78211741c8 Clang: Make SourceLocation lazily calculate its fields
Trigger path, line, column and offset evaluation only if one
of them is accessed.

Change-Id: Ib2f8b06ece94a3b7424db28523b5796628865202
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-17 05:56:39 +00:00
Christian Stenger
326adef0de Squish: Further adaption to UI changes of debugger
Change-Id: I0e28d2f929c7a69aa61313e3e5473143dc88e5b1
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-10-16 12:07:24 +00:00