Commit Graph

89 Commits

Author SHA1 Message Date
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
Christian Kandeler
099fe7d5d1 CppEditor: Let users fold/unfold all comment blocks
Fixes: QTCREATORBUG-2449
Change-Id: Ib090f1bb0d0866f14ddb6dfb10bf2ff2563585e0
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-08 08:52:55 +00:00
hjk
8423d2b5e5 CppEditor: Proliferate use of FilePath a bit
Change-Id: I7e314d73a427bf40c10f3ca6c4c5804e31482f88
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-25 13:46:22 +00:00
hjk
0b83f110f4 CppEditor: Make a few CppModelManager functions static
... to simplify code using it.

Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-12 13:08:09 +00:00
hjk
90ba140545 CplusPlus: Use plainer callbacks to interact to the CppEditor
Lets us remove a few explicit CppModelManager::instance() call
in user code later.

Change-Id: Id8d846d06a0715b3d609cc5d52cc031e1d025fb1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-12 13:00:48 +00:00
Christian Kandeler
cf6bd7e012 Fix occurrences of the contains/insert anti-pattern
Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.

Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 09:51:54 +00:00
Eike Ziller
edd1a89807 Move SessionManager to Core plugin
Sessions are independent from projects, and this allows for removal of
e.g. the dependency from Bookmarks to ProjectExplorer.

Includes moving the command line arguments (-lastsession, <session>) to
Core plugin.

Change-Id: I6c578fd15c4990902e7196501de20f39376e90e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-25 11:15:41 +00:00
Jarek Kobus
c8c48d899f Locator: Fix style and reuse LocatorFilterEntries
Fix names of private members of LocatorModel to have
one common style.

Reuse LocatorFilterEntries where possible.

Change-Id: Icca1e396b9fafd165adf35939dd7859032f90c0c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-16 08:33:36 +00:00
Jarek Kobus
b1d520c6b1 CppLocatorFilters: Remove the old matchesFor() implementation
Move the implementation of CppCurrentDocumentFilter into
cpplocatorfilter.h/cpp.

Rename CppLocatorFilter into CppAllSymbolsFilter to
conform to the other names.

Remove some unneeded intermediate classes now.

Change-Id: Ia911dc826b83ba11894757fc353ff72211910ff7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-12 06:45:27 +00:00
Jarek Kobus
7d87233c9c ClangCodeModel: Remove the old matchesFor() implementation
Rename some filter classes to conform to the names for cpp filters.
Remove some unneeded intermediate classes now.

Change-Id: Ib4fa295fa60da61c42c792556751d954ddb936e7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-11 10:24:08 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
b1e65195ac CppEditor/LanguageClient: Reuse MatcherType enum
Change-Id: I95a8c902ddf6d7525543ccbc2acf45fe273a12f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-21 15:19:49 +00:00
Jarek Kobus
64f946445c CppLocatorFilter: Add cppCurrentDocumentMatcher()
Add also a test for it.

Change-Id: I324b1a2cbe89c0a1258dde93524689cb85e06737
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 11:59:01 +00:00
Jarek Kobus
99b5d93cfb LocatorMatcher: Introduce MatcherType enum
Use it for registering/getting different kinds of matchers.

Change-Id: I6f944e0332bf8c512892a00b8ba88f9939f34682
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 09:18:11 +00:00
Jarek Kobus
6e8988c926 CppModelManager: Use locator matcher for unused functions
With this patch, when both cpp and lsp function filters
are available, they now run in parallel. The execution time
for getting the filter results (~110 K hits) for the
Creator codebase went goes from ~1100 ms into ~650 ms.

This patch also solves the potential issue with interference
between parallel runs of functions filter in locator and
in find unused functions.

Change-Id: I8f7f0b85d325848c04760ab76a7b9f02bcb5991e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-19 12:54:25 +00:00
Jarek Kobus
8f44964059 CppCurrentDocumentFilter: Get rid of the arg from c'tor
It's always CppModelManager::instance().

