Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.
Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@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>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@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>
... when we are about to send a new semantic token request.
Change-Id: Ibd421dd29bf3ea0e2b502c227341ff03259b2370
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Macros are used like identifiers; there is no reason why they should need
to have the same highlighting as a preprocessor directive.
Fixes: QTCREATORBUG-23548
Change-Id: I186befc06ccb36a00451fd707c41e3687a84af14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Do not send messages to server that are not reachable, but queue the
highlighting requests until the client is fully initialized.
Change-Id: I7da140ec33fb1974d3eaed03110ed85dc3a87594
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@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>
If the language server registers token types for unsupported tokens do
not use the default text style for those tokens since it might overwrite
correct syntax highlighting.
Thanks to Alex Drozdov for providing a patch
Fixes: QTCREATORBUG-26193
Change-Id: I5d70763bc1e9434ffc6241d94f50f3bb3852e62c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
wrappers, that also includes the "public" headers for MimeType et al
from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
back to utils/mimetypes/mimedatabase.h
Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
A usual error we receive for semantic request is that the request got
canceled. This can be due to external changes. But a server might still
be able to calculate a diff against a previous token set. So just keep
the previously reported tokens and rerequest a new highlight. If the
server is not able to calculate a diff it also might send a full
token set as a result for the delta request according to the protocol.
Fixes: QTCREATORBUG-26624
Change-Id: Ia91e599706519dbbf4cd22050484e4f36cecdab8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This is needed for e.g. ClangdClient, which may need to update even if
the highlighting delta from the server is empty.
Task-number: QTCREATORBUG-26183
Change-Id: I38398c9563fa7a6a1906c5cb57fd1cbcd444cbd9
Reviewed-by: David Schulz <david.schulz@qt.io>
Note that we lose the highlighting for virtual function calls. We need
to amend clangd to add the respective information to its semantic tokens
message.
Also, Qt properties are no longer highlighted as class members. We'll
investigate how to best restore this feature.
Change-Id: I403712aada3d7a8e1c7b7c1277f43f7f64f8450b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Ignore unknown modifiers when building up and accessing the text char
format hash.
Change-Id: I7e11e3fb6f4240083045368daec54e417416efa9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Make sure that multiple edits are in order.
The SemanticTokensEdit start is relative to the start of the data and
not to the position of the previous edit.
Do not try to be smart when calculating the start of the modification,
but assume that start is always a preedit index.
Change-Id: I3e1513f5fe631aac21fecb5e0611d987355e2c21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This is already built into clang, so we just need to expose it to the
highlighter and the UI.
Fixes: QTCREATORBUG-24880
Change-Id: I6d0595af2589a9b69eb954aafad46457ab2c5752
Reviewed-by: David Schulz <david.schulz@qt.io>
The actual highlighting of the C++ code using clangd doesn't use many
colors to differentiate symbols (for example, fields of a class).
This commit makes symbols more visible for these categories:
- static methods
- preprocessor macros
- struct and class fields
- static fields
Change-Id: I001325cf5e48aa07d7397b2b7ac98a65501e1d5d
Reviewed-by: David Schulz <david.schulz@qt.io>