Commit Graph

5234 Commits

Author SHA1 Message Date
Christian Stenger
28ab852e53 Squish: Wait for a clean shutdown when restarting QC
This fixes a race condition in tst_CSUP06 where the next run
of QC removed .user* but the first instance was not completely
finished with the shutdown process. The .user files of the project
got updated (or recreated) before the second instance tried to
open the same project again. Ensure the first instance is closed
to be sure that project's .user files got created or updated
before the second instance tries to remove and re-open them.
Follow the same approach for other tests to avoid the same issue
later on.

Change-Id: I37721f4dd647f9bbf7c6fed6e753a2906e30db81
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-09-07 12:48:28 +00:00
Christian Stenger
0dc1b4e7b3 Dumper: Tests: Fix handling of skipped single tests
Amends b3b4465b2.

Change-Id: Ie268a97af944d17f20077363fa37c89ad998f53e
Reviewed-by: hjk <hjk@qt.io>
2018-09-07 12:48:17 +00:00
Eike Ziller
ac9f1f798c Merge remote-tracking branch 'origin/4.7'
Change-Id: Ifb51ca9893549c478e99c9fc3ea6c32d5d5a28a2
2018-09-07 14:39:42 +02:00
Robert Loehning
1a64efd863 Squish: Stabilize tst_CSUP06
Change-Id: I2cac53f69d15763770fe3955408867ec668bfccd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-07 11:12:29 +00:00
hjk
9a0030a8ba Debugger: Make inheritance dumper test pass again
Change-Id: I2dcb6f811c34beda52e4b4d01526222b4e2abfd7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-07 08:55:33 +00:00
hjk
4cb0b3fa73 Debugger: Make enum class dumper test pass again for gdb
Change-Id: Iaded82ab13f30e7222eb14f548ac72d1c6502b7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-06 13:41:51 +00:00
hjk
b3b4465b2f Debugger: Make std::unordered_set test pass again
For some reason order is not important in that context...

Change-Id: I0961dd5be7775d190b9bef6b739dc9d690eb36a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-06 13:11:18 +00:00
Marco Bubke
2a30f0e5d6 Clang: Improve generated files handling
Generated files are referenced by the system collector directly to set the
unsaved files.

Change-Id: I24be3ee544b7824b8b0e518eafd409f32bd002ab
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-06 11:26:00 +00:00
Christian Stenger
1016dc0603 Squish: Refactor starting Qt Creator from Squish
Change-Id: I7cbce7db2a22a7cb327965b9b7918eb46266b260
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-09-05 09:24:18 +00:00
Marco Bubke
3d9974db95 Utils: Fix small string
Change-Id: I6a746eb28c6c803b9ade9f626a950cf93ba6fe99
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 14:26:05 +00:00
Marco Bubke
7cac843343 ClangRefactoring: Remove unused code
Change-Id: I752d688039e8bb85654fd54b61a0c8a4e6677954
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 12:14:24 +00:00
Marco Bubke
a86867eb8a Clang: Introduce parallel indexing
Change-Id: I522cb18e6d24b7dbed5d5dfa3a732e5b3b5113bb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 12:13:10 +00:00
Marco Bubke
2f41886c4b ClangRefactoring: Process tasks after a task has been finished
It could be that processTasks is executed before the future is finished
but in that case there are other tasks which will be called later.

Change-Id: I9b1bfb6fdd642f23842b9c70d60d5b1552193b99
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 09:40:03 +00:00
David Schulz
d61d29cf16 Introduce a basic client for the language server protocol
The language server protocol is used to transport language specific
information needed to efficiently edit source files. For example
completion, go to operations and symbol information. These information
are transferred via JSON-RPC. The complete definition can be found under
https://microsoft.github.io/language-server-protocol/specification.

This language server protocol support consists of two major parts, the
C++ representation of the language server protocol, and the client part
for the communication with an external language server.

