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>
It was confusing to have both "Clang Code Model" and "clangd" project
settings pages, so we merge them.
Along the way, a lot of code dropped off.
Change-Id: I780850b716195c3729403ae59f0794c11b5c556d
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>
Do not pretend to support multiple message types, while no other
messages are actually implemented by us or even known to exist in the
wild.
Change-Id: I49ee2118b2e10f265ac641c195df8a9e5c97951c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The clangdclient.cpp file is rather large, and the AST stuff is a nicely
self-contained chunk of code to move out.
No functional changes.
Change-Id: I0240413f561f5c67ca5ee310b5c4253ffa62fdae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This allows us to switch between headers and sources with different base
names and/or locations, using symbol matching heuristics.
Task-number: QTCREATORBUG-16385
Change-Id: I2d9c07f412d70b75322ed65d491982d78674483d
Reviewed-by: David Schulz <david.schulz@qt.io>
Clicking the lightbulb should bring up a menu if and only if there is
more than one possible action for this location.
Amends 089e1edcbf.
Change-Id: I45348ed4fbf9b3f32e19bbe17f0c2c030ecd24ed
Reviewed-by: David Schulz <david.schulz@qt.io>
It's not feasible to map every possible setting into our UI, so instead
teach people how to use the clangd configuration mechanism.
Change-Id: Id11e81e25b687a4f49af4e090203faca3a75722d
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>