summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/clangfollowsymbol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ClangCodeModel: Remove libclang fallback for "follow symbol"Christian Kandeler2022-04-281-274/+0
| | | | | | | | | | | | ... and "switch between declaration/definition". It's either clangd or built-in code model now. Use the opportunity to dissolve the pointless FollowSymbolInterface class hierarchy, which introduced a confusing parallel inheritance chain. Change-Id: I792ad55656c5dd9f10c6b4db7c5c36cf7be45125 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Remove fallback code for clangd < 13Christian Kandeler2022-02-141-1/+1
| | | | | | | Amends 4dfdbf91f6. Change-Id: Ie8657329380e83aeb76503e360afa5ebf0e60fbb Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Clean file paths resulting from "follow symbol"Christian Kandeler2021-11-121-4/+5
| | | | | | | | | | | | | Apparently, libclang can give us non-cleaned paths, which we never noticed until ea215d612d. We also restore the previous behavior of TextDocument::setFilePath() in order to prevent similar regressions elsewhere. Fixes: QTCREATORBUG-26561 Change-Id: I218ed29600e9fb6b299aa2ba0b9d1464f475c06b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-13/+13
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Implement declaration/definition switch via clangdChristian Kandeler2021-06-181-0/+18
| | | | | Change-Id: I522a415d76fbc5332e5cc1fdfd2d7ab19cb9ed64 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangCodeModel: Let user choose the overrideChristian Kandeler2021-06-011-4/+2
| | | | | | | | | .... when following virtual function calls. This brings us up to par with the built-in code model. We do lose the icons, but they are of very little use in this context. Change-Id: I29b27d538e7277d06a5af7acee07bddb6eb94c98 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: filepathify LinkDavid Schulz2021-05-251-4/+7
| | | | | Change-Id: Ie62500bde139158e776f9698ee0ea00c2a113f93 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangCodeModel: Use clangd for all "follow symbol" actionsChristian Kandeler2021-05-211-1/+14
| | | | | Change-Id: I4e33342d9683c24ad6ea5fbb578a1b460790aa4d Reviewed-by: David Schulz <david.schulz@qt.io>
* Compile fixes with Qt 6Jarek Kobus2020-11-051-2/+2
| | | | | Change-Id: Ia5335bef6aeaff3ce12339db52d96793ff588824 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-2/+2
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-1/+1
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Follow symbol with Ctrl+click on invalid cursorsIvan Donchevskii2019-02-221-6/+17
| | | | | | | | | When cursor is invalid try to follow it with built-in code model and highlight the token in case of success. Fixes: QTCREATORBUG-21637 Change-Id: I4c765882817fa150a155074c9d71beceb5905af8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangCodeModel: ModernizeNikolai Kosjar2019-02-111-1/+3
| | | | | Change-Id: Ie001a2d8ed9c82ac5fedf8e59bd56d7bbdddf919 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Clang: Stop going to F2 location if invocation context changedNikolai Kosjar2019-01-081-3/+10
| | | | | | | | | If follow symbol takes longer than expected and the user switched to another file or mode, abort processing the result in order to avoid confusion. Change-Id: I0106d49006d2cfd8c8dad0af66d97cee5e5c36de Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Utils: Adjust column numbers affected by convertPosition changeIvan Donchevskii2018-11-091-7/+7
| | | | | | | | | | | | | | convertPosition change was introduced in 931ec39f64a. It changed 0-based column to 1-based which is how it naturally is in Qt Creator. This fixed some usages but broke many more. This is an attempt to fix the remaining use cases. Fixes CppEditor auto-tests. Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-09-191-2/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/qnx/qnxrunconfiguration.cpp Change-Id: I6069e6a644c6d50c3d2821d51c368129b6957017
| * Clang: Fix possible out of bounds access in ClangFollowSymbolIvan Donchevskii2018-09-181-2/+2
| | | | | | | | | | Change-Id: I80132dca9c26a54059f2c1ba872b102df8e6e0d7 Reviewed-by: hjk <hjk@qt.io>
* | Clang: Enable follow symbol for 'auto' keywordIvan Donchevskii2018-09-121-1/+3
|/ | | | | | | | | It will follow to the Type which is deduced from auto or to the pointee type if auto is deduced to pointer. Task-number: QTCREATORBUG-17191 Change-Id: I57db3f9b68c3da861691ab148fe39774ad5fceec Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Use built-in follow symbol for virtual methodsIvan Donchevskii2018-06-151-2/+2
| | | | | | | | | | ClangCodeModel currently does not provide a list of overrides. Therefore it makes sense to use ClangCodeModel result for virtual method only if built-in code model does not find anything. Task-number: QTCREATORBUG-20584 Change-Id: I5b4fac7974f990e741d3438ab61827670a8ce8d8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Use follow symbol result from clang when global failsIvan Donchevskii2018-06-041-2/+15
| | | | | | | | | When built-in code model fails to follow symbol under cursor fall back to the clang result even if it only follows to the decalration. Change-Id: I22d8c5fee6ab7594b1d1b7ce8104414db28383c7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Use current TranslationUnit follow symbol based on clang code modelIvan Donchevskii2018-04-261-12/+64
| | | | | | | | | | | | | | | | | | | It might be quite a safe replacement which can fix builtin code model issues. If clang code model fails to follow symbol or does not find a definition when it's required we fall back to the built-in code model to proceed with project-wide follow symbol. To make it almost a full replacement tweak include paths underline on cursor hover to match what we have in built-in code model. SIGNAL/SLOTS macros are not yet supported but can be handled in follow up patch. Task-number: QTCREATORBUG-19477 Change-Id: Id1611511d661a8aaf3e93502b4e03e1792c7c1d3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangSupport: Use simpler structures in some caseshjk2018-04-061-9/+9
| | | | | | | | | The patch is mostly mechanical, but contains also a few spurious changes from values references for some local variables, foreach -> ranged for etc that I coulnd't resist. Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Check that follow symbol QFuture is not cancelledIvan Donchevskii2018-03-201-0/+2
| | | | | | | We can't take QFuture result if it's cancelled. Change-Id: I493e083c0d35e753d1b2616caf2081f472393e34 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Remove processEvents call from follow symbolIvan Donchevskii2018-03-191-29/+36
| | | | | | | | processEvents is a bad way of dealing with asynchronous requests. Use QFutureWatcher for that purpose. Change-Id: I3839cb9db80a6d391f6af1178e96986a325b7b99 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: extra clangbackend job to collect full token infoIvan Donchevskii2018-02-021-2/+2
| | | | | | | | | Limit document annotations job to only highlighting data collection and move more expensive calls into separate job that runs after it. Change-Id: Ie792a3f741ac45c81033dd5b3a20ed061604f927 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: fix experimantal follow symbolIvan Donchevskii2018-01-021-1/+1
| | | | | | | | ...when the cursor points to the next token but the current one is selected. Change-Id: I73fe1b0c82ccda0489b878f3909b8767c54b5ec2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: add globalFollowSymbol to RefactoringEngineIvan Donchevskii2017-12-141-6/+11
| | | | | | | Allows to follow outside of current TU. Change-Id: Ieea2fd72bfdf6d60a988b40efcf2f41c5a71d045 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Rename HighlightingMark to TokenInfoIvan Donchevskii2017-12-111-8/+8
| | | | | | | | | | | Before adding additional members into that class it makes sense to rename it to better represent its content. Other classes serving the same purpose are also renamed to keep the names consistent. Change-Id: I3c8517e42aae29779d71ec9c85b713cff581a473 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* TextEditor: move Link class to separate header in UtilsIvan Donchevskii2017-11-271-13/+9
| | | | | | | Link is a common class and is used across the plugins. Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: move convenience from texteditor to utilsIvan Donchevskii2017-09-221-4/+4
| | | | | | | Allows to use this header without texteditor dependency. Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: use HighlightingMarks for hover with Ctrl highlightingIvan Donchevskii2017-09-221-18/+79
| | | | | | | | | | Make this highlighting work without builtin code model but based on the HighlightingMarks that we already have from ClangCodeModel. Redundant parameters are removed by this change. Change-Id: I73b5dab46ba59d2f813236831818f0a9bc94c5bc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppEditor: refactor FollowSymbolIvan Donchevskii2017-09-151-0/+83
Create an interface to get the ability to use another FollowSymbol implementation Change-Id: I5802f62523ff3ee47b8a14e487adf43edcb6c9b1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>