Commit Graph

4897 Commits

Author SHA1 Message Date
Tobias Hunger
6445fb19bb Settings: Add test to pick right file if several exist
Test picking the expected file when several exist in
BackingUpSettingsAccessor.

Change-Id: I09d346a98a8df13d6cf3ee53ee20ce34e45e8d28
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:24:26 +00:00
Tobias Hunger
97cf4bb278 SettingsAccessor: Improve test by mocking out read/write operations
Change-Id: I4d4cf6ff0be3d4b8278a7613c26f2b1752304ad4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:24:11 +00:00
Tobias Hunger
b95bbe1d57 SettingsAccessor: Extract functionality to merge settings
Move functionality related to merging settings into MergingSettingsAccessor,
move code specific to the .user-files into UserFileAccessor.

Remove SettingsAccessor class, now that all code has been moved out of it.

This patch changes the merge mechanism a bit: It used to upgrade
the user and tha shared file to the higher version of these two, merge,
and then upgrade the merged result to the newest version.

Now it upgrades both the user as well as the shared file to the newest
version and only merges afterwards.

Change-Id: I2a1605cbe9b9fb1404fcfa9954a9f3410da0abb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:23:33 +00:00
Tobias Hunger
9ffd52f9c5 SettingsAccessor: Extract upgrading functionality
Extract upgrading functionality from SettingsAccessor into
UpgradingSettingsAccessor.

Fixes surprising behavior in test
ProjectExplorerPlugin::testUserFileAccessor_prepareToReadSettingsObsoleteVersionNewVersion
where the Version was thrown away.

Also adds a error/warning distinction to BasicSettingsAccessor::Issue,
so that the non-critical ones can be ignored later.

Change-Id: Ia38d074f91cd8d8f820f9bec96d3330d748564c7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 13:23:25 +00:00
Eike Ziller
43936b1e86 Merge "Merge remote-tracking branch 'origin/4.6'" 2018-02-13 12:38:29 +00:00
Eike Ziller
c7fdb93865 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
2018-02-13 13:37:37 +01:00
Tobias Hunger
23bb717101 SettingsAccessor: Extract handling of backups
Extract the code that handles backups from the SettingsAccessor into
a BackingUpSettingsAccessor.

Move code up from SettingsAccessor into UserFileAccessor where it belongs.
This became possible due to the extraction.

Change-Id: Icacaa4e7231b3c0c520154c76f9338227f96a614
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-13 12:21:33 +00:00
Christian Stenger
cafb0760f6 Tests: Fix compile with Qt5.11
Function to convert char[] into QString has been deleted.

Change-Id: Iedf5db322b907d4ea1a20cc5c70394388d54f214
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-02-13 08:47:45 +00:00
Ivan Donchevskii
d01b474b46 Clang: Refactor TokenInfos
Remove code duplication.

Change-Id: Ib1859f2c3a04f66d0f0b669b4e93a7fc06ab8e61
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-12 08:03:47 +00:00
Colin Duquesnoy
2a016d05b2 Add support for nested namespaces (C++17)
Task-number: QTCREATORBUG-16774
Change-Id: I3de3ac65810213e21c9a3bafef2474d252e191f7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-09 17:54:30 +00:00
Marco Bubke
c4220041a6 Clang: Rename FileInformation in FileStatus
It's more near to the Unix convention and it has a plural too.

Change-Id: I53f85911d8fcbaadba9947c70e9a375dc6995ed5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 16:49:43 +00:00
Marco Bubke
6976341e4b UnitTests: Fix printing warning for not handled enumeration
Change-Id: Ie590fff1d7a18552fadb34319a1423a6e0855df3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 16:49:33 +00:00
Marco Bubke
98774d7b92 Clang: Remove export filters
Lets try to find a better way to do it later.

Change-Id: I960abf65c910f639cc860b8e1291b0c235b7db07
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 16:49:27 +00:00
Nikolai Kosjar
0629400288 C++: Do not auto-insert '}' after class/struct/enum/union
...when typing the opening brace. This restores the initial behavior
from version 4.3.

Not auto-inserting the closing brace allows the user to press Enter to
get "};" completed.

Change-Id: I8c62a08433a947e28f0555338a5fb8eeeae11bea
Task-number: QTCREATORBUG-18872
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:45:20 +00:00
Eike Ziller
5432dd1f5c Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/locator/locator.cpp
	src/plugins/imageviewer/imageviewerplugin.cpp
	src/plugins/remotelinux/remotelinuxplugin.cpp
	src/tools/clangbackend/source/tokeninfo.cpp
	tests/unit/unittest/data/highlightingmarks.cpp

Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
2018-02-07 11:58:23 +01:00
Ivan Donchevskii
d81580b7a3 Clang: extra clangbackend job to collect full token info
Limit document annotations job to only highlighting data
collection and move more expensive calls into separate job
that runs after it.

