aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/luaengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Lua: Add Gui.Object:isValid()Marcus Tillmanns2025-10-211-1/+2
| | | | | | Change-Id: Idfff091745253e93e5199e9f099a9dd188ad3141 Reviewed-by: <lie@spyro-soft.com> Reviewed-by: hjk <hjk@qt.io>
* Utils: Move and rename result testing macros from expected.h to result.hhjk2025-04-141-1/+1
| | | | | Change-Id: I65d682054d4774b8937ecce9728a9d2f2e75cc2a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Replace most expected_str by Utils::Resulthjk2025-04-111-6/+6
| | | | | | | | Keep it in Axivion dto, which is generated. Change-Id: I83a12de6234ac7b0218b369875bdc72d25dbadfb Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Avoid potential detach of non-const Qt containers in range-loops 2/2Alessandro Portale2025-03-241-2/+2
| | | | | | | By using std::as_const Change-Id: I8be5cbdbdd677bd9c6d849f701a7eef95b1c6792 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lua: Use string_view literals as keys when calling get() and get_or()Marcus Tillmanns2025-02-211-1/+2
| | | | | | | | | | | A bug in gcc (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105438) creates a lot of warnings when using get_or with a simple "" string. To workaround, we create a string_view literal in place to workaround it. Change-Id: I3167c8f9c525a9b265a2c69a7ddadad0fe13ea71 Reviewed-by: hjk <hjk@qt.io>
* Lua: Fix punctuation of UI textLeena Miettinen2025-02-041-1/+1
| | | | | Change-Id: I12242ba9aaaf96bf5c0b9e8545b45daee5025c34 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Merge remote-tracking branch 'origin/15.0' into 16.0Eike Ziller2025-02-031-1/+6
|\ | | | | | | Change-Id: I5b06931d91898e8548764238801d5c947fcfacf8
| * Lua: Fix crash on exitMarcus Tillmanns2025-01-311-1/+6
| | | | | | | | | | Change-Id: Ia03bcdc79902301f774c829f8dbacb6d625cf6a0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Merge remote-tracking branch 'origin/15.0'Eike Ziller2025-01-091-14/+60
|\| | | | | | | | | | | | | | | | | Conflicts: doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc src/plugins/projectexplorer/runcontrol.cpp src/plugins/qmljseditor/qmljseditorsettings.cpp Change-Id: I113e3c8cd02e4bb6cbcd98a98436e46b96124f13
| * Lua: Fix multilevel tree traversal in connectHooks functionLukasz Papierkowski2025-01-071-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | Previously, only leaf nodes from the first branch of the tree were processed. * Handled: root.branch1.leafA, root.branch1.leafB * Skipped: root.branch2.leafC, etc. This change ensures all branches are traversed so no leaf nodes are skipped. The fix iterates over each key in the table and, for sub-tables, recursively calls connectHooks instead of returning early. Change-Id: I17182f4000e83e5d4747e71573d5ac2d6558d7e7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Lua: Fix Crash when debug category is enabledMarcus Tillmanns2025-01-071-2/+28
| | | | | | | | | | | | | | | | | | Not all keys / values have to be strings, but we tried to always convert to string which results in an assert. Fixes: QTCREATORBUG-32206 Change-Id: Ibad83383e22d2bfb68a2801c3139d7c447a8b76a Reviewed-by: David Schulz <david.schulz@qt.io>
* | Plugins A-L: Make static QRegularExpression instances static constAlessandro Portale2024-11-201-1/+2
|/ | | | | Change-Id: I6de1ddd036b654472b0a8cc020dc1dbf1bc1d270 Reviewed-by: hjk <hjk@qt.io>
* Lua: Move inspect and async into resourcesMarcus Tillmanns2024-10-081-0/+17
| | | | | Change-Id: I257323861823ed7858efdb265a78cc572c2e7273 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Lua: Add access for plugin application data pathJustyna Hudziak2024-10-071-1/+3
| | | | | Change-Id: Ib5f60818b8b2590d3a5d09a7900110956f98b4cf Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Add "id" to ScriptPluginSpecMarcus Tillmanns2024-09-201-20/+34
| | | | | Change-Id: Iabc766e511bc07bc3379aa13aed0aec04b3584e8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Lua: Add temporary appDataDir to runScriptMarcus Tillmanns2024-09-041-4/+10
| | | | | Change-Id: Idd458df7c06d3c7d93ed692c873b94f5eb7c74fe Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Lua: Allow clearing an aspects MacroExpanderMarcus Tillmanns2024-08-221-0/+5
| | | | | | | | | | | | | | | | | | Adds a value "Null" to simpletypes to allow setting null values in Tables: Settings.BoolAspect.create({ -- ... macroExpander = Null }) Adds Macro.globalExpander() to retrieve the global expander. Changes the result of MacroExpander.value() to (ok, value). Change-Id: I2e2577b8d2f6acd447a3701f7ecaf835504768da Reviewed-by: <lie@spyro-soft.com> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Lua: Macro supportMarcus Tillmanns2024-07-311-13/+30
| | | | | | | | Allows users to use "%{Lua: ...}" to execute Lua code in their macros. Adds "Macro" module with expand() and value() functions. Change-Id: I6315b0646fbb503a77fd0cc631aed204abf3b699 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Lua: Fix buildChristian Stenger2024-07-291-1/+1
| | | | | Change-Id: I908495a3e0f3ebb03291aed9256a50678320b4ee Reviewed-by: hjk <hjk@qt.io>
* Lua: Dissolve LuaEngine classhjk2024-07-261-59/+35
| | | | | | | It was mostly used as namespace. Change-Id: Ice6cdd1581d7dd70b09f6d82891b874a206a1ca0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Add to/from json convenience functionsMarcus Tillmanns2024-07-241-0/+20
| | | | | Change-Id: Ibf69c8021d676bd6efbbdb5331f1925808fcfe38 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lua: Add support for translationMarcus Tillmanns2024-07-241-1/+2
| | | | | Change-Id: I5398480233c830bb08c641bc8193b068fb037032 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Lua: Add pluginDirectory field to PluginSpecMarcus Tillmanns2024-07-241-3/+6
| | | | | Change-Id: I83066df3ce519d7e928bb79523ef43111b9bb1c0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lua: Guard Hook connectionsMarcus Tillmanns2024-07-181-8/+12
| | | | | Change-Id: Id30c75093879b92321af864273c6d4ef390cf71a Reviewed-by: hjk <hjk@qt.io>
* Lua: Allow printing strings containing \0Marcus Tillmanns2024-07-171-1/+1
| | | | | Change-Id: Iefef53c5b2cbacb1ea0dd19a75850fbbafb7ef94 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* AiAssistant: CleanupMarcus Tillmanns2024-07-121-9/+11
| | | | | Change-Id: Ic418523a9a514128adf11ec3a97ffb6d8d70c8a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lua: Fix build on Windows for older QtChristian Stenger2024-07-121-2/+2
| | | | | | | | | Qt6.4 ends on Windows with an ambiguous overload for the operator otherwise. Amends d298244c10dba9d831935369fced979f7cd3f9d0. Change-Id: Ie6813cffb22925b71ee55219ade1c3234f6aed8f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Add TextDocument bindingsLukasz Papierkowski2024-07-111-0/+13
| | | | | Change-Id: Ib713993a548f76f50c4b29fb11c445d2e38b16b3 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Merge remote-tracking branch 'origin/14.0'Eike Ziller2024-06-271-4/+4
|\ | | | | | | | | | | | | Conflicts: src/plugins/qmljseditor/qmljseditorsettings.cpp Change-Id: I443424afdfe48cdfc3d083d8e91335e937fcfdb6
| * Extensions: Edit UI textLeena Miettinen2024-06-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | - Add dots to ends of messages - Replace "plugin" with "extension" in translatable text - Fix capitalization of headings and button labels - Change wording Change-Id: I24a3ca6de6a5a0a4509bab34ad2f50cbcf40c73a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * Fix lupdate issuesv14.0.0-beta2Eike Ziller2024-06-251-1/+1
| | | | | | | | | | | | Change-Id: Ie71649f38e29c2fd6f644e023772f15865d6e6aa Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Lua: Interactive ShellMarcus Tillmanns2024-06-241-1/+5
|/ | | | | Change-Id: Iedd620abcb62b9dd3e640bcb80ae011016386484 Reviewed-by: hjk <hjk@qt.io>
* Lua: fix "conversion from 'size_t' to 'int'" warningDavid Schulz2024-06-201-4/+2
| | | | | Change-Id: Ibb6b17f82ebf992a48b29570c829376ef142ea10 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Improve memory managementMarcus Tillmanns2024-05-311-14/+30
| | | | | | | | | | | | | Previously the PluginSpec would create a keep around a single lua vm that was then shared with the actual plugin instance. This made it unclear when the VM was freed. Now we instead cleanup the lua vm used to fetch the plugin infos immediately and instead create a fresh vm for the actual plugin instance that can then follow the normal Plugin lifecylce. Change-Id: I81bb9ecf57706c2ba1b0d8db83ab26b3b8e944f2 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Introduce a convenience function creatorColor()hjk2024-05-291-2/+2
| | | | | | | ... forwarding to creatorTheme()->color(...) Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Lua: Implement Utils::LuaMarcus Tillmanns2024-05-281-0/+87
| | | | | Change-Id: Ib5a7f63d1c37b29beb424707962d21102db5927c Reviewed-by: hjk <hjk@qt.io>
* Lua: Add connection guardMarcus Tillmanns2024-05-281-3/+2
| | | | | | | | Improves safety by limiting connection lifetime to lifetime of lua vm. Change-Id: I508b0814fdda169f5e30d7c3282132e3c622a0a5 Reviewed-by: hjk <hjk@qt.io>
* Lua: Fix compile on linux with clang and gcc stdMarcus Tillmanns2024-05-271-1/+3
| | | | | Change-Id: I030e97678f45499973a27ba4e9e2c9d99dc3e298 Reviewed-by: hjk <hjk@qt.io>
* Lua: Add Install moduleMarcus Tillmanns2024-05-241-0/+12
| | | | | | | Allows plugins to install packages they might need. Change-Id: I4948dd0a6568e093fc35e4486d2e2a084090e103 Reviewed-by: David Schulz <david.schulz@qt.io>
* Lua: Add "printToOutputPane" plugin optionMarcus Tillmanns2024-05-161-4/+17
| | | | | | | | | Allows a plugin to automatically forward the "print" command to the output pane instead of only to qDebug() Change-Id: I10fb8063bc1713eaaf77368ea7f760270df190b3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* ExtensionSystem: FilePath'ifyMarcus Tillmanns2024-05-081-2/+1
| | | | | | | | Change IPlugin::fileName() and IPlugin::location to use FilePath instead of QString. Change-Id: If473ab1e258951735f93221cbd62c505f0727eb2 Reviewed-by: hjk <hjk@qt.io>
* Lua: Bind lifetime of LuaEngineMarcus Tillmanns2024-05-031-4/+11
| | | | | | | | | | | We want to make sure that the LuaEngine is deleted when the plugin is removed. We also derive LuaEngine from QObject so we can use it as a guard in QObject::connect calls. Change-Id: I6b0568f11bee283f880ede9432b2a9fe83014758 Reviewed-by: David Schulz <david.schulz@qt.io>
* Lua: Fix soft loadingMarcus Tillmanns2024-04-231-24/+37
| | | | | | | | | | | | | | | | | | | Previously the LuaEngine::loadPlugin() function tried to fully setup the lua interpreter. This was called before the dependencies of a lua plugin were fully soft loaded. Therefore the dependent lua packages had not been registered yet. This patch changes that to where the packages and lua libraries are only loaded right before the actual setup call is done. This also allows us to safely load the plugin spec without giving it access to all the functionality directly. In the future we could show and ask the user before we load the plugin whether he agrees to give it the requested access. Change-Id: Ibf3e81db54e2ba94473e8ecf2650dcf2e97f1360 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lua: Cleanup code styleMarcus Tillmanns2024-04-231-9/+5
| | | | | Change-Id: I7d8713c87a097f113c5b9d04104f3948b691dbf9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Lua: Clean up passMarcus Tillmanns2024-04-191-26/+21
| | | | | | | | Fixing constness, removing unused function, adding LuaEngine::variadicToStringList Change-Id: If567ac83c04e5ce6f973c819f303c9cb790b3948 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Lua: Add Lua plugin supportMarcus Tillmanns2024-04-161-0/+249
Adds basic support for writing Plugins using the lua scripting language. Lua Plugins are registered just as native plugins are and can be enabled or disabled via the plugin dialog. see src/plugins/lua/README.md for further details. Change-Id: I9f4d15e9632c46e1c6c132bcd0bbcdd70b150640 Reviewed-by: Eike Ziller <eike.ziller@qt.io>