Change-Id: Ia049ad3bd452f8773d679549c33981460c2705d4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-19 12:14:41 +00:00
Jarek Kobus
0c3789726d LocatorMatcher: Introduce LocatorMatcherTaskCreator
Register cpp and lsp matchers for all symbols,
classes and functions.

Change-Id: Id85c8164077ec395dac7e6ff45acc89db9e6ae08
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-18 11:40:16 +00:00
Jarek Kobus
37f2d68464 CppModelManager: Pass context object into signal connection
Change-Id: I6b66fbc6300597534a1498e4abbd8c3162cee73e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-05 12:29:47 +00:00
Jarek Kobus
36463f3c87 CppLocatorFilter: Don't repeat CppLocatorData arg in c'tors
It's always the same instance of:
CppEditor::CppModelManager::instance()->locatorData().

Change-Id: I7d8aa2da6f0055d91b519efb6ebdf2177794e0b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-04 08:08:09 +00:00
Jarek Kobus
f83dbc3316 CppModelManager: Avoid using ILocatorFilter::allLocatorFilters()
Use dedicated CppModelManager::functionsFilter().

Change-Id: Iafc93ae9d1d1f6a4767289238e2fd36b276611c2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 08:00:47 +00:00
hjk
884a1d6f94 Replace a few \returns by Returns
Change-Id: I09c633e610421f5cc8257b15de60ffa98d890ee0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-03-24 14:51:55 +00:00
Jarek Kobus
215f79f580 LocatorFilter classes: Use more linkForEditor
Limit the usage of ambiguous internalData.

Change-Id: Ice67884b9fb2ff303939cd5998c6e80453e82530
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-03 14:06:08 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
Jarek Kobus
b364e4a9cd LocatorFilter classes: Use Core namespace
Change-Id: I4fd1b1ed6aa9d844ed49123e80bfb066b9fa7af2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-23 08:28:45 +00:00
Eike Ziller
379bf65e96 Some fixes in translated strings
- doesn't make sense to translate "%1"
- showPreprocessedFile: "reason" contains full stop, put at the end
- add missing closing >
- remove whitespace at the end of translated string
- added missing quotes and full stops
- Remove some control text from tr

Change-Id: I5537c3d12d038e25e2209af1198129fbf959b43c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-02-15 12:45:48 +00:00
Christian Kandeler
0d909c353c Designer: Update C++ code model on an object name change in designer
We try to locate the old symbol name in the generated ui header and
rename the symbol in the background.

Task-number: QTCREATORBUG-1179
Change-Id: Iaf68e3922cd728cbc87d0dc97125e34b8bdaa6be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-27 10:02:52 +00:00
hjk
2ce413112b Utils: Push FilePath::toString border line a bit further
... in SaveFile

Change-Id: I80164853b8a756af8c74038b0375c423a6f500e2
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-01-13 09:50:11 +00:00
Alessandro Portale
f7bcd4f574 CppEditor: Convert to Tr::tr
Change-Id: Ic4025e06e17c45eb6dc2162fb7f21f5b8aebe84d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-12 06:46:45 +00:00
hjk
b87f0519e3 CppEditor: Use FilePath for ProjectPath::m_sourceFiles
... and update using code.

Change-Id: I682727a4b2982dba388e7cc7b9488225748d591f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-11 09:54:25 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Jarek Kobus
63783f22c3 CppIndexingSupport: Flatten class hierarchy
Don't make CppIndexingSupport a pure virtual class as there is
only one subclass.

Change-Id: I9f216a2f1f5d04f601d07b9507a4e9cf27ff7c46
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-09 12:17:35 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
e42d24fca9 CppEditor: FilePathify some of the refactoring operations
... and adjust surrounding code.

Change-Id: I1d36e5a0c6ba14a1d9b8fd59340f1bb2a1e45ad1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-16 14:27:50 +00:00
hjk
4159c4b5d5 CppEditor: More migration to FilePath
Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-14 09:14:12 +00:00
hjk
b354421f27 CppEditor: Use FilePath in fileSizeExceedsLimit()
... and adapt caller side.

