Commit Graph

4555 Commits

Author SHA1 Message Date
Marco Bubke
381b51c012 Utils: Add toView to SmallString
Change-Id: I242a3a8e8411dfca19e50279928f97a5623e55d4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 13:46:48 +00:00
Marco Bubke
24e5dd0556 Utils: Add compare function for string views
It is more efficient to use compare instead of less and equal together.

Change-Id: I772b03ba02509c0ebc5d5d770be14cf7d5bd431e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 13:46:38 +00:00
Marco Bubke
b725018e9e Clang: Cleanup interface hierarchy
The server and client interfaces was tightly coupled.So it prevented
the introduction of immediate interfaces.

Change-Id: Ie4197ffddb862e076d080b3d2a5ee869fad9e4d0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-08-24 13:28:47 +00:00
Eike Ziller
df796e2aa5 Merge remote-tracking branch 'origin/4.4'
Change-Id: Id525d68a899f2db14c2d52c200a3a2a8a4e81590
2017-08-24 13:23:04 +02:00
hjk
45caf84cc9 ProjectExplorer: Fix parsing ports from netstat output on Windows
Handle IPv6, and do not try to interpret the result as hex.

Change-Id: I700c233d03cc706bc8712ab9fabee75d7f126df3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-24 09:53:00 +00:00
Nikolai Kosjar
024cfda06c Clang: Ensure that an unparsed translation unit is not suspended
Currently this might happen when registerTranslationUnitsForEditor is
called with visible documents that are not the ones that are registered.

Change-Id: I9ae5f75c8bbff6a11161a3387633726066001062
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-23 14:54:45 +00:00
Eike Ziller
ddd9e96afa Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/libs/utils/utils-lib.pri
	src/plugins/clangcodemodel/clangbackendipcintegration.h
	src/shared/qbs

Change-Id: I240e89afc76d8f40ce69d66683014b603f714707
2017-08-23 12:12:41 +02:00
Robert Loehning
7ba42ec95a Squish: Update workarounds for Clang Code Model
Change-Id: Ib7f5bb5670ff393f2b3bbecb1398bf382d6cca66
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-21 10:43:03 +00:00
Robert Loehning
50552a28fa Squish: Update expected project trees
Generated files and empty directories are now hidden by default

Change-Id: I8f3d53e9f5619b6d9aed938f90f5ec84e50b94ea
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-21 10:42:30 +00:00
hjk
8cb944f4ff Debugger: Display summaries for CoreFoundation types
Uses lldb's GetSummary() method to display values for CoreFoundation
string-like variables.

Task-number: QTCREATORBUG-18638
Change-Id: Icca6d9cf7b328c80b44eebe597259f38aba1c3ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-08-21 10:35:06 +00:00
Marco Bubke
af73f6e572 UnitTests: Add a header to import matcher in the global scope
Change-Id: If4fad39753dc5341a82f118fcd4b8d63ea5879b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-08-21 09:57:04 +00:00
Ivan Donchevskii
9c9baaac04 Clang: add unit-tests for follow symbol
Change-Id: I336fe29052237ede6f5c578daf01557400d9027c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-08-18 12:10:02 +00:00
Robert Loehning
e204e514d9 Tests: Fix instructions to testers
Change-Id: Ie22fca7cb68132876f867b57d7e1e5362289e0a4
Reviewed-by: hjk <hjk@qt.io>
2017-08-15 12:06:37 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Ivan Donchevskii
4ad0e5295c Clang: add follow symbol infrastructure
Add messages and jobs

Change-Id: I875280216da40ce08d972024789c060205746421
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-08-15 07:32:03 +00:00
Nikolai Kosjar
c0364564a4 Clang: Fix highlighting of template function in using declaration
This completes

    commit a3a62e78f7
    Clang: Fix highlighting of function in using declaration

Change-Id: I3c163096374d7a1f45a590bb8ebfe5f5a1f8d417
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-14 12:46:43 +00:00
hjk
6920d84745 Debugger: Add some hints on how the Python manual test works
Change-Id: I7a20451739c759510ea2d400493985ae543c6965
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-08-10 14:22:26 +00:00
Andre Hartmann
95310b28f3 CamelHumpMatcher: Modernize
* Use QRegularExpression instead QRegExp
* Use range-for instead foreach
* Remove QLatin1String/Char

Change-Id: I27516a4e3ca724c1f3cfab5b729d545547df873f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-09 11:21:34 +00:00
Marco Bubke
965379bc63 Utils: Don't touch the data if nothing is replace in SmallString
We called reserve for even if we do not found anything to replace.

