summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor
Commit message (Collapse)AuthorAgeFilesLines
* TextEditor: Use icons with better contrast in TextMark tooltipAlessandro Portale2023-05-031-2/+2
| | | | | | | | | | The "_TOOLBAR" variants do not have a good contrast in some themes. This also introduces the missing non-toolbar variation for the EYE_OPEN icon. Fixes: QTCREATORBUG-29087 Change-Id: I64c8c6b7f5696d640c7bea7a431982caacd70050 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* TextEditor: Use IOptionPage::setWidgetCreator() for behavior settingshjk2023-05-032-88/+56
| | | | | | Change-Id: I24629e64b48c08b1321f0ebf3fca21e17a1f69a1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* FakeVim: Block SuggestionsMarcus Tillmanns2023-05-022-0/+23
| | | | | | | | Block suggestions when FakeVim is enabled and the mode is not "Insert" or "Replace". Change-Id: I778eb25d9570b76e42652f9d938a8c580033c462 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Add valid checks for text linesMarcus Tillmanns2023-04-271-4/+8
| | | | | | | | | | QTextLayout::lineForTextPosition can return invalid lines, which when accessed may crash. To workaround we add QTC_ASSERT to guard against this (see linked issue crash report) Fixes: QTCREATORBUG-28837 Change-Id: I66d8d8a46e766caa492ec2178b1fa88e35211333 Reviewed-by: David Schulz <david.schulz@qt.io>
* ILocatorFilter: Simplify Sync's onSetup in matchersJarek Kobus2023-04-271-3/+2
| | | | | | | | | | | | | | Remove no longer necessary bool return value from onSetup functions and from refresh recipe functions, see df5e3c587a045fbd3d50233ecdde0e06dccf35a3. By default, when no return bool is specified inside a function passed to Sync element, it's assumed that the return value is true. Eliminate passing "=" captures in 2 lambdas. Change-Id: I5005821444a386f70c0f05322812f98d3fd49926 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* FutureSynchronizer: Change the default value of cancelOnWait to trueJarek Kobus2023-04-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "false" default wasn't really useful. This changes the default value to the following usages: 1. AndroidDeployQtStep Introduced in 91f136ef3ab75471cabcaed9dc16dad9f504add8 The synchronizer was used to cancel the running tasks inside the doCancel(), so the similar behavior should be expected when destructing the AndroidDeployQtStep. 2. GitClient Introduced in f3106ebafe9a02904e822e9698c8b4cbb6c7e0f5 Is used only inside the last line of GitSubmitEditor::updateFileModel(). The running function (CommitDataFetchResult::fetch) doesn't take QPromise<>, so it can't detect if the future was canceled or not. In this case this change is no-op. 3. ExtraCompiler Introduced in c99ce1f455189864de9a2043730f704d7b024abf The intention was to make it cancellable and finish early on cancel. 4. PluginManager global future synchronizer Introduced in 72bddf9f51fedd064f551bcb4ced5feeb46fdfc1 The intention was to make it cancellable and finish early on cancel. The relevant places in code are marked explicitly for points: 1, 2 and 3. Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* LineNumberFilter: Reimplement matchers()Jarek Kobus2023-04-252-0/+46
| | | | | | Change-Id: I5c4905aabaee81c7870994ca9019e451a7c23119 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Make Layouting a top level namespacehjk2023-04-256-6/+6
| | | | | | | | | | The whole machinery is now almost only layoutbuilder.{h,cpp}, mostly independent of the rest of Utils. Idea is to finish the separation to make it stand-alone usable also outside creator. Change-Id: I958aa667d17ae26b21209f22412309c5307a579c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Markdown: Add option for hiding previewEike Ziller2023-04-251-20/+50
| | | | | | | | | | | | | Make it possible to hide the preview, by having a toggle button for "Show Preview" and "Show Editor", and ensure that at least one is always on and they are in the order as the views themselves. Disable the "Swap Views" button if only one is shown. Change-Id: I0ec1e06c2a8ec94e34bf52eae45ba009fd8cd1b5 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-244-3/+12
|\ | | | | | | Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
| * Merge remote-tracking branch 'origin/9.0' into 10.0Eike Ziller2023-04-242-3/+3
| |\ | | | | | | | | | Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
| | * Fix dangling references, found by GCC 13Thiago Macieira2023-04-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifetime extension via const-ref only applies to functions that return by value. For those that already return by reference (such as QList::constLast()), no extension happens and we end up with a dangling reference. cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference] cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’ Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| * | Editor: skip painting selection path out of clip rectDavid Schulz2023-04-181-0/+4
| | | | | | | | | | | | | | | Change-Id: Ieec7afbec729708884c24d8de2b4a6c488220a69 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | Editor: fix selection path for empty selectionsDavid Schulz2023-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Especially targets the painting of empty snippet replacement placeholder like in the default "if" snippet. Change-Id: I42d9fb901c66cddf4eab9dd7275b42a8f4e81282 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | ClangFormat: Fix preview updatingArtem Sokolovskii2023-04-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the behavior when the preview does not update when the Override checkbox was not enabled initially. Currently, the preview is updating when Override the checkbox is enabled. Fixes: QTCREATORBUG-29043 Change-Id: I8a2a6f3cd5890b66d4bffd0c84aeafb5a29fba48 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | TextEditor: Use IOptionPage::setWidgetCreator() for higlighter settingshjk2023-04-212-115/+66
| | | | | | | | | | | | | | | | | | Change-Id: I4e06e1606a66d00294899d26c0cb385d81ccea2d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | | TextEditor: Use IOptionPage::setWidgetCreator() for snippets settingshjk2023-04-213-137/+83
| | | | | | | | | | | | | | | Change-Id: I9aa91edef20f325f1a2fc93388aecb5776b970d6 Reviewed-by: David Schulz <david.schulz@qt.io>
* | | Editor: add option to switch markdown viewer panesDavid Schulz2023-04-211-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-27883 Change-Id: I18daa688ff7751f984a95132737cfcc219b92108 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* | | Markdown: Fix that text editing actions were not availableEike Ziller2023-04-202-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | Add the TextEditorActionHandler and point it to the text editor. Change-Id: I2c84d6b0160c7402ea32d56ed4dbc72d512072a1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | | C++ editor: Make generated Q_PROPERTYs FINAL by defaultUlf Hermann2023-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's bad style to omit the FINAL because such properties can be shadowed, causing problems in QML. Change-Id: I9083c69128f6335f584f0a1d28f1fe1e54a02eaf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | | Markdown: Reuse Markdown highlighter from change log viewerEike Ziller2023-04-191-1/+3
| | | | | | | | | | | | | | | | | | Change-Id: Ief1b0c135a34bfd5e9b5220e9fbf93f281d8e95a Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | LineNumberFilter: Use Acceptor for LocatorFilterEntryJarek Kobus2023-04-192-39/+12
| | | | | | | | | | | | | | | Change-Id: Id7da6d01a412633600c3ef905a5ddb18e9587bd7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-136-5/+23
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/python/pipsupport.cpp src/plugins/qtsupport/exampleslistmodel.cpp src/plugins/qtsupport/examplesparser.cpp tests/auto/examples/tst_examples.cpp Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
| * | TextEditor: remove redundant semicolonDavid Schulz2023-04-131-1/+1
| | | | | | | | | | | | | | | Change-Id: Iac82849a858bd567ff1230ec8c0ea48b5ef47e17 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * | ClangFormat: Grey out Clang-Format Style config when not overriddenArtem Sokolovskii2023-04-065-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add feature to grey out the Clang-Format Style configuration widget after unchecking the 'Override' checkbox. Change-Id: I94bbb1f4436f3caeaed55d49582211257e480d0d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | TextEditor: reuse resetReloadMarks in documentReloadedDavid Schulz2023-04-131-3/+3
| | | | | | | | | | | | | | | Change-Id: I41721e8c08fa70bf713154d7096753e0f49afb8c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | TextEditor: fix leaking TextSuggestionDavid Schulz2023-04-131-1/+1
| | | | | | | | | | | | | | | Change-Id: I6f8b27e339219880cf9ade42a1e70e6dafb625b1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | TextEditor: fix crash on reloadDavid Schulz2023-04-135-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since TextDocument::openImpl potentially processes events it could delete TextMarks. So tracking them in TextDocument::reload can be considered unsafe. Track them in TextDocumentLayout instead and remove the tracked mark if it gets deleted while reloading the document. Task-number: QTCREATORBUG-29004 Change-Id: I9d0478e9c763b49f145c1bbaeed1a0b602757014 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | | Copilot: Add insert next word actionMarcus Tillmanns2023-04-062-6/+18
| | | | | | | | | | | | | | | | | | Fixes: QTCREATORBUG-28959 Change-Id: Ied53ad5676133e2eb71988ecfcce90c5ad77e3c3 Reviewed-by: David Schulz <david.schulz@qt.io>
* | | LocatorFilterEntry: Discourage the use of internalDataJarek Kobus2023-04-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop internalData from c'tor. The internalData is going to be removed, soon. Drop also the icon arg from c'tor since LocatorFilterEntry instances are usually created in non-main thread, while operating on QIcon instances isn't really safe in non-main thread. The use of QIcon inside this struct is a subject to change in the future, in a way like it was done in other parts of code that generated icons from non-main thread. Change-Id: Ic6aa719a64e5fbd65883c54149796057c632780e Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-03-311-4/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/libs/utils/multitextcursor.cpp Change-Id: I54b00ea5e6953078beed7673b5de31114f983bfa
| * | Editor: ensure that the outline is the left most toolbar widgetDavid Schulz2023-03-311-4/+7
| | | | | | | | | | | | | | | | | | Fixes: QTCREATORBUG-28765 Change-Id: Ifc43ed64ab4906af2d669ff372d8b66d59203048 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | TextEditor: add a virtual destructor to TextSuggestionDavid Schulz2023-03-312-0/+3
| | | | | | | | | | | | | | | Change-Id: I30378a5a3367a79eb3b39bc921c409ca0af04119 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | TextEditor: Use QtColorButton in ColorSchemeEditAlessandro Portale2023-03-312-43/+25
| | | | | | | | | | | | | | | | | | | | | | | | Replaces the style-sheet based drawing. Reduces handling code. Adds Drag'n'drop capabilities. Change-Id: I7e7ff06df61ffead00d4c747c8b0f5e81de169ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | TextEditor: use QScopeGuard instead of ExecuteOnDestructionDavid Schulz2023-03-301-3/+2
| | | | | | | | | | | | | | | | | | Change-Id: I2d7c04d69ad49a121b157af2750eaed26bab9480 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | | Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-03-292-2/+58
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp src/tools/perfparser Change-Id: Ie5643100e0eb00e0933359dce320169b876f5634
| * | TextEditor: Fix build for real build systemsChristian Stenger2023-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Amends 6deabc4334c1d2e0ebfce13074cb3226237c8656. Change-Id: I237d912041c1db29dabd48ba243731419d8d688c Reviewed-by: David Schulz <david.schulz@qt.io>
| * | formattexteditor: fix broken formattingSemih Yavuz2023-03-222-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of unicode character, moving cursor relatively can result in wrong placement of the cursor. Use absolute positions. Fixes: QTCREATORBUG-28859 Change-Id: Idf68481861fc10c24b1eb330220fba92cadf560a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | | Copilot: add copilot suggestion tooltipsDavid Schulz2023-03-294-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | These tooltips allow to switch the currently visible suggestion as well as applying it using the mouse. Change-Id: I30b9a76ae57c66887f4e1b1311e1a7248ed0f194 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: introduce text suggestion interfaceDavid Schulz2023-03-296-139/+133
| | | | | | | | | | | | | | | | | | | | | | | | And also a copilot suggestion implementing that interface that allows reverting all changes done to a suggestion as well as applying it. Change-Id: I236c1fc5e5844d19ac606672af54e273e9c42e1c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | Replace a few \returns by Returnshjk2023-03-241-4/+2
| | | | | | | | | | | | | | | Change-Id: I09c633e610421f5cc8257b15de60ffa98d890ee0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | TextEditor: ensure block is layoutedDavid Schulz2023-03-241-1/+5
| | | | | | | | | | | | | | | | | | | | | ...after requesting block bounding rect. Change-Id: Id7420a1b1ae4761fad86b6dbbc9c9ebe639cc5fe Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | LanguageClient: add action to open call hierarchyDavid Schulz2023-03-225-1/+20
| | | | | | | | | | | | | | | | | | | | | Fixes: QTCREATORBUG-28839 Fixes: QTCREATORBUG-28842 Change-Id: Icb70412282c0c2c36241559d942a58ffddab5664 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | | Qbs build system: Add a component for test files groupsAlessandro Portale2023-03-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Mainly in order to enforce a unified group name across QtC libraries and plugins. Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | | TextEditor: only paint selections in the first block of a suggestionDavid Schulz2023-03-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Fixes highlighting of matching parentheses or errors of the code model in every line of the suggestion. Change-Id: I223cb567ee8ce95badd91c4819417310a0e28cff Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: Adjust extra selections when suggestions are visibleDavid Schulz2023-03-171-1/+40
| | | | | | | | | | | | | | | Change-Id: Id914ce544b2289bff5403c8a673dceebbc517b54 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: set the cursor to the widget before closing the edit blockDavid Schulz2023-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make sure that code reacting on the document change signal can get the final cursor position from the widget. More specificly this fixes requesting copilot suggestions when automatic text is inserted like closing parentheses when typing "if (" Change-Id: I01a13e67e72b89010fe39de3d0def0622a9b08b8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: avoid showing suggestion and completion simultaneouslyDavid Schulz2023-03-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | If the use erxplicitly requested the completion hide the suggestion otherwise ignore the completion. Change-Id: I52485e322b0521b0af10ae6945437bf96642ad89 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: skip auto completion while suggestion is visibleDavid Schulz2023-03-163-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The use can still explicitly request completions in that case via the keyboard shortcut. Change-Id: I4ed47232a24288c540d1357c0f876a1cdfcfec08 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | | TextEditor: avoid painting annotations over suggestionsDavid Schulz2023-03-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blocks with suggestions are longer than without the suggestion. So we have to calculate the annotation start position based on the reaplcement and not the actual document layout. Change-Id: I32ce81134e1146dd28ae11a70356a98c75529236 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>