Commit Graph

108 Commits

Author SHA1 Message Date
hjk
d234e71643 All: More ToolChain->Toolchain renamings
And removal of one unused function declaration.

Change-Id: I594e23401d8f247d3be081ce850005574951899d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-19 10:29:33 +00:00
Christian Kandeler
69571427a3 CppEditor: Fix renaming include directives after bulk renamings
E.g. when renaming a class, the C++ model manager needs to know about
both renamings (.h and .cpp) at the same time. This way, it is able to
open the correct including file, even though the code model likely still
refers to the old, now-gone file path.

Fixes: QTCREATORBUG-30154
Change-Id: I583e77a4920c7cc3e642d7bebba46d734ae6bbe0
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-10 11:04:04 +00:00
hjk
d2ca6afb8f ProjectExplorer: Some more Toolchain renamings
Change-Id: If8bdfd5e49a031a511bc0e062727495a12d2d3bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-14 14:22:47 +00:00
Marcus Tillmanns
21c868604e CppEditor: Use Utils::SynchronizedValue for project data
Change-Id: I67c07c2f5f5f7e8bb6b10d4f492ad062f82977be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-14 14:19:31 +00:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
Eike Ziller
57d4ea4dcc Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/designer/formeditor.cpp
	src/plugins/git/gitplugin.cpp

Change-Id: I554a844fab4c55249a00f394f9ba174c7548dbbe
2023-12-11 09:28:21 +01:00
Christian Kandeler
68e44b3372 CppEditor: Do not insert empty project part lists
... in CppModelManager::projectPart().
Amends 96c21b0e36.

Change-Id: I7e0dac258a4b4576a6ab772cb7074068a1bea726
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-07 11:16:09 +00:00
hjk
f130918026 ProjectExplorer: Rename GccToolChain to GccToolchain
And some related classes/comments.

Change-Id: I9a0661f1a040de594145d403c673ec2e54990e0d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-04 15:23:48 +00:00
hjk
3bbda8f9da ProjectExplorer: Rename Tool{C,c}hainKitAspect
Change-Id: I74460b6402ab00f972c208023f03fac617982a11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 13:35:28 +00:00
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +00:00
Christian Kandeler
cf74409bac TextEditor: Introduce PlainRefactoringFileFactory
This makes it immediately clear that there are more specialized variants
available, which helps users make a conscious decision.

Change-Id: I35feb4bed2d91fb4f83ede6e731d9ce89fd4af3f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-20 14:37:37 +00:00
Christian Kandeler
78b9edd251 TextEditor: Rename class RefactoringChanges
... and remove outdated comment.

Change-Id: I6dcd0a38608192ccdd6734affd33e170d39e8299
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-20 14:37:19 +00:00
Christian Kandeler
09e495f01a ClangCodeModel: Fall back to built-in code model when following symbols
In normal interactive mode, users likely want fuzzy look-up, e.g. to a
non-matching overload if no exact match is present.

Fixes: QTCREATORBUG-29814
Change-Id: I55ca32c001e619d374cc015a7dd2f1564ed2a2c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-09 11:50:22 +00:00
David Schulz
05ce5ea14d CppEditor: Fix crash when calling CppModelManager::projectPart
find and end of QMap potentially detach the container, so we have to use
constFind and constEnd

Fixes: QTCREATORBUG-29716
Change-Id: I2fef46580ff5b58a70201841423e5ca0a7b4d107
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 08:39:05 +00:00
Eike Ziller
8f3e77a3ae Tr: Re-fix plurals
The number for the plural must be given as the 3rd argument
to the tr() call, not as an arg().

Amends 1359e9c84f

Change-Id: I45241a6acd82041c320bbe476cd2b4cc92247ef3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-18 11:22:11 +00:00
Eike Ziller
1359e9c84f Tr: Fix some plurals
Change-Id: I9d7a52a64536e6e1c0a9da4f3cb2f3a116afb6cd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-16 13:19:28 +00:00
hjk
6193cb3294 CppEditor: Stop updating things when shutting down
Fixes: QTCREATORBUG-29735
Change-Id: Ic1ee1798e156b5ddf564a721f5a4e8892ae40f63
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-11 12:23:55 +00:00
David Schulz
f491d93d2a CppEditor: remove superfluous locker in model manager
This locker potentially results in a freeze since the called projectPart
might require to lock for writing, which is not possible if the read
locker is still there. Additionally there is nothing we would need the
lock for in projectPartFromDependencies.

Change-Id: If957edfb4ebc45e18141cb14a63bf9567242cc48
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-13 08:48:22 +00:00
David Schulz
96c21b0e36 CppEditor: optimize CppModelManager projectPartForFile
Calling FilePath::canonicalPath is expensive on Windows, so only call it
if we cannot find the filePath in the cache and save the result to the
cache again. This reduces the time to parse the auto test for the Qt
Creator repository from 10s to 2s here. It also improves the performance
of various quickfixes and follow symbol of the built-in code model by a
similar factor.

Change-Id: I7025828e1b91f492825b10753e3b97e1c917fbfd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-09-11 10:19:12 +00:00
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