Change-Id: I01dfbb9e8152605c01fa007eb93586f9a30cf56e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-08 12:30:59 +00:00
Nikolai Kosjar
9092ef7992 C++: Do not insert matching } within string
Regression from

    commit a6aa287720
    C++: Fine-tune auto insertion of '}'

Change-Id: I3ede8c7a1e3c73708d5d5a59c314e4b4596976b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-07 13:01:30 +00:00
Christian Stenger
1643b4e7a7 Squish: Remove workaround for fixed issue
Change-Id: I7cc40e83400bcf2614ae6eb34eecefa9bb75d172
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-07 11:02:19 +00:00
Christian Stenger
e45f4af3d4 Squish: Work around Squish issue on macOS if necessary
Change-Id: Ib6a6179ba51a907ee5e7aa1a6e30f345da217e52
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-07 11:02:09 +00:00
Christian Stenger
d93af8c90f Squish: Add special menu handling for macOS
When sub menus are going to get triggered the mouse
interaction done by Squish might close the sub menu
with the mouse click - avoid this by explicitly
setting the mouse cursor onto the item before
clicking it.

Change-Id: Id2afe9823304caac1bd66a423fe4a0ee12993ddd
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-07 10:05:53 +00:00
Marco Bubke
4ae0c6782f Utils: Fix replace function in SmallString
You need to allocate the memory before you replace a smaller text with
a larger one. It has some overhead because you go two times over the text
but it is anyway not designed for a large text.

Change-Id: I2f56f1300a5daf9e26632b5b0667023a09ff4bd2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 10:33:03 +00:00
Marco Bubke
45dbc743b0 Clang: Fix formatting
Change-Id: I2181639ea0725708a005898d20b74560439d4e2c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 10:05:26 +00:00
Marco Bubke
4c7cc99375 Utils: Fix short string capacity
The short string capacity is the data area size minus the size of \0.

Change-Id: Iffb4428bb81fc78bdc4c00218cf9f2c9ac8c25e5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:47:59 +00:00
Marco Bubke
4cc89b97de Utils: Don't allocate new memory if it is fitting in the short string
If you call reserve on a read only reference we always allocated on the
heap which is not that smart.

Change-Id: Ib9653c6fc87bc65716a966545c13f7ecb3712039
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:32:21 +00:00
Marco Bubke
0e3dc045a1 Utils: Fix replace crash
The bug was that we returned the new end() but not the old reallocated
after a reallocation of the memory. The return value is used to move the
string after the found sub string to the next found sub string to the
new position of after the replaced sub string. Because the new end moved
more to the right we moved a much bigger chunk of memory. So we
accessed memory outside of the allocated memory.

Change-Id: I9ac276e201eabee896190da0cf0ee1d86860777d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 09:05:33 +00:00
Andre Hartmann
3480579943 Extract CamelHumpMatcher for use in the C++/QML locator filters
Started-by: David Kaspar <dkaspar@blackberry.com>
Change-Id: I928ccdc4084f8d07826746c771e7fca6994f95ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-04 08:19:10 +00:00
Vikas Pachdha
95d34c9277 Squish: Fix Start debugging button identification
The tooltip on start debugging button may not contain project
name and thus no trailing space

Change-Id: Ibc934770feb8b2f7d5fff553b91e3803c222bdad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-03 12:42:44 +00:00
Christian Kandeler
8b8a32ba0e qbs build: Do not access the bundle module unconditionally
We should not rely on its presence on non-Darwin platforms.

Change-Id: I3fa722038f9c2d1139f6e1dc8c49d1c4d2fe0bee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-03 11:09:55 +00:00
Nikolai Kosjar
2d27c55310 Clang: Suspend least recently used translation units
...to free some memory.