The TypeScript definitions of the protocol interfaces are transferred to
C++ classes. Those classes have getter and setter for every interface
value. Optional values from the protocol are represented by
Utils::optional<ValueType>. The JSON objects that are used to transfer
the data between client and server are hidden by a specialized
JsonObject class derived from QJsonObject. Additionally this JsonObject
provides a validity check that is capable of creating a detailed error
message for malformed, or at least unexpected JSON representation of the
protocol.

The client is the interface between Qt Creator and language server
functionality, like completion, diagnostics, document and workspace
synchronization. The base client converts the data that is sent from/to
the server between the raw byte array and the corresponding C++ objects.
The transportat layer is defined in a specialized base client (this
initial change will only support stdio language server). The running
clients are handled inside the language client manager, which is also
used to connect global and exclusive Qt Creator functionality to the
clients.

Task-number: QTCREATORBUG-20284
Change-Id: I8e123e20c3f14ff7055c505319696d5096fe1704
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-03 08:00:46 +00:00
Ulf Hermann
67b09f5132 Tracing: Adapt aggregator test to new ctor signature
Change-Id: Ifb94c1e1f14b26aa2bb365cd08d36fa67642ecc7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-31 08:14:04 +00:00
Christian Stenger
f38932dd72 Tests: Fix compile after referred file has moved
Amends 5c658ac968.

Change-Id: Ia876cbd49edc60aeeaf564b787f3ec05c4b303aa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-31 07:44:46 +00:00
Ivan Donchevskii
8b6a16c95b Clang: Fix completion after '{'
Follow-up fix for 8d0391a4f9.

Do not complete after '{' coming not after an identifier.
Take constructor completions only for '{' and function
completions only for '('. Filter constructor completions by
class/struct type.

Task-number: QTCREATORBUG-21004
Change-Id: I7ae2d6bee23cf907648c42b93eb12742942833f6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-30 13:36:52 +00:00
hjk
cc198547e9 Debugger: Replace module polling in gdb by handling notifications
Explicit polling is still available and accessible as fall back in
the gui, but is at least in theory not necessary anymore.

Change-Id: Ifd184fb88bdbf5de53f5776e2c94a03f8ad44a06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-30 12:07:20 +00:00
Christian Stenger
09b611acde Squish: Fix checking for plugin loader issues
Change-Id: Ibf894f3792f78c496be5fcbdfcd6c19b8b1246e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-08-30 11:01:43 +00:00
Eike Ziller
8e05783019 Merge remote-tracking branch 'origin/4.7'
Change-Id: I4332eba9f1f66fef185359c79c4d96420d8b78ca
2018-08-30 08:31:25 +02:00
Christian Kandeler
faccb8fd71 qbs build: Fix highlighter engine autotest
We link against the TextEditor plugin as of 601eebd832, so don't pretend
anymore that we are the plugin.

Change-Id: I8afdce57ceffdcbf965e16e7a24c0a9ab6d7d234
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-28 13:06:32 +00:00
Marco Bubke
b2c3e683cf ClangRefactoring: Add SymbolIndexerTaskScheduler
The scheduler is managing the asynchronous tasks by using the symbols
collector manager. Every symbols collector can be used by only one thread,
so the we have to pass the symbols collector around by the future interface
to make the available again after a task is finished.

Change-Id: Ic2eeaa986c2d93978d043216c46e8cb38cea769f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-27 13:46:34 +00:00
Marco Bubke
5bd7af7a90 ClangRefactoring: Add SymbolIndexerTaskQueue
A first step for concurrent index task.

Change-Id: I9a0dba9f4a67ee605281516785697045b34e2694
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-27 09:17:39 +00:00
Marco Bubke
6fba0be280 ClangRefactoring: Improve symbol parsing
Declarations are only indexed if their file has been changed and references
has to be indexed if the file or any included file has been changed.

Change-Id: I07c6de1379bce2462c1e0fad34d4378a3da4397b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-27 08:51:29 +00:00
Eike Ziller
601eebd832 Fix painting of current line in generic and python editors
The generic highlighter and the python editor explicitly map some tokens
to the format C_TEXT. Unfortunately this format is special, because it's
foreground and background colors are handled by setting the editor's
palette, and should not be used for setting the format on characters.

