We cannot use clangd's rename facilities yet, as there is a
hardcoded limit of affected files.
This mostly reverts commit 7dc2c6b3b3.
Change-Id: Ie441796569b533948cc028c867175d6f9d4b9d54
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Contrary to our original expectation, clangd's textDocument/rename does
not necessarily yield the same locations as /references. Instead, it can
find fewer or more occurrences, depending on server-side logic about what
constitutes a reference vs what should be renamed. Therefore, we need to
use /rename for proper behavior.
Fixes: QTCREATORBUG-27978
Fixes: QTCREATORBUG-28109
Change-Id: I27d092e807a4aa59dc0674111429c77ca13010e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
I've repeatedly encountered std::bad_alloc recently, and would like to
get more info about where it is triggered. The crash comes from Qt,
apparently after the original thread has alresdy finished, so the
original location is not found in the stack trace.
Change-Id: I7bbdcce6534ea0c846a69af33ad8634c3415572d
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>
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>
To avoid additional dependencies, let the QtSupport plugin register a
function for filtering help URLs, and add information about the
originating file path to the help items created by the context help
handlers. The filter hook then finds out the corresponding project,
active target, and corresponding Qt version, and filters the help URLs
accordingly.
With the default setting in "Kits > Qt Versions > Register
documentation", only the highest versioned documentation set within a
major Qt version is registered, so context help now shows the highest
versioned help from Qt 5 or Qt 6 depending on active target. If that is
changed to "All", context help now shows documentation from exactly the
version that is currently used by the project.
Fixes: QTCREATORBUG-10331
Change-Id: I7d87793737cc5ab7d228ee4bfe568d7e8343ee7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... in the base class.
This is purely a heuristic, but should work well for Qt-based user
projects.
Fixes: QTCREATORBUG-9845
Change-Id: Icca336b3568c2c5f07a9eaf6a183bf6c7c4275bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
... 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>
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.
Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
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>
Users would set QTC_CLANGD_COMPLETION_RESULTS in the Qt Creator
system environment variable dialog and expect that clangd would
the be configured with the corresponding --limit-results value.
Task-number: QTCREATORBUG-28071
Change-Id: Ia7a9b6a96fabe7ba16906c547a15716f0b83f0ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This amends 01ceb3a3cb, where we failed to
consider the case of projects with lots of UI headers, which cause
excessive memory use by clangd with our current simplistic approach.
Instead, we now only open ui headers that are used by currently open
documents.
Note that this approach will fail for indirect includes via header files,
but people who do that do not deserve happiness.
Change-Id: I1ef2add701e0f13dc0da79267d3c1367c1b496cc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
A user can set a value to the QTC_CLANGD_COMPLETION_RESULTS
environment variable which will be passed as argument to clangd's
--limit-results.
The clangd default value is 100.
Task-number: QTCREATORBUG-27152
Change-Id: Ic3e512a735fda1540b4f0ab56e39f9c5f0213e79
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Make it consistent with Qt American style.
Change-Id: I01a70f282d654d23f2341352cf4f6fea22aa49fa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This was broken by our compiler command line optimizations, resulting in
"-x" rather than "/T" appearing for MSVC/clang-cl toolchains and causing
clangd to assume C instead of C++ for some files.
Change-Id: Ib98db88ac90e4e45a7016a7edcb80a279df372aa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Delete it later instead.
Fixes: QTCREATORBUG-27803
Change-Id: I1108a87bc762a7da690b8999c9e73e127d79d3c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
We add the attribute textually and show a warning icon.
Fixes: QTCREATORBUG-2325
Change-Id: Icc0305a703e26c84095167087b30fa3456f97614
Reviewed-by: David Schulz <david.schulz@qt.io>
To display the parent function, first we find it in displayResults and
store the information to SearchResultItem, then
SearchResultTreeItemDelegate gets the information and renders it.
Similar approach is applied to ClangdClient, in addSearchResultsForFile.
This change also adds default style for containing function highlight in
the search.
Default foreground and background colors are same as usual text colors.
Task-number: QTCREATORBUG-27550
Change-Id: Id1251afa192f8d1232524742b7c211770bcb83fb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>