Commit Graph

1464 Commits

Author SHA1 Message Date
Marcus Tillmanns
e4e4ef2629 Fix warnings
Change-Id: I142453a6707c252ab9c311573c329d24d85cf2ab
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2024-07-26 12:56:52 +00:00
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
Eike Ziller
3bbfd66bad Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/android/androidmanager.cpp
	src/plugins/android/androidrunner.cpp
	src/plugins/android/androidrunner.h
	src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
	src/plugins/qmldesigner/components/texteditor/texteditorview.h
	src/plugins/qmldesigner/designmodecontext.cpp
	src/plugins/qmldesigner/designmodecontext.h
	src/plugins/qmljseditor/qmljseditingsettingspage.cpp

Change-Id: Idada49bb7441e8c5b748bd75b2e6bb2351bd323e
2024-07-25 12:56:53 +02:00
Christian Stenger
c9da771625 QmlJS: Fix requesting context help
Import versions as well as versionless imports can confuse
the help engine when performing context help lookups, which
leads in some cases to falling back to the wrong help items.
Remove the version for looking up help items.

Fixes: QTCREATORBUG-31280
Change-Id: Ida765369f52804186ca005ceec23cd9d795220c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2024-07-24 04:04:43 +00:00
Jarek Kobus
dcaa3afd6d Various Plugins: Replace setPaused() with setSuspended()
Fix warnings about deprecated QFutureWatcherBase::setPaused().

Change-Id: I7c4637bcaf141bbda46e34da48306a25c68f039f
Reviewed-by: hjk <hjk@qt.io>
2024-07-22 06:09:07 +00:00
Christian Stenger
e6dc3fb008 QmlJS: Fix default command for qmlformat on Windows
Fixes: QTCREATORBUG-31257
Change-Id: I72797f3e67e0b71dac434fcd90777b0aa7334995
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-07-19 11:10:20 +00:00
Eike Ziller
18937fd44b Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/plugins/qmljseditor/qmljseditordocument.cpp

Change-Id: Ibef70b4c0eba5ccd5da7b05ca2bd3a9e8ee1cc0c
2024-07-17 11:43:34 +02:00
Christian Kandeler
ba8fe5601f QmlJSEditor: Fix warning
Amends a8a3d79592.

Change-Id: Ifbab600c148d71cf1763f1c23290a98a3066c359
Reviewed-by: hjk <hjk@qt.io>
2024-07-12 12:47:41 +00:00
Semih Yavuz
491c0ab7a6 Restart qmlls when project info changes
When the project info changes, we should update the qmlls version
which the current opened document is using.

Fixes: QTCREATORBUG-31208
Change-Id: Ief338efd863ea7472a4e5b68a5b6e7d601fd0f80
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-12 11:43:22 +00:00
Semih Yavuz
60b0d88df9 Fix warning message due to incorrect qmlls path
Don't try to start qmlls if the found path doesn't exist.
When there is no Qt version found in the project (this happens
when you open a qml file without providing its build folder, or
open it without the project info so no linked Qt version is found)
we might end up with incorrect path where no actual qml executable
exist for that path. Check the existence of the binary before assigning
it as the path for qmlls.

Fixes: QTCREATORBUG-31207
Change-Id: I626ace796401e72462eb850d4bd88c1ef51cf53a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-07-11 11:50:24 +00:00
Christian Stenger
04bb6b95fe QmlJSEditor: Fix order of initialization
Enabler need to get set after reading the settings.
Silences soft asserts.

Change-Id: I7e70279537a87462e607e51a40d9fef565b46fa8
Reviewed-by: hjk <hjk@qt.io>
2024-07-11 08:36:00 +00:00
hjk
386e3c3c12 QmlJsEditor: Use a SelectionAspect for the open mode choice
Change-Id: Ieac7371bfa71dfc5387e442d717eb53a4fae6fb8
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2024-07-10 14:33:36 +00:00
hjk
b17b6f61e5 QmlJsEditor: Further aspectify settings gui
Change-Id: Ia14289a414e23c6e830d88bbfe0a69577c0f2a31
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-10 11:49:39 +00:00
Jarek Kobus
84171887bb QmlJsEditor: Remove warning about unused variable
Change-Id: If67c3330130a90b84f593cb8a83999f47f3849e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-10 08:26:27 +00:00
Eike Ziller
8d99cd800b Merge remote-tracking branch 'origin/14.0'
Change-Id: Ic3c53630e16712b6493873d21485b726f0d06574
2024-07-08 10:31:06 +02:00
Semih Yavuz
a8a3d79592 Disable qmlls for the document when settingsChanged
Qmlls client was still alive eventhough it was turned off via the
settings page. This was causing both qmlls highlighter and the embedded
highlighter do the job at the same time. Disable qmlls client
appropriately.

