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>
According to the protocol a hover request can also return a Null as a
result. Reflect this in the protocol implementation and adapt usages.
Change-Id: I14ce71639c64b6de00e9c1198617083c1a3de9eb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Do not report quickfixes with a diagnostic since those are already
collected by the ClangdQuickFixFactory as builtin quickfixes.
Change-Id: I8d29a08b823291f8beaa762c09b7d29a4b9d0384
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Set the diagnostic to the containing code action when generating
refactor markers. This makes sure the light bulb is displayed at the
diagnostic and not the edit location.
Change-Id: I46ac7a19879d2358eb49f5cb1b695ee10a0c682d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>