summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/test
Commit message (Collapse)AuthorAgeFilesLines
* SearchResultItem: Introduce SearchResultItemsJarek Kobus2023-05-082-18/+17
| | | | | | | | And reuse it. Change-Id: Ia052297340f2bf2478fbfdb2427b45e30bd9d067 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Move SearchResultItem/Color into UtilsJarek Kobus2023-05-082-19/+19
| | | | | | | | | It's going to be reused inside FileSearch. Change-Id: I8993d7158ff31c311c2283d32bc43465a8946a52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-131-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/python/pipsupport.cpp src/plugins/qtsupport/exampleslistmodel.cpp src/plugins/qtsupport/examplesparser.cpp tests/auto/examples/tst_examples.cpp Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
| * ClangCodeModel: Do not try to rename macros and namespaces with clangdChristian Kandeler2023-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, clangd refuses to rename macros and namespaces. Fall back to our old two-stage "find + replace" approach for macros (which clangd can find just fine) and employ the built-in code model for namespaces (as they don't get indexed at all by clangd). Change-Id: I08b1088ff4de9220427e089ef0700dbf2a944081 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-03-163-0/+7
|\ \ | |/ | | | | Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
| * ClangCodeModel: Consider concepts in semantic highlightingChristian Kandeler2023-03-143-0/+7
| | | | | | | | | | | | | | | | | | | | We highlight concepts as types for now, as it's a pretty good fit. We can always introduce a dedicated concept highlighting type later if there is demand. Task-number: QTCREATORBUG-28887 Change-Id: I405db5ca4351efd565b968e765fe8bca976a2800 Reviewed-by: David Schulz <david.schulz@qt.io>
* | ClangCodeModel: Remove unneeded codeChristian Kandeler2023-02-153-746/+21
|/ | | | | | | This was liblclang-specific. Change-Id: I3fe8a8d2d49b1c7b92a54a90864e4ead7152e4ae Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* ClangCodeModel: Ignore built-in typesChristian Kandeler2023-02-031-2/+0
| | | | | | | | | | ... in the semantic highlighter. The syntax highlighter already handles these. Change-Id: Ib1e80ec194021dbd2b4eca7a300db869ccddb7b0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Ignore number literalsChristian Kandeler2023-02-031-15/+0
| | | | | | | | | | ... in the semantic highlighter. The syntax highlighter already handles these. Change-Id: I26f6bca06c4fc648ffe59bd9e3639d81d2265755 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Ignore boolean and pointer literalsChristian Kandeler2023-02-021-3/+0
| | | | | | | | | | ... when doing semantic highlighting. The syntax highlighter already handles these. Change-Id: I048e033eda5b72d2e6eafaaccdb66040a00afe6a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Fully handle raw string literals in the syntax highlighterChristian Kandeler2023-02-021-9/+0
| | | | | | | | | | | | As of a3af941adf90bde0a2700f250f8d102cbdea3267, the built-in highlighter can properly handle multi-line raw string literals, so we don't need to abuse the semantic highlighter for this anymore. Fixes: QTCREATORBUG-26693 Fixes: QTCREATORBUG-28284 Change-Id: If644767dfa8a97294e84a541eea44143e8d1bb88 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Make use of new semantic token in clangdChristian Kandeler2023-02-011-8/+0
| | | | | | | | | ... for angle brackets. See https://reviews.llvm.org/D139926. Change-Id: I17be843005e290a8aec91573d9ed4bd0727e2dab Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Designer: Update C++ code model on an object name change in designerChristian Kandeler2023-01-271-1/+1
| | | | | | | | | | 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>
* FilePathify some testing codehjk2023-01-133-17/+14
| | | | | Change-Id: I3739a6eb3c2172078e9519e8186daf94ec74d99a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0619-19/+19
| | | | | | | | | | | | | | | 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>
* ClangCodeModel: Use newly implemented clangd support for operatorsChristian Kandeler2022-12-131-20/+2
| | | | | | | | | | | | | | | | We now get a semantic token "operator" from clangd; see https://reviews.llvm.org/D136594. As a side effect, this results in the following subtle changes in what exactly gets highlighted, both of which make sense: - The type part of a conversion operator is now highlighted as a type, not an operator. - We no longer add special highlighting for the brackets in operator new[] and operator delete[]. Change-Id: Ic149487496768762728a712c9fbcde5c9516529c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangTools: Pass context object to lambda connectionsJarek Kobus2022-12-081-1/+1
| | | | | | | | | Remove some unneeded lambda () brackets. Change-Id: I502eb5cd89505fb77c02abf44b7ce19541a8ac2f 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>
* CppEditor: Convert parts of ModelManagerInterface to FilePathhjk2022-11-291-6/+5
| | | | | Change-Id: If7503b6d6732e1735eb8d48ece6e80886d10c647 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Let users check for unused functions in (sub-)projectsChristian Kandeler2022-11-241-3/+8
| | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/9.0'Eike Ziller2022-11-101-16/+0
|\ | | | | | | Change-Id: Ie069f3b2a1200b3e665341b1d56ce836024b0d29
| * ClangCodeModel: Adapt to new upstream featureChristian Kandeler2022-11-081-16/+0
| | | | | | | | | | | | | | | | See https://reviews.llvm.org/D130015. Change-Id: I2c2590265f2d7a2c2b5e966b0dc65ceff6b1b3e6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* | ClangCodeModel: Fix usage type of constructors in "Find References"Christian Kandeler2022-11-082-0/+16
| | | | | | | | | | | | | | | | | | | | In particular, in a variable definition, the (invisible) reference to the constructor is *not* a declaration (but an implicit call). Change-Id: Ic1f29a4da360959e81ec536efbf1175924ea34d7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | CPlusPlus: Add more usage tagsChristian Kandeler2022-11-071-1/+1
| | | | | | | | | | | | | | To be used in subsequent patches. Change-Id: Id7140aa39bb2adba343cc12b0273c90f3c12abeb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CPlusPlus: Make Usage::Type QFlags-basedChristian Kandeler2022-11-071-61/+63
|/ | | | | | | | We want to extend the enum with more non-exclusive values. Change-Id: I4d8ebe1f7327139c7817b9f621b4b74a883c5e09 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | 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>
* ClangCodeModel: Implement following a symbol to its typeChristian Kandeler2022-09-262-31/+51
| | | | | | | | | Making use of LSP's "Go To Type Definition". Just the backend for now, UI to follow. Change-Id: Id73b2cf701eab03913477f6d4d3093e257e80dbd Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* ClangCodeModel: Support setting additional preprocessor directivesChristian Kandeler2022-09-131-2/+13
| | | | | | | | | | ... for a document. This was only ever implemented for the built-in code model. Fixes: QTCREATORBUG-20423 Change-Id: Ia99d0136e9995a5626058ad06173ea077be024d8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Adapt test to upstream changeChristian Kandeler2022-08-311-1/+2
| | | | | | | | | Apparently, friend declarations now get the "declaration" modifier. Change-Id: I30255d9953c96f2579a3fc66232a21edf406a01a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Fix testsChristian Kandeler2022-08-293-0/+66
| | | | | | | | Amends a7956df3ca45579c62b496621a7d3b55d73c98b. Change-Id: I7cbbd391ee015c5481e90ebdad356d9c6e916d5e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Clang/C++: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-292-6/+7
| | | | | | | | | | | | And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I7678b8e429b5eff79f87eb637f6f2131be43d904 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-2619-456/+38
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Remove variant.hMarco Bubke2022-08-231-1/+1
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local copy of std::variant and use for macOS std::variant too. Change-Id: I589d03b35fc56878b7392ffa7047a439e588fe43 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangCodeModel: Fix semantic highlighting for __func__Christian Kandeler2022-08-191-6/+6
| | | | | | | | | | This is a local variable, not a macro. Also take into account the new upstream support for this (see https://reviews.llvm.org/D131175), which required us to fix our assumption that "static" always means "static member". Change-Id: I69f3c98737571cbd55f9c64c02292426acb6031b Reviewed-by: David Schulz <david.schulz@qt.io>
* LanguageClient: Support limit parameter for completion requestChristian Kandeler2022-08-041-0/+4
| | | | | | | | | ... and make use of it in the ClangCodeModel tests. Change-Id: Ib2186273aec1db9b354892c2e1c4ebd82e3c1c96 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* LanguageClient: Add LanguageClientManager::clientAdded() signalChristian Kandeler2022-08-041-11/+11
| | | | | | | | For consumption by interested parties. Change-Id: I0cbecb4ce99cdd208fc3ff019d4f0ea672dcf752 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Make some ClangModelManagerSupport methods staticChristian Kandeler2022-08-021-3/+2
| | | | | | Change-Id: Ie34a89ae01783631c6482cff8d4866595e757be5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* GccToolChain: whitelist all -f* and -O* gcc optionsOswald Buddenhagen2022-07-205-5/+5
| | | | | | | | | | | | | | | | | there are way too many -f* options to catch all relevant ones. my particular case was the linux kernel, for which passing -mcmodel=kernel but not -fno-PIE caused a gcc error. if any particular option causes trouble, it should be blacklisted instead. also handle -O* while at it; -Og comes to mind as a relevant one. this follows 3b79fafb3 in spirit. Change-Id: I5de56082b695205409a8e82de2cab0618e2806a8 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Do not highlight macros as preprocessor statementsChristian Kandeler2022-06-291-12/+12
| | | | | | | | | | Macros are used like identifiers; there is no reason why they should need to have the same highlighting as a preprocessor directive. Fixes: QTCREATORBUG-23548 Change-Id: I186befc06ccb36a00451fd707c41e3687a84af14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Move a test over from unittestChristian Kandeler2022-06-232-0/+239
| | | | | | Change-Id: Iac295216fff274fbe4a109477b1a4c2bd2c98d5d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Fix test crashChristian Kandeler2022-05-251-0/+1
| | | | | | | Amends 509600da99. Change-Id: Ia07a65e509414b41f279f50c02893d1733fd1022 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangTools: Remove foreach / Q_FOREACH usageArtem Sokolovskii2022-05-241-1/+1
| | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: I1c4711d87e5f95fc1653dd9aa6448b105d017435 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove clangsupport dependency from pluginsChristian Kandeler2022-05-064-42/+38
| | | | | | | Change-Id: Ifd4215a590d32cd04fab720d0d8d5e746e81c6e8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Bump minimum clangd versionChristian Kandeler2022-05-041-42/+5
| | | | | | | | | | We need clangd >= 14 to get rid of the cumbersome compile_commands.json creation. Change-Id: I30c19a385e2d76e478985f3df64968d1cb3efe87 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Move fix-it tests into pluginChristian Kandeler2022-05-048-0/+204
| | | | | Change-Id: If53df602a42d8c1ffde5db6c8cb1e7fc269bb272 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Remove libclang-based completion and function hintsChristian Kandeler2022-05-026-1145/+5
| | | | | Change-Id: I742fb14b1aba3ba1f35a5c80bf553d2a735cac48 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Fix mis-detection of class members as operatorsChristian Kandeler2022-04-212-0/+17
| | | | | | | | | The name check was not tight enough. Change-Id: I5d813a29525bd5b5c23ce04f0bd9e5982a36536e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Fix another false positiveChristian Kandeler2022-04-132-0/+18
| | | | | | | | | | | | ... in output argument highlighting. If there is not enough information for clang to determine the const-ness of the argument passing (as it can happen in templates), do not report an output argument. Change-Id: I8d0143042f02ac44d8d971398014828cff14697f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* Another compile fix with current Qt devhjk2022-04-131-1/+2
| | | | | | | Add some #include <QList> that were implicit before. Change-Id: I9e64a6cc7548141e690568913fa75f80d5f3f464 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Fix another false positiveChristian Kandeler2022-04-132-7/+27
| | | | | | | | | | ... in output argument highlighting. Fixes: QTCREATORBUG-27367 Change-Id: I80fc7628d62de18f9114290b8104a7a1e9a95c4b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Fix another output argument mis-detectionChristian Kandeler2022-04-112-0/+11
| | | | | | | | | | | We need to relax the range check: In expressions such as x.y->z, the second argument for the operator->call is x.y, not just y. Fixes: QTCREATORBUG-27352 Change-Id: Ida542c11c129630f0a1d301508ec5f8076eb9902 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>