Fixes: QTCREATORBUG-31148
Change-Id: I9577a78f9c861cf2fe718ffe58f3d7f77a916b9a
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-07-05 08:12:48 +00:00
David Schulz
ccdc293697 Editor: remove TextDocumentManipulator
Change-Id: Iacd7cd40ace77c79eecca3e4e699eb308d0c27de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-01 11:49:07 +00:00
David Schulz
9ad0a5a641 Editor: reduce complexity of TextDocumentManipulator
Move implementations either to the TextEditorWidget, TextDocument, or to
the caller side. This makes the TextDocumentManipulator basically a
repeater so we can easily replace it with a TextEditorWidget in the
next step.

Change-Id: I04de3cb295b56fbaae99145f8e579fe405b065a5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-01 11:49:02 +00:00
Eike Ziller
0283b81392 Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: If39fe80197537c489361810e91ee221c6c52ea01
2024-07-01 12:01:27 +02:00
hjk
9671c426e4 QmlJsEditor: Code cosmetics in qmljseditordocument.cpp
Change-Id: I915fbabaefcc018f2fa5211f8d09da8136b446ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-01 06:24:47 +00:00
hjk
cdf8d79adb QmlJsEditor: Partially aspectify settings
Only the non-gui part for now.

Change-Id: I97e59f6cb251bfb1be4dd88cc2c2f9c2e71ce219
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 07:50:29 +00:00
hjk
803c068c30 QmlJsEditor: Merge LS settings files into main settings file
Collecting relevant pieces in preparation of settings aspectification.

Change-Id: Ia221de3babf301f4f5d3583d346eeb9f91046aa4
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 07:12:50 +00:00
Eike Ziller
38e005692e Plugin meta data: Add full stop to descriptions
Where they were missing. The text is shown as a paragraph in the
extension manager.

Change-Id: I6e15c89fe4023b222e9c476f4312e13fcb0905c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-28 06:46:52 +00:00
Eike Ziller
8dccc9c59e Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/qmljseditor/qmljseditorsettings.cpp

Change-Id: I443424afdfe48cdfc3d083d8e91335e937fcfdb6
2024-06-27 11:41:54 +02:00
David Schulz
39a448c62e Editor: Simplify TextDocumentManipulator
The TextDocumentManipulatorInterface was introduced to decouple
modification operations from QTextDocument. But nowadays all tests and
production code usages are backed by a QTextDocument, so we can remove
this abstraction layer again. The first step is to merge the interface
and all manipulator implementations.

Change-Id: Idd1609df549d3b120dd516d5161af9aa8aa571ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-27 04:28:55 +00:00
Leena Miettinen
2f76130a49 Doc: Update info about QML Language Server
- Rename topic as "Configure QML Language Server", as QMLLS
  is now turned on by default
- Describe new preferences
- Remove "QML Language Server" from checkbox labels
- Add a link to the docs to the change log

Task-number: QTCREATORBUG-30604
Change-Id: I397b1747a3d23d728c78dc2eae000839655c4f32
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-25 07:44:24 +00:00
Semih Yavuz
df2e55d92a Opt out qmlls semantic highlighting
Apperantly, qmlls semantic highlighting is not as powerful as the
embedded code model's highlighter. Disable lsp based highlighting until
qmlls semantic highlighting reaches the feature parity with the QtC
highlighter. This is tracked by QTBUG-126550.

Task-number: QTBUG-126550
Fixes: QTCREATORBUG-31083
Change-Id: I6cab94d4ba1d1cde50b62ce03a6b1cc5b6d7d27b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-24 07:35:03 +00:00
hjk
e3d3af81cb QmlJsEditor: Start aspectification of settings
Rename qmljseditingsettingspage.* to qmljseditorsettings.*,
re-arrange some includes, use settings() for the singleton access
etc.

