Commit Graph

4897 Commits

Author SHA1 Message Date
Eike Ziller
437590a999 Merge remote-tracking branch 'origin/4.6'
Change-Id: I49e8b8442e2b5edffbea19cb2bba97443ebc3d2a
2018-01-23 17:06:59 +01:00
Nikolai Kosjar
30c95c937b Clang: Take over jobs if document gets new project part
We could loose jobs if e.g. the user switched to another parse context
or shuffled project files between targets/products/project-parts while
there were still jobs in the queue.

Previously, changing the project part id of a document was a two step
process:
  1) Unregister document with old project part id
  2) Register document with new project part id
On 1), we have thrown the document processors (and thus the job queue)
away. On 2), we have created a new document. Due to this separation the
backend could not take over jobs to the new document (processor) - it
could not know that these commands belong together.

Now, we avoid the explicit unregister command. On a register command the
backend has enough context to find out what to do, it can take over
relevant jobs.

Task-number: QTCREATORBUG-18856
Change-Id: Ib68a8e62140fcfdb2de58dcd2ae955b4c2e15166
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 14:00:03 +00:00
Marco Bubke
fb0b5d9d9b Clang: Make it more clear that the FilePathId.filePathId is not shared
The name fileNameId could imply that the id shared for the same file name
which is not the case.

Change-Id: I27310a8994c2d9e9bb0f0aed2094bd988309c710
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 13:22:30 +00:00
Marco Bubke
a572b2db6a Utils: Change SmallString::toView to SmallString::toStringView
This improves the readability of the code.

Change-Id: Ifccbaaa6003636848ea48e00d92abc44f5c2e0f1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 13:22:00 +00:00
Nikolai Kosjar
608e7ec245 Clang: Fix tooltips for constructors
Constructors were not handled yet, so the tooltip for e.g. the
"QString()" constructor was "void ()".

Also, since the help system has problems with overloads, show the
function signature as clang sees it and provide a help system query that
will show the documentation for the class instead of the wrong overload.

Change-Id: Idc0cf9dce6a50c323e6fd945f277c7816b0f9b34
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 12:33:21 +00:00
Robert Loehning
a4ff3423e9 Squish: Update Qt version names and constants
As a preparation for using Qt 5.10, these
need to handle two-digit minor versions.

Change-Id: I2a47606ee801a28df12d75323b480f8ee583893b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-22 12:30:49 +00:00
Nikolai Kosjar
2d7f1d6c8c Clang: Take over jobs if document's project changes
On registerProjectPartsForEditor() we recreated the affected
DocumentProcessors, but did not take care of the jobs that were in the
queue, which effectively could led to lost jobs. Catch up on this.

Task-number: QTCREATORBUG-18856
Change-Id: I4184e5dc6480667953f2d2081ccf39a28c092186
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-19 13:16:07 +00:00
Nikolai Kosjar
fdc88939d6 Clang: Fix ToolTipInfo.IncludeDirective test on Windows
Change-Id: I8a6d7c6d46474db4455cb9e2bc90e2e7e527e474
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-17 14:38:31 +00:00
Eike Ziller
115afed94b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h

Change-Id: I43d2571617bfbf41c0fcf23502ab77975540eba4
2018-01-17 09:30:57 +01:00
Nikolai Kosjar
76c25bcd6a Clang: Provide tooltips
This includes also the query data for the help system (F1) for an
identifier under cursor.

Regressions (libclang changes necessary):
 - Function signatures do not contain default values.
 - Aliases are not resolved for/at:
   - template types
   - qualified name of a type

Fixes/Improvements:
 - Resolve "auto"
 - On a template type, show also the template parameter.
 - For a typedef like
     typedef long long superlong;
   the tooltip was "long long superlong", which was confusing.
   Now, "long long" is shown.

New:
 - Show first or \brief paragraph of a documentation comment.
 - Show size of a class at definition.
 - Show size of a field member in class definition.

Task-number: QTCREATORBUG-11259
Change-Id: Ie1a07930d0e882015d07dc43e35bb81a685cdeb8
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-16 15:32:15 +00:00
Marco Bubke
15ed2691bf UnitTests: Fix printing of text
Change-Id: I7e8ebc2932be6e01d7776e58e462935ff857b0e5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 14:01:01 +00:00
Marco Bubke
640575640c UnitTests: Use MockFunction instead of home grown mock class
Change-Id: Ic0cd2fb7d073e8cf962d98b850719f4311e9f35a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 14:00:34 +00:00
Marco Bubke
5d088e9df5 UnitTests: Cleanup unit tests
There was still unneeded PrintTo functions and gtest includes.
It is now possible to use MockFunction for callbacks.

