Commit Graph

5172 Commits

Author SHA1 Message Date
Marco Bubke
07f9f8da9d UnitTests: Fix wrong file name in pro file
Change-Id: Ibef9b5010815409e4a82453175c63c48dd3a2f15
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-30 19:59:32 +00:00
hjk
e404ba9de1 PortGatherer: Add test for Mac's netstat output.
Change-Id: I6df357502e5621e858a848c567fe1590762d5fc1
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-08-30 12:56:11 +00:00
Eike Ziller
696a978942 Merge remote-tracking branch 'origin/4.4'
Change-Id: I5b12586086297b57e250bbbd9c94818623ad33f9
2017-08-30 14:49:19 +02:00
Robert Loehning
ba1036fd46 Squish: Fix searching for filename in windowTitle
Currently, only the end of a filename as actually
compared since the title also contains "filename.h"
when the title starts with "otherfilename.h"

Change-Id: I60dd4dc1fd7c53fee2ddbc44953bcfe4d75c7530
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-30 12:27:37 +00:00
Marco Bubke
890e2bd517 Clang: Fix tests
Change-Id: Ic6e8da5c7db0cfa325774640fe1202845d7b3e00
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-30 08:56:10 +00:00
Orgad Shaneh
139792ee25 Merge remote-tracking branch 'origin/4.4'
Change-Id: I9ab2c68d2bd07b0dd89051a2f5f6fa51676d8594
2017-08-30 01:24:11 +03:00
Marco Bubke
efcfb5ee15 Clang: Improve file path caching
The old algorithm was comparing the string two times. One timer for smaller
and one for larger. And memcmp on a long string still costs. The new one
has a three state so it can compare smaller, greater and equal in one.
There is a reverse version too which has big advantage for file paths.

Change-Id: Ica4024f0a071803c697e2c1f26edd3eb1b203f9f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:43 +00:00
Marco Bubke
a307ee7444 Clang: Add SymbolQuery
Change-Id: I5cb81dffd6f1fda6bdcba0eedaf79f0bc91348b5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:37 +00:00
Marco Bubke
f49a1d721c Clang: Add symbol storage
Extend file path cache to 64 bit integer.

Change-Id: I5627f13d59a3214f389087038482cbcc8d0eb484
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:24 +00:00
Marco Bubke
81d43b8a11 Clang: Add symbol indexer
Change-Id: I8ff879631ae022bc870431628be002903360369c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:17 +00:00
Marco Bubke
f0e00a8c25 Clang: Add symbols collector
Change-Id: I64c25eef8eaa6cc6c3ff09d41866972b6c7248d0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:09 +00:00
Marco Bubke
8640ef1927 Utils: Convert to SmallStringView for comparison
Change-Id: I38d9716225b81091e8e75b26c9c2258a2aefa987
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:36:57 +00:00
Marco Bubke
7c0331ab93 Clang: Rename library clangbackendipc to clangsupport
We already share same classes there which has nothing to do with IPC and
I want to more for sharing. So we should use a name which fits better.

Change-Id: Idfb12b6de714206117b92634ad719c6a0e290e78
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:36:35 +00:00
Christian Stenger
9fde45fb52 Squish: Add possible error and respective handling
When using pastebin there can be various errors. Add another
one and try to handle it gracefully as this is a server side error
we cannot influence ourselves.

Change-Id: I2bcd5b7752bfbb98e2b3fd41cc8ebb9daf0ebf32
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-08-29 13:52:18 +00:00
Marco Bubke
1a25b61576 Sqlite: Improve Sqlite wrapper
It is now possible to read values at once.

for (auto [name, value] : statement.tupleValues<String, int>(1000, "foo", 20))
   ....

Change-Id: I3d4bc5218810b4620e1df625126aa490f30bbc71
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 14:50:33 +00:00
Marco Bubke
8617f497bc Utils: Cleanup StringCache
There is now a forward header and it is possible template the string type.

Change-Id: Ibebd32c475a2d89a90da7190e77d44278eb43740
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 13:47:26 +00:00
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
Nikolai Kosjar
f07bc467a3 Clang: Tests: Improve DocumentSuspenderResumer
* Use IsEmpty()
* Set up proper error printer

Change-Id: I9d4750f8e69e0660ece33015d439c796077d1727
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-24 12:52:10 +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