Change-Id: Iff36a99baf0afd238a935386e9111818be5d7987
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-24 06:12:59 +00:00
Eike Ziller
12c1731489 Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/qmljseditor/qmljseditingsettingspage.cpp
	src/plugins/qmljseditor/qmllssettings.h

Change-Id: I49b97101467a6e80653c0f5f3e3fe5801dca5274
2024-06-21 13:54:42 +02:00
Sami Shalayel
3b558792eb qmlls: ignore versions from Qt 6.7 or below
Do not select qmlls executables from versions below 6.8 by default,
as those have less features than QtC's builtin codemodel. Add an
option to re-enable using qmlls versions from Qt 6.7 or below,
which is off by default.

Fixes: QTCREATORBUG-31088
Change-Id: I56bfd39bc980996a92232cbcb424252d755cdfc0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-21 07:31:38 +00:00
hjk
265f76b9cd QmlJsEditor: Simplify structure of QmlJS settings handling
Not the intended final state, but more uniform.

Change-Id: I406d53032ff76631ddd542df8e3afa232d93a7fc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-20 06:27:19 +00:00
David Schulz
5f8ffd66ff QmlJSEditor: fix assigning outline toolbar widget
Instead of adding a second toolbar widget, replace the current one. This
avoids weird situations where you get two outline toolbar widgets, one
provided by qmljseditorwidget and another one provided by qmlls.

Turning the language server on deletes the combobox created by
qmljseditorwidget, such that qmljseditorwidget has to recreate
its combobox after the language server stopped being in use.

Also make sure that m_outlineCombo is set to nullptr after it gets
deleted, such that late jumpToOutlineElement and
updateOutlineIndexNow() calls do no try to attempt stuff on an already
free'd pointer.

Change-Id: Ie323a7b3e7a4d5e24407fcedf8383dd2f0efe525
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-06-18 11:23:13 +00:00
Leena Miettinen
6cd7aed8eb Add long descriptions to some plugins
Edited the short descriptions to answer the question
"What can I do with this extension" to help users decide
whether they need it.

In long descriptions, tell users what else they need to
be able to use the plugin.

Change-Id: Iefce7505b61fc77cf38cc915f1f7dbd25c9cb570
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-31 06:42:53 +00:00
Alessandro Portale
7bc65cf9f3 PluginSpecs: Change URLs from http:// to https://
Avoid the redirect that is inevitable nowerdays.

Also, change necessitas.kde.org to www.qt.io, since the orgininal page
is offline.

Change-Id: Ib1823f0df97d2df87822fd2bb7552e2f2c7e971e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-05-28 20:13:29 +00:00
Sami Shalayel
ee8ad68f5b Enable qmlls by default
Change the default values for enabling qmlls to true. Don't use the
latest qmlls version by default for now because qmlls will crash on qt
5.15 projects.

Also remove the "experimental" from the checkbox text.

Fixes: QTCREATORBUG-30851
Change-Id: I6cac396817eecb0d3bd071668d0588ec6eef1d4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-28 10:35:08 +00:00
hjk
971938421c Use LayoutBuilder V2
This puts the implementation introduced in acf1ecb47f into use, after
significant simplifications in the class hierarchy. CRTP is not used
anymore, and the new tag based dispatch is also used for Layout::addItem,
effectively reducing the number of different code paths.

The Lua based settings access is disabled for now.

Change-Id: Idb6d1a25675378757c5267bdb630bcd4c1f52d34
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-27 12:38:48 +00:00
Christian Kandeler
16c346c806 Utils: Add factory functions for ChangeSet
This greatly simplifies code that produces change sets with a single
EditOp.

Change-Id: If042bb91e5132b7141d88404cfbd3ba12632b52d
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-27 10:12:35 +00:00
Christian Kandeler
09f747f7d1 TextEditor: Add a convenience overload for RefactoringFile::apply()
... and make use of it.
In most contexts, apply() immediately follows setChangeSet(), so
combining the two can save a lot of code on the call site.

Change-Id: I421001bd47000cb64678a57b19760becf59a4863
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-24 11:36:58 +00:00
Eike Ziller
dea0da7a8b Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/languageclient/languageclientutils.cpp