Change-Id: Ie5875c3697069a37b48c2f2022f1f8c21f1c794f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 14:00:28 +00:00
Marco Bubke
e5d1fe6620 Sqlite: Add setter for last row id
Change-Id: I15dfb997b04e285a8dfa0e2979de8457817bce3e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 11:10:27 +00:00
Marco Bubke
f233f2d26d Clang: Add project parts table
Change-Id: Id2525b6664c6dc0e9d19f8d58cd26b515ae5640c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-16 11:10:21 +00:00
Ulf Hermann
77e28efad6 Timeline: Use some better number types
The scale parameters are converted to single precision float anyway as
soon as we do something with them. We might as well change all the
methods to be single precision, too.

The min/max row values should really be 64bit as 32bit values are not
enough to express memory usage.

Change-Id: I2b058b112286eabb1c077f7e746c48b6b99cb416
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-16 09:02:57 +00:00
Tobias Hunger
21e7e9ea3b Settingsaccessor: Extract file access and error reporting
Move file access and error reporting out of SettingsAccessor and into
BasicSettingsAccessor.

Change-Id: If6cc9157c1a532f117c48b929c05f55d89a339eb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-15 14:28:01 +00:00
Orgad Shaneh
6285a6e50f CppTools: Fix build
Broke by e51683412b.

Change-Id: I68d1457931f2237a63da4ac2e34f1650b9ff6ea6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-11 06:46:15 +00:00
Marco Bubke
2c08ddcd5a Clang: Add path notifier to symbol indexer
Change-Id: I2a605a5a5ac2511566edd9c069e84b5ec9d95279
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:38:47 +00:00
Marco Bubke
e94d88c172 Clang: Cleanup symbol indexer test
Change-Id: I1cfa70d092d27949e0cf9466b190afbc40c1a591
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:38:39 +00:00
Marco Bubke
6f8f8d0cbf Clang: Extend ClangPathWatcher to communicate path changes
Change-Id: Iad2d6adc53fbc2ee32fd63b9ccdc8999d41a89da
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:38:16 +00:00
Marco Bubke
98fa7cbb3f Clang: Use FilePathId in ChangedFilePathCompressor
Change-Id: I622d9196ec12c6fe6e07ef9c953586f2f40b9a5c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:37:37 +00:00
hjk
0955eefb8a Add a minimal automake project for testing purposes
Change-Id: If2127f2baf79716517e85661a3c657d689d84d67
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-10 11:00:26 +00:00
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
Robert Loehning
b1239d6c4c Squish: Remove outdated workaround
This reverts commit dbfbe1d65d.

Task-number: QTCREATORBUG-19523
Change-Id: I443c1bbed42f9aa96593b66a6b135bd6df35447d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-09 10:12:17 +00:00
Nikolai Kosjar
5f8ac59ef8 Clang: Fix tests without any ASSERTs
Change-Id: I3148cb85271ab021832caa5bd09dedb6aeeef49f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-08 15:21:23 +00:00
Nikolai Kosjar
e3b1259004 Clang: Introduce DocumentParsed as job requirement
This is in prepration for a follow-up change, which introduces a state
where the Document is not yet parsed (it was reset) but the queue has
jobs.

All jobs get this requirement except those that generate an AST.

Change-Id: Ifcbb704e54108b40797180514c5ad3f3768ef10b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-08 13:18:54 +00:00
Nikolai Kosjar
063b327097 Clang: Clean up clangjobqueue-test.cpp
Change-Id: If10deb858bbf0ec725c029d5e914c5109de7b5ee
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-08 13:18:47 +00:00
Nikolai Kosjar
5972e27169 Clang: Ensure to clear all affected translation units on project part change
The ones that were already dirty were not taken into the account and
used the old project configuration.

Change-Id: I949d1ca8c23bbdb18eec78e5a708199beff6f735
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-05 15:27:44 +00:00
hjk
0cce7a82fe Debugger: Add some simple dumper for std::function
Linux/gdb only, pretty print the cases of default constructed objects
and real function pointers.

Task-number: QTCREATORBUG-19410
Change-Id: I08332af649bda861d9f53c0e0feb1f37db72b875
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-05 07:20:26 +00:00
Marco Bubke
ab60cfd3a4 Clang: Clear SymbolCollector before updating new project parts
Change-Id: I82e9bb4f66a7597bb911fbc97d6022ff3fdb0b35
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-03 14:45:17 +00:00
Marco Bubke
3c43e5d7ec Clang: Collect source files
Change-Id: If0183cafd00ed7e42bacbdb72a1d65624dc03cee
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-03 14:45:04 +00:00
Robert Loehning
dbfbe1d65d Squish: Rename project while this triggers bug
Task-number: QTCREATORBUG-19523
Change-Id: I468c5fe0af07b1875b45de8a1fd32da23208f6a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-03 10:16:37 +00:00
Robert Loehning
bada98379d Squish: Remove outdated workaround
Task-number: QTCREATORBUG-18290
Change-Id: Iddf51cc9655d24c866d3887afc4be6291768087d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-03 10:15:50 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
Christian Stenger
3006a13869 Tests: Fix compile
Broke with 21c66ce5.