Change-Id: Ie792a3f741ac45c81033dd5b3a20ed061604f927
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-02 07:01:59 +00:00
Ivan Donchevskii
bdd5066665 Clang: introduce more data in TokenInfo
Data added:
- return type spelling for functions
- parent spelling
- access specifier for class fields and methods
- storage class

New highlighting types are added, therefore
types are now categorized by class, struct, etc.

Change-Id: I1739b94a6f777045fde655060d8b9a12b6e0889b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-02 07:01:28 +00:00
Marco Bubke
497900eb3f Clang: Handle source dependencies in symbol indexer
Get the source dependencies from the collector and save them in the
symbol storage.

Change-Id: Ibc141970a100625398c1526f5bc644cc14d25c0c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:20 +00:00
Marco Bubke
048224bef1 Clang: Collect source dependencies
It is quite easy because we track the include directives in the
preprocessor callbacks.

Change-Id: I2d7bd67b31f50c0d8d4a46c57e83dffa0c558dc7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:09 +00:00
Marco Bubke
b2d3951bde Clang: Clear used macros and file information for symbol collection
We have to clear them too otherwise we will collect them which can lead
to wrong data in the symbol database.

Change-Id: Iad7b87344caec0f27a5f8f24c214573a274db911
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:00 +00:00
Marco Bubke
89b9dfed84 Clang: Add source dependency saving to the symbol storage
The source dependencies are simply a table which connects the include file
with the included file.

Change-Id: I5454e81a2b5b98f05c7ff3f6740a6d45e01772c3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:52 +00:00
Marco Bubke
490523fdbb Clang: Fix index for project part sources
The index has to be unique so that the inserting will be fail. We have to
add integration tests if everything is finished.

Change-Id: I4e20b90f1865d548572d2e634ac934f81da957c2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:39 +00:00
Marco Bubke
c6f65e94c8 Sqlite: Add unique index to table
Some times we need the constraint for an index.

Change-Id: I81332238d36b88196ef03e26b4edcc1307de46e0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:30 +00:00
Marco Bubke
c29ae225c5 Clang: Add source dependencies table
We want to track which source is dependent on which source.

Change-Id: I4b3c14be540974d69cc5026a5d081be1baceb133
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:20 +00:00
Marco Bubke
5dd24110f5 Clang: SymbolIndexer is saving the file information to the symbol storage
Change-Id: Id34ce9901c1a938e7ea14da444a9ef1b052286e5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:10 +00:00
Marco Bubke
95ce58cf32 Clang: Add insert file information to symbol storage
We use INSERT OR REPLACE because it is simpler than the insert and update
and we provide the primary key by our self.

Change-Id: I868e040918cc6c2ed183cecc746c89bec136f974
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:04:51 +00:00
Marco Bubke
70ab43ca62 Clang: Get file informations from symbols collector
We need the same information like file size and the last modification time
to check if a file has changed. This information will be saved to the
database.

Change-Id: Icf8eb9b6553945a563887e11aff9539c9b300b66
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:03:56 +00:00
Marco Bubke
8aef667ad7 Clang: Add file informations table
We could add this properties to the sources table but then we have to
handle null values which makes the SQL statements much more complicated
and most probably slower too.

Change-Id: Ie2a1e4862b0517825292213567725d6c18abfb30
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:59:03 +00:00
Marco Bubke
c0b771f99c Clang: Add macro names the to project part
So we can compare later if the macro names have changed.

Change-Id: I65c5f76e07fced8df6cc7282c03430adffcf5fa8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:57:44 +00:00
Marco Bubke
8b85b095b2 Clang: Rename defineName in macroName
Change-Id: Iaf8da991032e5ed4726384c051290a77887351fa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:57:34 +00:00
Marco Bubke
22b5bbbff3 Clang: Add defineName to ProjectPart
We need them later to find out if the defines have changes.

Change-Id: Iaaa14df3dc6f50cb286c2dac37db13c975063c1e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:54:49 +00:00
Marco Bubke
8beb205ee0 Clang: Fix statement names for symbol storage
Change-Id: Ieb242baf70ffedbdcfdbdbff2b780a1ffb810cc2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:52:16 +00:00
Marco Bubke
b247c4fdeb Clang: Store UsedDefines in the symbol database
We write the new defines in a temporary table and then write every new
entry in the usedDefines table, followed by remove of every entry in
usedDefines which are not in the temporary table but have a file entry in
common with one of the entries in the temporary table. At last we clean up
the temporary table.

