Commit Graph

105 Commits

Author SHA1 Message Date
hjk
d6fe357d81 Utils: Use a proper class as Key
The Key encapsulates now a QByteArray.

Plan is to use QByteArray::fromRawData on literals, but that's not
active yet due to an unclear ASAN report, see the gerrit discussion.

For now we also paddle back when interfacing QSettings, instead of mimicing
writing a QVariantMap (and fail in some corners), always convert
the Store. This is meant to go away in the future when code paths
are better controled.

Change-Id: Id1206a434d511f8003903d5322c7c9bd5f5fb859
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 09:41:44 +00:00
David Schulz
2b72ba66ce LanguageClient: add workspace configuration project settings
Change-Id: I9876773550f3dc566dec05b78f818ca49c930da1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-11 06:29:06 +00:00
David Schulz
4451da7037 LanguageClient: use json editor in language client settings
Change-Id: Ib2b8dae730a701d71ae39a4eaf401f5feab7f921
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-29 08:12:58 +00:00
hjk
23149b27ab Utils: Introduce variantFromStore and storeFromVariant
These are functional replacements for
  QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and
  QVariant::toMap() (or QVariant::toValue<Store>())

We will have a few code paths in the end that need to explicitly
operarate on both QVariantMap and Store (e.g. actual reading/writing
to keep format compatibility etc), so these can't in the end be
simple to/fromValue(OneType) but need an internal 'if' or such.

Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-28 11:16:40 +00:00
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
David Schulz
8761b7c20c LanguageClient: Fix settings loading
Amends de247bff2b

Change-Id: Iab31da31058247a20451eeb2427152caab02c594
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 12:34:06 +00:00
David Schulz
e9cd4dd439 Utils: use Text::Position instead of LineColumn in textutils
Change-Id: I606b0b4f8106bdb2f97383d6c81ac065e7e61858
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-11 10:46:01 +00:00
David Schulz
24aea361b7 Utils: remove OptionalLineColumn
LineColumn already has a isValid() that is sufficient for the use case.

Change-Id: I7f6e1d64b66a9af05d74ce0ef45717265dc28ed3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-11 05:53:56 +00:00
hjk
fb5efd01b5 LanguageClient: Explicitly qualify one QObject::connect
Not needed currently but will be once an IOptionPage loses its
QObject base dependency.

Change-Id: Ide7de1a34ff62c32d63a77040e9ec59bb42e3c40
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-08 08:44:48 +00:00
hjk
de247bff2b LanguageServer: Use IOptionPage::setWidgetCreator() for settings
Change-Id: I6d05e739bc1348f09f3df7ab3ae8a701ce137b3c
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-04 08:14:18 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
hjk
77054c2fa3 LanguageClient: Tr::tr
Change-Id: Idbd7c5cdadba4f269b2033df91db0e05bb5281d5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-20 07:56:04 +00:00
Alessandro Portale
0a67f912eb Fully qualify Tr::tr calls for the cases where lupdate needs this
Change-Id: Icc5757376b028d9e5602751d9d8ea0a850970ebb
Reviewed-by: hjk <hjk@qt.io>
2023-01-17 15:24:23 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
David Schulz
baa1e3c2e1 Editor: Allow to hide annotations for a group of text marks
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.

Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-12 10:19:10 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Marcus Tillmanns
223bec26a1 LanguageServer: Add tooltip to file pattern
Change-Id: Ic404636bda45e9ff7ff3639232ebddfbfaf821c6
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>
2022-12-16 12:28:32 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
David Schulz
6c8605ced2 Python: automatically disable outdated pyls settings
Change-Id: I301c6df3fdd9cf634a1abff20c6f24b9bc5fc23b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 11:23:52 +00:00
David Schulz
ed22ef7854 Python: globalize Python language server settings
Change-Id: I84fcee6462064f0c788492fcfa12a77379af2bd7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:40:43 +00:00
David Schulz
2029fe8c99 LanguageClient: fix todo
Change-Id: Ia6b3b5fe6e595c32a8b8a13b869f3178afb37ed8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-07 06:29:42 +00:00
Jarek Kobus
f3957d383f Utils: More forward declarations / drop unused headers [T-Z]
Round 1 - focus on headers.
For classes with initial in range [T-Z].

Replace QT_FORWARD_DECLARE_CLASS with QT_BEGIN_NAMESPACE and
QT_END_NAMESPACE and forward declare inside.

Change-Id: I4ac3a8391e6167aa2db3973a9f94a45ac3c8ebd1
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:40:47 +00:00
David Schulz
d824c276df LanguageClient: constify createClient
Change-Id: I4b9aba1388a31b6d1531cb4a6346a394c5aab150
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-21 08:48:29 +00:00
David Schulz
1a88f26d8b LanguageClient: rename clientForSetting -> clientsForSetting
Change-Id: Idf4055769fba4c2551ac968c0232ddb3916acb6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-21 08:48:24 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- 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>
2022-02-25 07:19:58 +00:00
David Schulz
505358cb82 LanguageClient: support sorting outline combo box items
Fixes: QTCREATORBUG-26976
Change-Id: I6ec31072629c62a007bc27381f4adba597307057
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-23 06:54:33 +00:00
David Schulz
c9cd00f2ce Python: add lsp configuration widget
Change-Id: I688981293e3bbbee64fc2d714146fcdfa8126458
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-02-09 09:03:30 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
David Schulz
8f98ac4120 LanguageClient: remove obsolete "New" in add menu
nobody wants to add an old server...