Change-Id: I8d1945f79d93cecee9b22f409bc5f2eefaf6a4cd
2024-04-26 10:59:07 +02:00
Christian Stenger
6b7c6bde5a QmlJSEditor: Avoid crash on temporary documents
Fixes: QTCREATORBUG-30739
Change-Id: I62872fc23529674d5fca6dcb6255872eab12a9da
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-04-26 05:12:57 +00:00
Christian Stenger
b30d1749d6 QmlJS: Add small tweak to semantic highlighter
Check for enum key name starting upper case to avoid processing
code that may match other cases as well.

Task-number: QTCREATORBUG-19226
Change-Id: I07b62b492e2b220b7fbb3eb3fc2fb3136b554254
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-16 13:14:28 +00:00
Christian Stenger
564fed275e QmlJS: Add highlighting for enum usage
Highlights the enum and its values if valid.

Task-number: QTCREATORBUG-19226
Change-Id: Icca90b0a5d83a4ecdccfe220bcd0a3547b2e6104
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-16 04:33:25 +00:00
Christian Stenger
e1d90a7965 QmlJS: Improve handling of user defined enums
Improves handling of Qml based enums inside qml documents.

 * completion of enums
 * follow the enum
 * highlighting values inside the declaration
 * displaying the enum declaration inside the outline
 * minor static checks

Task-number: QTCREATORBUG-19226
Change-Id: Ia07fd9a8b7fa3106f2ea53198bfdcc50eecb7307
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-15 07:56:56 +00:00
Sami Shalayel
1e3750c5be qmlls: add checkbox for generating qmlls ini files
Add a checkbox to the qmljseditingsettingspage that generates qmlls
ini files by default for new projects.

If this checkbox is checked, then initial CMake configurations (when
enabling a kit for a project) and reconfigurations (when pressing the
"Re-configure with Initial parameters"-button) will set
QT_QML_GENERATE_QMLLS_INI to ON if QT_QML_GENERATE_QMLLS_INI was not
set yet.

Fixes: QTCREATORBUG-30394
Change-Id: I58f89558d25ef107e501bd67702f26554bd6aeaa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-04-11 07:22:20 +00:00
David Schulz
411100b037 TextEditor: remove text editor action handler
Give each editor a context and register editor actions individually for
that context. This removes the need to tell the action handler the
current editor. Additionally all actions are now available in editor
widgets outside of the EditorManager.

Change-Id: I0109866b180889762f8bd8aa07874d8d7c55bfa6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-09 10:52:26 +00:00
Eike Ziller
309a01337f Merge remote-tracking branch 'origin/13.0'
Change-Id: I12578a55fb61a3a9620c749c0b3bbbae6dcb4493
2024-04-02 14:54:30 +02:00
Christian Stenger
830e09ccca QmlJSEditor: Fix hovering color properties
Color properties set with hex color values display a
color tool tip, but named colors failed for Qt6 while
it was still working with Qt5.

Change-Id: I6457bbdc86dd7f036bc48dc40cfa16cda570b95f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-03-27 09:10:14 +00:00
Sami Shalayel
1d0246a89a qmljshoverhandler: do not show tooltips when qmlls is enabled
Check if qmlls is enabled before showing tooltips from the QtC's code
model. This way, other hoverhandlers, like the one used for language
servers, have the possibility to show their tooltip.

Task-number: QTCREATORBUG-29826
Change-Id: I5d879c7d4c04a27bc668e8900f54984788b02727
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-25 09:18:55 +00:00
David Schulz
d4e775ebc6 TextEditor: handle syntax highlight in batches
Use an elapsed timer in the syntax highlighter to periodically return
from the highlight and push a continue highlight to the end of the event
loop.
This allows the user to interact with the editor in between those
batches. If the user modifies the document in between highlighting
batches, the area that still needs a rehighlight is increased if needed.

This also reverts 62ea85ee6a and the
related changes.

Task-number: QTCREATORBUG-28727
Change-Id: I7c394dbdff658330bb72f3b68b9928980947db75
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-03-25 08:57:37 +00:00
Semih Yavuz
1b53c931c5 qmllssettings: Fix incorrect detecting of latest version
Update the latestVersion in the loop. Otherwise we always compare to
initial value and consequently the last installed version incorrecyly
becomes the latest version.

Fixes: QTCREATORBUG-30423
Change-Id: I7083928c5e371f0337677eacf1b3b4da50358a7c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-26 11:38:32 +00:00