Change-Id: Idf11ce8d17ad9ccef490578059fac08409fcc5d9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:51:06 +00:00
Marco Bubke
5cd64e8049 Clang: Add usedDefines table
Change-Id: Icbffb8a0450cfdff5d4958b5cc890114aeb0d794
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:50:29 +00:00
Marco Bubke
5877342123 Clang: Fix typo
Change-Id: I525459bd9e28b34912960bc43eca1b776da98344
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:50:17 +00:00
Marco Bubke
8a280129ff Clang: Update or insert used defines in the storage by the symbol indexer
Change-Id: Id8af85976be391e17886c9947863b81d206bb575
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:49:44 +00:00
Marco Bubke
4f0c17bc5d Clang: Improve Macro collection
Now undefined macros are added to used macros but we filter out header
guards and dynamic libraries export. The export is quite simple but
without we would think that exports change the AST.

Change-Id: Ic16f60a6675e397dfd769c53caf77056708d8459
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:47:46 +00:00
Nikolai Kosjar
4f20c0d4ed Clang: Highlight invalid declarations as text
...instead of the corresponding declaration color.

Task-number: QTCREATORBUG-18686
Change-Id: Ice4d84816351af79efa286f49516c392bd80da86
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:12:58 +00:00
Christian Stenger
0c50d54da7 Tests: Fix compile for Qt5.6
Unfortunately fixed on master instead of 4.6.

Change-Id: Ie1e91135899353d81857b75d4e461a5a8cd240d4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 962023648c)
2018-02-01 12:21:19 +00:00
Christian Stenger
962023648c Tests: Fix compile for Qt5.6
Change-Id: Ie1e91135899353d81857b75d4e461a5a8cd240d4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 11:15:10 +00:00
Eike Ziller
ecb9fae785 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	share/qtcreator/qml-type-descriptions/qmlproject.qmltypes
	src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp

Change-Id: I35fb652f29a98a798be7c8b4b4c2e581eb175fb6
2018-02-01 09:58:36 +01:00
Nikita Baryshnikov
66d02773e7 Environment.constFind added test
Change-Id: I6213650b811960fa67545df4b6531aafcca05c81
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 08:12:57 +00:00
hjk
a42ae9e6f5 Debugger: Add the ability to auto-test expression evaluation
... and use it for the hidden "sequence" feature.

Change-Id: I3430a24774264a573687ee818064314a8bca7212
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-31 14:19:23 +00:00
Marco Bubke
0f8befacd3 Clang: On the road to update and preprocessor support
This patch has grown in a quite big change set and it is really hard to
divide it in different parts.
V2::ProjectPartContainer is now using FileIds instead of file paths. This
cleans code up because it is a big step in the direction that internally
only file ids are used. But it is depending on the file cache, so the
file cache has to be provided as an argument. There is now an interface for
transactions too which are ease the testing of them and enables the support
of preprocessor. It adds macros as symbols and is saving used macros. The
used macro support is enabling update improvements because only if a
changed macro is used it needs to be recompiled. This is still in flux
and can be changed in later patches.

Change-Id: I492a2c9af1201d40fdd9f46a0045f7878bbbaa3d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-29 13:47:09 +00:00
Ivan Donchevskii
d3b11926d3 Clang: fix unit-test build
Remove unit-test dependency from project.

Change-Id: I1abdbea08648c292d5c98a0c88a211c8c897cc71
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-29 10:20:46 +00:00
Ulf Hermann
13ba063696 QmlProfiler: Fix translations and tests for statistics view
The statistics view is not called "events" anymore.

Task-number: QTCREATORBUG-19658
Change-Id: Iff4375d3dc0cf5d82d118244698887818f924c07
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-01-26 11:26:48 +00:00
Robert Loehning
4ebe9458c7 QmlDesigner: Fix testfile for states
Change-Id: Ib90334d6f566f0ae5d3a5f4961e23af116d34053
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-25 17:40:42 +00:00
Ivan Donchevskii
2daa5c7280 Clang: Locator: Add filters for classes, includes, functions
Filters are based on symbol query where they are
not implemented yet.

Change-Id: Id826beaf6bb47a81363c36780d7254a85a9a3cc9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-24 11:49:13 +00:00
Ivan Donchevskii
88c3e27722 Clang: Add locator specific methods to SymbolQuery
... and implement LocatorFilter using these methods.

Change-Id: Ie3e3ebb3a547e2b2bda49e76a199a3ccd8fe6403
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-24 11:49:04 +00:00
Ivan Donchevskii
92cdfc0c2a Clang: new empty locator filter classes
Introduce classes to replace builtin locator filters.

Change-Id: I5cc6f15fb0f59ea8a51b14a86301cf219cc0d6d6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-24 11:48:42 +00:00