Do not automatically setup a clangd that is too old and mark them as
invalid if they are manually selected.
Change-Id: Ie9662a8821df8fc678eabc4b8a08375723b4d1c3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.
For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.
Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
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>
Allows the user to ignore certain patterns so that these files wont
be indexed
Fixes: QTCREATORBUG-28313
Change-Id: I2a860a473ca1a267e9fab31436fc98b8f4004484
Reviewed-by: Christian Kandeler <christian.kandeler@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>
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>
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>
If the user set the QTC_CLANGD_COMPLETION_RESULTS environment variable,
use that value as the default value for the settings page widget value.
Change-Id: I525e8bb4a5631b7d8461f18d1fc5c6972bd758cb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Linux distributions can get creative with the location of the clang
headers. So if we find a clang executable alongside clangd, ask it for
the base directory and try the hardcoded paths only as a fallback.
Fixes: QTCREATORBUG-27760
Change-Id: I9480b170df05598255c01be44be4b0312d0929f8
Reviewed-by: David Schulz <david.schulz@qt.io>
This is unneeded when followed by waitForFinished().
Change-Id: Ifc63feb2abbbc38bf4b119489ceb07320c383499
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Turn off clangd by default if we think the system does not have enough
memory. Inform the user and let them override our decision.
Task-number: QTCREATORBUG-19297
Change-Id: Ib9715c2f089c10d7a2a559a25180e9a943c118b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The include directory is under lib64/ on some systems.
Fixes: QTCREATORBUG-27623
Change-Id: Iba16e8ea451b444ab213fffd16f49dae865cd60e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Eike Ziller <eike.ziller@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>
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>
When manually defining clangd to the fallback clangd in the settings the
setting was not saved and after a restart the previous clangd was setup
again.
Change-Id: I6ce71d20d510c0cf6c605247563349b38c204e56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
With huge source files it might not be so useful to continuously
recompile them while editing, which is basically what clangd does.
Let users opt out.
Change-Id: If3e95c1e286090606a84961d071179f8b40f9180
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>
Also change the corresponding settings key to force-enable it with
existing settings.
Fixes: QTCREATORBUG-22917
Change-Id: I3b5f54bf5d4261c6e4250245f44c4c360a911e5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
in the global settings.
Change-Id: I2f90388c138c92f03f78044e225574ded640d4b9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Complete with (hidden) UI. Doesn't do anything yet, because some
assumptions about projects need to be adapted on the LanguageClient side
first.
Task-number: QTCREATORBUG-26526
Change-Id: I34c92555e34c3d3ed98462261d47b35dfc015ce0
Reviewed-by: David Schulz <david.schulz@qt.io>
Following the principle of scope minimization.
Also, we got a reproducible crash-on-exit with MSVC with the original
code.
Change-Id: I465f4376fa7928de9bb878aee5faac992f75bf08
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
We will shortly need to use a command-line option that is new in clangd
13. Rather than starting to add checks for versions that won't work as
expected anyway, we simply refuse to use clangd < 13 now.
Change-Id: I42ec679e0f58449a2593cf92b4be7ed3101fa787
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
... by default.
This feature often doesn't do what you'd want it to, so we make it opt-
in.
Change-Id: I631eae9c154ddcb0e8feeac44c5d5c0265706a67
Reviewed-by: David Schulz <david.schulz@qt.io>
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>