The translation units of the 7 most recently used documents ("hot
documents", tracked by document visibility) are kept in memory.
Translation units of other documents are suspended and will be resumed
once they become visible again.

The resumption of a translation unit needs the same time as reparse
(since it is a reparse effectively).

The number of hot documents can be modified by the run time environment
variable QTC_CLANG_HOT_DOCUMENTS=N. Visible documents are always hot.

Task-number: QTCREATORBUG-11640
Change-Id: I68ecd2b1373e303372300203e42d90f65a4b39b3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:27:32 +00:00
Nikolai Kosjar
c2cfc62f08 Clang: Use document visibility as jobrequest conditions
This is in preparation for a follow-up change that will add jobs that
also operate on invisible documents.

Change-Id: I2a0fc3b95cc5ab2e267429134a534df64c901376
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:53 +00:00
Nikolai Kosjar
643854cb8b Clang: Fix incomplete JobRequest in tests
Change-Id: Ibbe8f2722c81393d997efb33e6b29e01fde5eee7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:49 +00:00
Marco Bubke
98035954c9 Sqlite: Add Read and ReadWrite mode to database
We want open databases in read only mode too.

Change-Id: I3b20602d4bd7841c9fca3260edce082d21022052
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:26 +00:00
Marco Bubke
52a911b972 Sqlite: Cleanup table and column handling
Using values instead of pointers makes the handling much easier. We can
remove ColumnDefinition too, and use SqliteColumn instead.

Change-Id: I224db9cc569c4dfb6e2746179b02096904bfbccb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:18 +00:00
Marco Bubke
a41183f6c7 Sqlite: Add variadic bind and write functions
You can now write

SqliteWriteStatement statement("UPDATE test SET name=?, number=?
                                WHERE rowid=?", database);

statement.write("see", 7.23, 1);

and

SqliteWriteStatement statement("UPDATE test SET name=@name, number=@number
                                WHERE rowid=@id", database);

statement.writeNamed("@name", "see", "@number", 7.23, "@id", 1);

This is more type safe than using variants and performant too.

Change-Id: Ie1ed2a6d326b956be5c4ec056214f3f5b1531f45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:12 +00:00
Marco Bubke
71e1f66284 Sqlite: Add excute to the database
To execute some simple pragmas etc..

Change-Id: Iaa74406a182897dd55ee3ee8dc4d4b94bb8a8e11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:50:07 +00:00
Christian Stenger
4ad12a2b60 Squish: Add some hints for the setup on macOS
Change-Id: I7aaaee9f32b22f632bdd80c2bcfb1f0cc19f1c8d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-02 06:42:33 +00:00
Marco Bubke
2fed425cd3 Clang: Cleanup string interface of sqlite
We only will need the utf8 optimized SmallString for the indexer database.
So we remove all other string bindings, QByteArray and QVariant.

Change-Id: I4a77901a80b26bf292fc85df535c2ccf3a8ab52f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 13:44:50 +00:00
Marco Bubke
daa3aad651 Utils: Add startWith to string view
We will add more function if they are needed.

Change-Id: Iac6b432327be32a0778a82c23ed2de5996c555a1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:28 +00:00
Marco Bubke
3b46c09520 Utils: Add isEmpty to string view
Change-Id: Ib7e77602dcdcdf481f6ab690bacef53c5dd92580
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:14 +00:00
Marco Bubke
01e1f13bb9 Utils: Add + operator to SmallString
It should not be used for chained concatenation. Use initializer list
instead.

auto text = in + 'x';

auto text = Utils::SmallString{in, "x", other, ", "};

Change-Id: I453d986913eae89fd5e1f525b9f4e0c4bd089467
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 12:40:08 +00:00
Marco Bubke
1b14ec5056 Utils: Add number to string conversion
We use std::to_string except for integer where we want a low overhead
solution.

Change-Id: I16ce7d575d83ff56e61a5038aa7f9a1febfaf34f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-01 12:40:02 +00:00
Christian Stenger
b7c8818eb9 Squish: Update expected texts
Change-Id: I0959635cdfe92335c0a5582119e145c8e7ea88b2
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-01 09:33:54 +00:00
Robert Loehning
d93f17466a Squish: Update expected completions
Change-Id: I0df3f777cb04e0609be01f5f0acf8b909f64ebd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-01 09:06:54 +00:00
Robert Loehning
11abd8edf7 Squish: Replace Qt4 SDK by self-built Qt 4.8.7
Change-Id: If990367afb01aae94755930c02c81ae82b23bb8f
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-31 14:04:00 +00:00
Marco Bubke
ebd675013f Clang: Fix highlightingmark test
Change-Id: I2c25e06e29e9024e8d3c38536e0e1f93ef65b7e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-31 12:04:05 +00:00
Eike Ziller
c01ddc4660 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsproject.h

Change-Id: I6b9cdf704be95ade02488c8b19582b6621282fb8
2017-07-28 15:24:14 +02:00
Marco Bubke
5ab729ea10 Clang: Fix tests for output arguments
Change-Id: I9aeef5758c6291f19efc3d72d5d985adad4c13ab
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-27 14:04:32 +00:00