Change-Id: I06d1d6eba7340181fad876753f888393dab3187f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-18 06:03:13 +00:00
David Schulz
136026a81b LanguageClient: mark added settings as changed
In order to correctly start a language server after it was added
programmatically it needs to be marked as changed.

Fixes the issue that the python language server did not get started
right after setting it up from the editor info bar.

Change-Id: I9caec91c9d5973912b7379478ab079c87a5231ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-12-10 10:28:03 +00:00
hjk
0061555213 LanguangeClient: Use more FilePath
Change-Id: Ic849da11da646feb804717550d2a8a60d61f332d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-31 15:16:42 +00:00
Eike Ziller
940a203d93 LSP: Set client working directory to project directory
If the server settings specify that a server is to be started "per
project".

This fixes e.g. running the haskell-language-server

Fixes: QTCREATORBUG-26115
Change-Id: If10af71d60786826a9218b4b98818df8d9710adf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-30 08:16:38 +00:00
hjk
2f593d9db9 LanguageServer: Use Utils::CommandLine in StdIOClientInterface
Change-Id: Ic2516387d7308bfad05cef54467c417cc47a7655
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-03 11:31:17 +00:00
David Schulz
d66b410adb LanguageClient: do not auto-assign documents to all clients
Only assign documents to a client if the client was started by a
setting. Programatically started clients should handle assigned
documents manually.

Change-Id: I192c4c011a48e0406f267d3cab3c860f740ddad7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-20 11:44:12 +00:00
Eike Ziller
e9bf841dc9 Fix lupdate issues
Some wrong tr calls / missing tr functions.
Some places where we need to bring lupdate to the right track with
regard to namespace resolution.

Change-Id: Idf552054a34e24d9671db68c816bf37f4d403dbc
Reviewed-by: hjk <hjk@qt.io>
2021-03-22 15:00:37 +00:00
David Schulz
064da4e0cc LanguageClient: make typed settings backwards compatible
Instead of saving the typed settings in the same list as the generic
stdio settings use a separate key. This way the new typed settings won't
get misinterpreted and overwritten by running older Qt Creator versions.

Change-Id: Ic14dfd978b5577b6ae08735bf811c21fba5ab725
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-05 13:27:52 +00:00
David Schulz
605df0c4b6 Java: use a temporary directory for the workspace
Change-Id: Ie8fc01f680393f141f099f57b98eb16a10b37d7e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-23 08:48:49 +00:00
David Schulz
94ee80b222 JLS: add special java client that can execute jls commands
the java language server uses special "java.apply.workspaceEdit"
commands that already contain the workspace edit that should be applied
when triggering the command.

Change-Id: If7c53b9b097aaeca289e3958a39be37a9725d395
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 11:42:59 +00:00
David Schulz
f9502a3ba6 LanguageClient: move capabilities widget to inspector
The capabilities are not changeable for the user, but only there to
check whether a server is capable of a specific task. This will also
allow us to have more specialized settings widgets for specific servers
like for the java language server without the need to add the
capabilities to each of those special widgets.

Also add the dynamic capabilities to the widget so users have a complete
overview of the capabilities.

Change-Id: I9f2ed6ed11b458f0d4c67be3df632fd810023286
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 09:38:56 +00:00
David Schulz
8106a01e9c LanguageClient: Add generic way to provide specialized settings
Change-Id: Iab482220ec7fd73ecd4cbf3d8b1b121e93148059
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-16 11:35:24 +00:00
David Schulz
71da9d340d LanguageClient: use less magic when changing settings
Change-Id: I8c5f5a85bff7cf0cf0545199358c306f7f9b539e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-29 10:59:32 +00:00
Eike Ziller
1cd87a05b5 Fix build with newest Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I8ced79ecd590dbeeb3038054e75ee0632ca37462
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-30 15:17:15 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Christian Stenger
119a3c1ce9 LanguageClient: Replace QRegexp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: Ic8259ded3f721957bd04aa00146b20bd90b41dcd
Reviewed-by: hjk <hjk@qt.io>
2020-06-19 12:48:54 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
Alexis Murzeau
3268e5f0bc LSP: Add setting to provide initializationOptions to the language server
When the language server is initialized, the Initialize request can contain
user provided data in initializationOptions field.

Allow the user to set data inside. This can be required to let the
language server have some context.

Change-Id: Ib057fdb940c21b3fd032853fb84253d42ad1e321
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-11 22:33:45 +00:00