If the format is explicitly set on characters, their background will be
oblique and overpaint e.g. the highlight for the current line, which
looks pretty ugly.

Handle this directly in SyntaxHighlighter::formatForCategory for all
syntax highlighters, by returning an empty QTextCharFormat for C_TEXT.

Change-Id: Ifaeb556754ca8106ad6e55d7062b13b45457a809
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-24 08:15:21 +00:00
Robert Loehning
bba35ceff4 Squish: Remove remaining mentions of Squish hooking
Change-Id: If4fde6d47433b1c8e46c68c5b225004446214797
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-23 12:11:36 +00:00
Marco Bubke
aca14a36e9 Clang: Use only filePathId for comparison
The filePathId is already unique and the directoryId is there only to
improve the access time for the directory. So it is already strongly
ordered if we compare only filePathId.

Change-Id: I67255bea1d36d41a59421eeb51964440c053b1e3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-23 08:42:10 +00:00
Marco Bubke
d02d9b0f43 ClangRefactoring: Remove FileCache from SymbolStorage
It is not used.

Change-Id: Iaff5a34dfe613f0a627e0a3a727af1130ad2b522
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-23 08:11:29 +00:00
Marco Bubke
876d068011 UnitTests: Move printing functions to creator printing file
Change-Id: I09043347370d4fad623f8e803d4ef0f147fffa21
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-23 08:06:25 +00:00
Robert Loehning
fe8c8619c9 Squish: Update URLs to sources of Qt 4.8.7
Change-Id: I9dfc2df788be128ee82561d1974920c5924566e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-22 11:27:12 +00:00
Ivan Donchevskii
8c21a7a396 Clang: Fix local references for operator arguments
Workaround for wrong cursor annotated by Clang.

Use clang_getCursor in case of the variable used as
operator argument to get the proper cursor.

Task-number: QTCREATORBUG-20966
Change-Id: Idb195bffc2296f3fae27595cf9c43c9e6b2c5cd0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-21 10:41:30 +00:00
Ivan Donchevskii
8d0391a4f9 Clang: Treat brace initialization as constructor completion
Try to complete constructor after left brace with fallback
to normal completion.

Task-number: QTCREATORBUG-20957
Change-Id: I6c33790a3ee1e623a3d8abe9a44cfd821b6f3106
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-21 10:40:04 +00:00
Marco Bubke
39e78bd3f6 Clang: Don't index already indexed symbols
We don't index system headers any more and introduce a first step to
decrease double indexing. For that we introduces the SourcesManager which
so far tells you only if a file was already indexed for a certain time
stamp.

Change-Id: Icde54465693ca84a622764c595635cac365c0111
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-20 13:16:52 +00:00
Marco Bubke
cc0db43c34 Clang: Extent sources manager with dependency
For many index cases such a function call it is needed to check if
any of the included files are changed because the function which is called
could be changed too.

Change-Id: Ibe0f43426c735d39072f284cad075dd4dc6f99c0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-20 13:16:19 +00:00
Orgad Shaneh
9ed36db854 Dumpers: Add a dumper for QPointer
It has an internal QWeakPointer<QObject>, which is not helpful. Cast to the
QPointer's template argument instead.

Change-Id: I9308c5eb9ea3867a682c4e4cba5d8041547981d1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-08-20 12:47:17 +00:00
Marco Bubke
6a541fd692 Clang: Add sources manager
Indexing source files multiple times is unneeded overhead in many cases.
The source manager is a support class to handle that cases.

Change-Id: Id737eaa9a691c54563279562833493a221eb3431
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-20 08:57:28 +00:00
Eike Ziller
9f60cdcdaa Merge remote-tracking branch 'origin/4.7'
Change-Id: I15962a85b0cc37c5a00e15ef7eac0445aad6c295
2018-08-20 09:05:18 +02:00
Robert Loehning
21bcc7f38b Squish: Use sets instead of lists for kits in use
They fit our use-case much better.