Change-Id: Iea3447a8226300333eacf8fa0df587d8ef197e8f
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2017-12-20 10:12:50 +00:00
Eike Ziller
8944ba0391 Utils::transform: Add support for various map types as result
Add support for output as std::map/unordered_map/set and QMap and QHash,
when giving the full result type as template argument. For std::
(unordered_)map, the function must return a std::pair<Key,Value>, for
QMap and QHash it can also be QPair<Key,Value>.

Change-Id: If3dff17ab6aa5d1b11abc244813fd885d10c75a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-20 09:58:50 +00:00
Eike Ziller
f62b24c475 Utils::transform: Support containers without reserve()
Support containers without reserve() as result container, for example
std::set/deque/list

Change-Id: Ia96b834c67d5ee74bfb9de2cf6b86639f6b3d5d7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-20 09:58:27 +00:00
Marco Bubke
91e40e12db Utils: Converter to raw pointer and references
Sometimes you want to get raw pointer container from smart pointer
container and reference container from value container.

Change-Id: Ia018d572ac0a7bf742f3937dc38ee30670a3ca73
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 09:58:17 +00:00
Robert Loehning
b64c1a96b8 Squish: Update WatchTreeView object
Change-Id: If999647727155dccc087d9d22f3b68d2b1661351
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-19 14:08:45 +00:00
Christian Stenger
0fcbe60cd6 Tests: Fix qml import check
Change-Id: I7fcf4a3b718c3b2124171187cdb06493c84ff7b8
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-12-19 13:51:35 +00:00
Eike Ziller
e0a23664aa Utils::transform: Allow usage with non-const source containers
Makes it possible to e.g. transform to list of reference_wrappers.

Change-Id: Ib608034fc3f296824c289edd27563bc7a196ac6d
Reviewed-by: hjk <hjk@qt.io>
2017-12-19 07:35:38 +00:00
Christian Stenger
8187c6a146 Squish: Assign custom name to distinguish main tabbar from others
If the settings dialog contains more than one visible tabbar when
trying to access its tabs Squish fails to distinguish them.
Assign a unique name for the main tabbar of a category inside
the settings dialog.

Change-Id: I349b480871306784b5adc9858984933dc26d7958
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-12-15 13:53:45 +00:00
Alessandro Portale
6e802988e7 QmlDesigner: Add manual test for pixel perfect formeditor overlays
We have a few off-by-ones in the visualization of selection, boundary,
etc. Also, there are differences between low and high DPI, aswell as
different platforms.

This manual test is supposed to enable proper analysis whether the
visualizations are correct or not.

Change-Id: Iee407d37a2c6f2f272e11a4d9774532343463bc1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-12-15 09:35:13 +00:00
Robert Loehning
7ded6bef30 Squish: Skip "Extract Function" with clang on Windows
Change-Id: Id98d630babff10fe0def36aa895f70587852036b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-14 14:52:21 +00:00
Ivan Donchevskii
7a7123b1bc Clang: add globalFollowSymbol to RefactoringEngine
Allows to follow outside of current TU.

Change-Id: Ieea2fd72bfdf6d60a988b40efcf2f41c5a71d045
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-14 14:25:14 +00:00
Marco Bubke
bb62fd3e56 Clang: Move printing functions in clang support to unit tests
The printing functions are only used by the unit tests and they use an
external API. So we can easily move them to the printing functions in
the unit test project. We have to move the TokenInfo print functions too
because the depend on other print functions. The rest of the print
functions will be moved in other patches.

Change-Id: I87c452f8ca40687ec47de675ba6bee13efa5655b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-13 17:24:59 +00:00
Marco Bubke
8cce4daa80 UnitTests: Make fake function inline
Change-Id: I8e0927a80d0bdcde7bd0e91c749d015636d07388
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-13 17:23:28 +00:00
Robert Loehning
bd8027d232 Revert "Squish: Update expected line in tst_simple_debug"
...because the project template was changed once again.

This reverts commit fe5249c401.

Change-Id: Ie7940c4dfa98ed71d8c1e937c087918f9157cbfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 14:36:42 +00:00
David Schulz
800aa7466f Debugger: improve symbol lookup times for cdb
Task-number: QTCREATORBUG-18613
Change-Id: If8dac096fa4d0d8afc6fb8f7bbffd090a5dc6e19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 13:59:01 +00:00