Commit Graph

82 Commits

Author SHA1 Message Date
David Schulz
270a9839e2 Copilot: start the client in the delayed initialize phase
Change-Id: I4470491f5f0a2b1d88ed5b2e23444bf3a28d8256
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-31 07:02:57 +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
ec7abcf98c Utils: Make FilePathAspect::setDefaultValue take a QString
This sets the unexpanded value, so going to a "cooked" FilePath can
at least theoretically break. On the user side it saves a
roundtrip in a few cases, but is more ugly when the input is already
a proper FilePath.

Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-17 11:58:41 +00:00
Marcus Tillmanns
ccb66ea64d Copilot: Don't use app_version
Change-Id: I10c1bfaa6befe49ba7261afe14c457a5f33c887f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-17 06:50:59 +00:00
Christian Stenger
8815d5974e Copilot: Fix build
Change-Id: I4fb0df318ec6eff50f2ddca476195882f1c6910d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-17 05:38:24 +00:00
Marcus Tillmanns
ec4c85bab4 Copilot: Enabler readSettings workaround
readSettings does not trigger signals when values change, so
other aspects that have setEnabler set will not realize that
the enablers changed and possibly not update.

Calling setEnabler after read settings ensures that the correct
value is used.

Change-Id: Ifff3ff13d9c78e16bddf8032b891a5004a035496
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 04:42:55 +00:00
Christian Stenger
b79ffcf8a2 Copilot: Fix qbs build
Change-Id: I2fad66854b69345150fdd19fa7da18125f8590d9
Reviewed-by: hjk <hjk@qt.io>
2023-08-16 08:57:26 +00:00
Marcus Tillmanns
ae51ad8c92 Copilot: Move to Settings::setLayouter()
Change-Id: I1d7d9872f12aa5436f03107bdd5fedfbe2829700
Reviewed-by: hjk <hjk@qt.io>
2023-08-16 06:55:06 +00:00
Marcus Tillmanns
f2d62c6d91 Copilot: Add support for proxy settings
For easier testing a docker file is added. You can start
"buildandrun.sh" in copilot/tests/proxy to get a simple
proxy server up and running. The argument "PWDMODE" in
buildandrun.sh can be set to "with" and "without" to get
a proxy server that needs a password or not. The username
and password are user/1234.

Fixes: QTCREATORBUG-29485
Change-Id: I3859c9ad04ebd4f9349e25665ba710e23fb64dea
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-16 06:54:54 +00:00
hjk
e2a370f280 LSP: Use 8-bit keys in Json wrapper
Sufficient, smaller, faster.

Change-Id: I0d740785109538e04fc674c11d578ded8d2815fb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-15 07:11:31 +00:00
hjk
0be0772fc9 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ib67c8ecb1865ee31ca6485c9287039ba877c68cd
2023-08-10 10:03:04 +02:00
David Schulz
fbb9946331 Copilot: avoid crash on misconfigured agent
When setting up a wrong or unusable agent.js the client used inside the
AuthWidget get's deleted eventually. In that case we need to reset the
tracked client otherwise we use a pointer to the deleted client in the
destructor of AuthWidget.

Change-Id: Ide4067c01cdcd05a33d44bc9460acfe9a56c7815
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2023-08-09 04:20:55 +00:00
Burak Hancerli
98e24a199f Copilot: Fix the broken link in the settings page
Change-Id: Iabedbbd1cc4c3371bd5351e434918e8368705daf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-01 12:46:27 +00:00
hjk
7d08f96da5 Utils: Remove AspectContainer ctor's parent parameter
Instead use setParent in the two cases that use it. The parent gets
in the way when attempting to derive AspectContainer from BaseAspect.

Change-Id: I6079beb0e00334133da115b714bc5186064c6722
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-28 12:24:04 +00:00
Eike Ziller
a419670ff5 Build: Change plugin json.in files to CMake style
They were still using variables in qmake style.
Directly use CMake variables in the json.in files and remove the no
longer needed escaping of quotes.