Task-number: QTCREATORBUG-20874
Change-Id: Ifa06ce00f3e6999a99c3bc2bb7e9ba759fa02e94
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-17 12:58:14 +00:00
Orgad Shaneh
44776760ba Tests: Add #include <QtGlobal> for version checks
It is required with Qt 5.11.

Change-Id: Ie6aee4a5d71a370952f908561a40ccc2d34d31c5
Reviewed-by: hjk <hjk@qt.io>
2018-08-16 08:29:36 +00:00
Orgad Shaneh
98b6fd26bf Dumper: Fix enum display in nested types
When used in SubItem, enums were displayed as
"value of type E at address <addr>".

Change-Id: Ieecfb791126c6f63f272817afc6c8d05f28b9242
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-16 06:42:21 +00:00
Eike Ziller
db9837fa6c Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/clangtools/clangtoolruncontrol.cpp
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: Ib1e8abf066898b50c90fc1ccba4697fe983e8a8f
2018-08-15 13:53:28 +02:00
Marco Bubke
7bae47642c Add optional system include to compiler option builder
System includes suppress warnings and prevent indexing of unwanted symbols.
Using system includes for all includes outside of the project can be
quite advantageous. The rootProjectDirectory() can be extended to be set
in the project settings. An automatic generation could be possible but
could create an unwanted path which includes files outside of the
perceived project.

Change-Id: Ib9d3158f14f41efe1f6657f962d5c4437bb324b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 15:03:51 +00:00
Marco Bubke
b592339b4d Clang: Don't parse system headers
Change-Id: I6474fbe4f43daaac930ad6ba49fd9cb3145a3bbd
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 15:03:41 +00:00
Marco Bubke
4195fce68f ClangRefactoring: Integrate generated files
This is an intermediate step to handle the indexing of the project parts
completely. The generated files are now independently handled from the
project parts. We still not handle the case the a file is indexed but the
generated file is not provided. This will be done in a different patch.
All provided data is now sorted too to improve merging.

Change-Id: I09712b99217a881ec0a233d09aea8659fb787324
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 12:47:03 +00:00
Robert Loehning
24f33dc482 Squish: Update Creator's sources to v4.7.0
Task-number: QTCREATORBUG-20344
Change-Id: I7664f2f1b9f9412b9564f192319f9ed832dc142a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-14 10:04:10 +00:00
Christian Stenger
8c1a2eb2c0 Squish: Fix passing argument to helper function
The code of the helper function has changed and what worked
before by pure coincidence now fell apart.
Passing a list to a function that tries to use it as a key
for a dict results in an exception as lists are not hashable.

The code is likely to change by adding a newer kit. This patch
just makes the current state work without crashing instead of
adding functionality that is not yet used.
Amends aed1616b35.

Change-Id: I6e8a6490988700de14596ba981b5e6900133a79d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-08-10 10:39:47 +00:00
Robert Loehning
94fb8efab1 Squish: Remove old default target parameters
Change-Id: I72153c535ae0670cb4bfa061f34659bc7faee001
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-10 09:35:17 +00:00
Robert Loehning
59f124eb07 Squish: Fix checking for Profile mode
Amends 2a274728c2.

Change-Id: Id686e031658ad737eaeeffabe857452cc8a0d7ac
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-08-09 10:47:18 +00:00
Robert Loehning
aed1616b35 Squish: Simplify mapping between kits and their names
Task-number: QTCREATORBUG-20861
Change-Id: I809036dc331b93f015ee5b10381229b106e27cbd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-09 09:08:42 +00:00
Ivan Donchevskii
62e776aa8e Clang: Provide include directory only for libclang
Only libclang has issues with the include directory
search therefore undefining include folders makes sense
only for libclang options builder.

Change-Id: Ie3f62f5f3a89503e6e0ab59e18889e92425c3abc
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-08 14:07:13 +00:00