Change-Id: Idd832101962dcdc8b24f96bebbdb77fd3e29ba7c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 12:07:45 +00:00
hjk
39ffdb416f CPlusPlus: Use FilePath for resolved include paths
... and fix fallout.

Change-Id: I66886e91ff476eff15db51cc024a8021e952d44d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-30 17:27:56 +00:00
hjk
83720540a1 CppEditor: Convert parts of ModelManagerInterface to FilePath
Change-Id: If7503b6d6732e1735eb8d48ece6e80886d10c647
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-29 12:27:10 +00:00
hjk
03a91f9f98 CppEditor: Remove Snapshot::remove(QString) overload
... and fix fallout.

Change-Id: Ibbf865c3e4158fc98bb9b5372ce0633807b85576
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-29 08:25:16 +00:00
hjk
196e73fa16 CppEditor: Convert AbstractEditorSupport interface to FilePath
Change-Id: I47439e154bc28d40e112b7eef46fa1f57a8b3fce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-28 14:02:05 +00:00
hjk
038771051d CppEditor: Switch to FilePath in IndexItem
... and fix fallout.

Change-Id: I45d27146806bdcb5ceb728b710eca51c7cd32ee2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-25 11:16:38 +00:00
hjk
40ba25b691 CPlusPlus: Return FilePaths from Document::includedFile
... and fix fallout.

Change-Id: Ieaad57700fa48d0c4a0dd9bf2c284315579b9473
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-25 09:23:39 +00:00
hjk
67e9c2d7a0 CppEditor: Proliferate FilePath use
Remove SnapShot::{find,contains}(QString) overloads and fix fallout.

Change-Id: I50c415826939e09ac111f33def611c7478fa5d97
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-25 09:01:05 +00:00
Christian Kandeler
bfecefabc0 CppEditor: Let users check for unused functions in (sub-)projects
Note that especially in C++, there can be a lot of false positives,
especially in template-heavy code bases. We filter out the most notorious
offenders, namely:
    - templates themselves
    - constructors and destructors
    - *begin() and *end()
    - qHash()
    - main()
Since the code model does not know about symbol visibility, the
functionality is quite useless for libraries, unless you want to check
your test coverage.
The procedure is rather slow, but that shouldn't matter so much, as it's
something you'll only run "once in a while".

Fixes: QTCREATORBUG-6772
Change-Id: If00a537b760a9b0babdda6c848133715c3240155
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-24 09:27:03 +00:00
hjk
fa1adf4d40 CPlusPlus: Proliferate FilePath use
The starts with CppDocument::filePath(), plus a bit of the fallout

This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.

Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).

There should be no difference for local operation with this patch.

Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-22 15:30:00 +00:00
Tim Jenssen
aa33927651 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertychangesmodel.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertymodel.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.h

Change-Id: Ib029a830ee99190bc4ea2ad75d9300bfa86b42d9
2022-10-25 19:02:15 +02:00
Philip Van Hoof
55b8ab7846 cppeditor: make it possible to ignore patterns
Allows the user to ignore certain patterns so that these files wont
be indexed

Fixes: QTCREATORBUG-28313
Change-Id: I2a860a473ca1a267e9fab31436fc98b8f4004484
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-25 13:46:02 +00:00
Christian Kandeler
8608386c36 CppEditor: Adapt include locations when renaming ui files
Fixes: QTCREATORBUG-14259
Change-Id: I5e8209338b531f0e65d85b423053bd19a8b47652
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-24 10:07:26 +00:00
Leena Miettinen
c4ac5e414a UI text: Use a full stop in the end of messages
And fix the capitalization of some message box titles.

Task-number: QTCREATORBUG-28334
Change-Id: I858eefd5a12494723c40e0253a3708fa77284d1b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-20 09:25:08 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00