Commit Graph

5172 Commits

Author SHA1 Message Date
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
Ivan Donchevskii
44b931f7f5 Unit: Fix unit-tests
Since we now destinguish FunctionDefinitionCompletionKind from
FunctionCompletionKind use the proper enum in some tests.

Change-Id: Ia3a47c4632ce4d2a1e42de87289dd08d4cac6ef7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-08 14:06:10 +00:00
Marco Bubke
19b0d837e5 Clang: Add GeneratedFiles
To manage generated files it is very useful to have a class which adds,
updates and remove them.

Change-Id: Ifc842400e17d1a51adf723c32996a080f0348f57
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-08 13:15:11 +00:00
Marco Bubke
0bef7610a1 ClangRefactoring: Move generated files to own messages
There must be a management about it but this will be added in a different
change set.

Change-Id: I47b6ce7f671f1c8ae07083d6d99c534069e3cc1a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-08 13:13:35 +00:00
Marco Bubke
613db15cea ClangRefactoring: Add project part queue
Change-Id: Id137233a042181553ff7bb766c9dafa6eb9cf046
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-08 13:07:26 +00:00
Robert Loehning
2a274728c2 Squish: Also check for "Profile" config being checked
Change-Id: I9f6598144b81240c4a92abb7e71b7c4cbf6baa4a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-07 09:25:22 +00:00
Robert Loehning
2c6a57be9c Squish: Move imports of "os", "re" and "sys" into shared class
Change-Id: I349cb255b8fa6f96e32d5dacb3c9b58ddeb76897
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-07 09:25:05 +00:00
Eike Ziller
847787f146 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp

Change-Id: I72882df605bc3fc8a8d20118fd4e49207ac92664
2018-08-07 09:42:02 +02:00
Robert Loehning
ff10f8c3a5 Squish: Fix warnings
Warnings from static code checks, that is, not test.warning() at runtime.

Change-Id: I651d13491106583908059ecdb5f700f539b6d9c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-06 14:21:30 +00:00
Robert Loehning
da21353276 Squish: Don't explicitly pass default to createNewQtQuickApplication
Change-Id: I006c6cad0e972006475ad488b9a71def09de0dbb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-02 11:48:37 +00:00
Robert Loehning
e8acb75115 Squish: Refactor selecting configured Kits in project
The design of the Projects mode changed several times. We wrote lots of
workarounds to keep even more old code alive because we never had the time
for a proper refactoring. This time is now.

Leads to more stable code with far less variables flying around.

Task-number: QTCREATORBUG-20265
Change-Id: I29e5956ea3279cdb1d6da61bf5b461666de436bc
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-02 11:48:14 +00:00
Christian Stenger
01aafd8021 Squish: Redo readFile()
Change-Id: Ife8f951aa8fc86403197318b55db725ed3259336
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-08-01 05:33:24 +00:00
Orgad Shaneh
8654677015 UnitTest: Remove unused function
This amends commit da4be3fdb7.

Change-Id: Iffdf4581b7f29fc846c944e24f33e27e003f1b3b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-07-31 10:10:19 +00:00