Adds a fatal message if it detects the old style in a .json.in file for
easier porting.

Change-Id: I8de88d8db2da55781f0e9d72eda03f943723188e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-25 13:21:16 +00:00
hjk
3bfd60b708 Copilot: Move AuthWidget update to the class itself
Change-Id: Iab23566c6d74760eab732fdbad2d9eac645faaff
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-14 14:39:30 +00:00
hjk
17267bb15c Copilot: Move closer to latest settings setup and usage pattern
Change-Id: I86983f55cd53a540e2fe1a5b307ebf67f7ea7a98
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-14 14:39:06 +00:00
Eike Ziller
3d3c78dfc6 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: If3ada34dcc764fa1d0cce04fd343fb5a02c2fbaa
2023-07-10 09:29:51 +02:00
hjk
91513a53dd Utils: Make aspect settings access implicit
Generally, aspects should use fromMap/toMap, but some older pages
use {from,to}Settings with always the same ICore::settings().

To make that less intrusive on the user code side, make that globally
implicit.

Task-number: QTCREATORBUG-29167
Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-07 09:02:29 +00:00
David Schulz
86191221b8 Copilot: fix crash on explicitly completion request
Change-Id: I6bdbc25063818399f1d2c81b9e8f7508f57a4b72
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-06 10:26:17 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
hjk
98bba063b6 Utils: Use FilePathAspect::setDefaultValue
... instead of StringAspect::setDefaultFilePath.

Closer to the intended uniform access.

Task-number: QTCREATORBUG-29167
Change-Id: I87df385ef98873a0955010149a9a9b09a5f29daf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-30 09:34:26 +00:00
Marcus Tillmanns
bb6a53240e Copilot: Additional search path for vim plugin
Fixes: QTCREATORBUG-29335
Change-Id: Ib86dc2dc5e4f0df8188dc8e4351f7117cc73710a
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-29 13:20:40 +00:00
hjk
379e7f906e Utils: Rework aspect implementation
This avoids some repetition and could be a step towards
having type storage in (or rather accessible from) the base,
so we can have aspects for more complex data (treemodels...)
that are not easily converted to QVariant.

Change-Id: I9797b3d5646195705212db1830d2b415291ac651
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-29 11:25:44 +00:00
Christian Stenger
ffffb18f8f Copilot: Fix compile
Change-Id: If9e2c6486e2ac9b80069947063e80336567fbdbe
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit eb7d0727e6)
2023-06-23 07:37:37 +00:00
hjk
c9521b294f Copilot: Disable by default also in the settings
... and make the enabling more prominent.

Change-Id: I77e236a1aec2d3ced3280aa8af322a02b8a14dd1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 07:12:33 +00:00
hjk
4625d9e87e Copilot: Add a warning in the settings page
... about copilot operation.

Change-Id: I9187f1759f183f4df393e057dc0cdb3307665afc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 07:12:21 +00:00
hjk
fff258638f Copilot: Keep urls outside translatable strings
Change-Id: Idf81efda39a2dcaa4c20e698f109fda5555537be
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-22 07:18:22 +00:00
David Schulz
a41577f8bd Copilot: add shortcuts to cycle through suggestions
Change-Id: Id626c386f3b986ba0d1493387d542539b3d3005d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-21 10:01:58 +00:00
Marcus Tillmanns
067c2096d4 Copilot: Make auth code selectable
Change-Id: I7dca66718e91bf048c98a9df910de0706f4286d7
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-20 08:43:48 +00:00
Marcus Tillmanns
8aff1dfd85 Copilot: Add Tooltip to links
Change-Id: I24a74272e58658fa607779e73baa7ada56bf085e
Reviewed-by: hjk <hjk@qt.io>
2023-06-20 05:57:03 +00:00
hjk
1193473f46 Copilot: Make some settings help text mouse-selectable
Change-Id: Ibb855bf94aeb5f83220da049b32e26400dacc0e8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-19 15:40:48 +00:00
Leena Miettinen
d81b3c6131 Copilot: Fix UI text capitalization and punctuation
Change-Id: I49a38633a8df1b4d65ee02bebecf270287c800d9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-19 09:05:01 +00:00
David Schulz
c617c2afa1 Copilot: remove trailing whitespaces of completion text
The Copilot language server likes to include trailing new lines in the
completion items. This can move the whole editor content below the
suggestion needlesly. Additionally the new lines are not always
sensible (https://www.youtube.com/watch?v=kQzpvHPeBQo&t=402s).

Change-Id: I75a4a0f2d30a7c757361851dae5c0265777dfea9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-14 14:09:10 +00:00
David Schulz
87d1865f99 Copilot: ignore invalid or empty suggestions
Change-Id: I6765814ec74b456ad1bb1392472d9d488357582e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-13 08:40:30 +00:00
Marcus Tillmanns
9925bae16b Copilot: Disable by default
Its no longer experimental

Change-Id: I62d8dbbcb1eeb2c1a4e60b6356a09f28e670140f
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-08 08:58:27 +00:00
Jarek Kobus
abb85b073a QScopeGuard: Make all usages of QScopeGuard consistent
Change-Id: Icfc35ecbdbdee8dadbb1b17789694093427c3ed9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-07 10:35:01 +00:00
Christian Stenger
1bc3cccbb4 Copilot: Do not try to start copilot without nodejs
Avoids the attempt to start the client if nodejs cannot be
found.

Change-Id: I3783280120ca754291a92b3308c1192906facd08
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-31 12:53:35 +00:00
Jarek Kobus
43d5944873 CoPilot: Fix a warning about an unused arg
Change-Id: I8b4e552aac0931fea2af4ecc5e70a25c39871fab
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-31 10:02:17 +00:00
Christian Stenger
3c7644647b Copilot: Fix Qbs build
Change-Id: I0fea791042e78b52fc7c89024d9424f24bbe0a12
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-31 07:34:31 +00:00
Leena Miettinen
0b5123cd74 Copilot: Fix UI text
- Change an external link to point to the English language version
- Fix capitalization of product names
- Add a period to the end of a tooltip

Change-Id: Ia46709db9911c0a3bfad252db2ffe0b3f7e5f2d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-31 07:00:44 +00:00
David Schulz
a35fd42364 Copilot: position copilot tooltip above cursor rect
Change-Id: I37c6572000231334b90f38a2b37f5983c80174a5
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-31 05:31:47 +00:00
Marcus Tillmanns
bdb31d4348 Copilot: Allow user to disable Copilot
Fixes: QTCREATORBUG-29179
Change-Id: I274de1f13f773fb61b376643b61056b6f14dabaf
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-26 12:55:57 +00:00
hjk
b47df2a304 Copilot: Register settings aspects more directly
Also simplify a search.

Change-Id: I2ba511ca3250c624fb7dbc2b44f845a5757e72ce
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-26 09:00:48 +00:00
Marcus Tillmanns
c995795d80 Copilot: Fix spinner if Copilot not configure
Previously the progress indicator would be visible if node.js or the
lsp path was not configured.

Change-Id: Ief235253c6cfcb8f8fb533fe746edc7d0cc5867c
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-26 06:10:07 +00:00
David Schulz
305fae9a4a Copilot: shutdown plugin asynchronously
Wait for the client to finish. This fixes a crash when running the
plugin unit tests of the copilot plugin.

Change-Id: Id0805cb628a79316cd904350bb159ff1369a03b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-24 06:50:06 +00:00
hjk
95d21f3966 Use new FilePathAspect in a few more places
Change-Id: I910a802255c8d54a31313dcccb0d1a48ec577b7a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-17 11:22:48 +00:00
David Schulz
0b8a0f8f59 Copilot: remove unused function and member
Change-Id: I77bc6533f658dbd6c3b58f603f384e6c516974df
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-11 05:50:19 +00:00
hjk
d3ef8aa9ad Copilot: Use functor to apply settings
Change-Id: Ie17273a4fd55c2144b2751166fb69bd523033321
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-09 09:08:45 +00:00