summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor
Commit message (Collapse)AuthorAgeFilesLines
* TextEditor: Do not change the text format for tool tipsEike Ziller2019-11-063-28/+28
| | | | | | | | | We should not force the tool tip text to HTML when help content is available or when adding the F1 icon. Instead add help content and F1 icon into the tool tip layout. Change-Id: Ibe2d4fa2fb81bcda4e5aeb0d7d86dbf63fcf3ce6 Reviewed-by: David Schulz <david.schulz@qt.io>
* Highlighter: clarify 'Update Definitions' actionDavid Schulz2019-11-045-10/+40
| | | | | | | | | | | | by renaming it to Download Definitions and adding a tooltip stating that it collects all definitions that are missing or were updated after the release and downloads it to the ksyntax highlighting user folder. Also adding a separate reload definitions button in the settings behind the user path. Change-Id: I059cc98e33147cae910fa4fdb35631d1dca81448 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Fix HTML escaping of tool tipsEike Ziller2019-10-251-3/+6
| | | | | | | | | Tool tips without help ID were HTML escaped but never shown in a HTML tool tip. Just always make them rich text. Line endings in plain text must be changed to "<br/>" as well. Change-Id: I9fd378e2c9a58ddf5834d67927fe3da9157cfbc7 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Do not show F1 in tool tips that don't provide help ID(s)Eike Ziller2019-10-251-1/+3
| | | | | | | | Like it is the case for the language client. Utils::TextTip::configure uses QVariant::isNull to check. Change-Id: Ie1e47284a9062e79efcf0debf68486b05bce48ef Reviewed-by: David Schulz <david.schulz@qt.io>
* texteditor: Remove unused forward declarationLaurent Montel2019-10-184-6/+0
| | | | | Change-Id: I5edbbbecef472230a81827aa0206533918d97230 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* TextEditor: Fix backtab behavior of multi line selectionDavid Schulz2019-10-111-17/+64
| | | | | | | | | Check available spaces infront of current column on each line before removing the text. Fixes: QTCREATORBUG-16970 Change-Id: Ie6560ce706297f6818a84ca863abc9b106728890 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: more FileName -> FilePath renamingDavid Schulz2019-10-013-4/+4
| | | | | Change-Id: Ia61868806db47561e7bf7ae9b3cfb1e62a085a7a Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-09-121-2/+3
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/projectexplorer/gcctoolchain.cpp src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp Change-Id: Iffdf48e782a734107ea170ebb3812e997cea0e7b
| * Fix "Preserve case" in advanced findEike Ziller2019-09-101-2/+3
| | | | | | | | | | | | Fixes: QTCREATORBUG-19696 Change-Id: Ife0bf9f68ff24f46e0ba1e5cc4a2db358f2a1a61 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Core: Make InfoBar::GlobalSuppressionMode an enum classAndre Hartmann2019-09-121-1/+1
| | | | | | | | | | Change-Id: I859a727196a887f7699a667fbe07e1bfead4cb2b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Remove usages of deprecated APIsSona Kurazyan2019-09-031-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | Replaced: QPalette::ColorRole::Background -> QPalette::ColorRole::Window QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole QFontMetrics::width() -> QFontMetrics::horizontalAdvance() Task-number: QTBUG-76491 Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Replace the deprecated QWheelEvent::delta() -> QWheelEvent::angleDelta()Sona Kurazyan2019-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | Replaced the usages of deprecated QWheelEvent::delta() with QWheelEvent::angleDelta().y(), assuming that it's acceptable to use only the vertical component of angle delta. Task-number: QTBUG-76491 Change-Id: I4aa0a5a0e9ba7f33321bdb879b66ffb589b53e42 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Remove usages of deprecated APIs of QLayoutSona Kurazyan2019-09-023-5/+5
| | | | | | | | | | | | | | | | | | | | Replaced: QLayout::setMargin() -> QLayout::setContentsMargins() QLayout::margin() -> QLayout::getContentsMargins() Task-number: QTBUG-76491 Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | FancyLineEdit: Make completers triggerable via Ctrl+SpaceChristian Kandeler2019-08-301-0/+5
| | | | | | | | | | | | | | | | | | In particular, this allows to trigger the completer without providing a leading character, thus showing all history entries. Task-number: QTCREATORBUG-17891 Change-Id: I8ae900d196de2e5083a626faa757648637b325ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Editor: accept common text edit short cut override eventsDavid Schulz2019-08-291-3/+9
| | | | | | | | | | | | | | | | | | | | see QWidgetTextControl::processEvent and QInputControl::isCommonTextEditShortcut. This will break assigning shortcuts to for example Shift+a. Change-Id: I4f97c27a47e2a7a44bf06b3ca949a6de74d4bb64 Fixes: QTCREATORBUG-22854 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | TextEditor: skip painting refactor markers of invisible blocksDavid Schulz2019-08-231-0/+3
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-21032 Change-Id: I43a91f6c4237bb923c09391bbc436bd617b4512d Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Add option to configure file line ending for an open documentMarius Sincovici2019-08-074-0/+42
| | | | | | | | | | | | | | | | | | | | | | Add into the text editor toolbar a combo box which allows to change the line endings for an open document. The supported line endings are LF and CRLF. Change-Id: I029ba7867e0087b162edba7aba1bd1d1e966fd69 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | FancyLineEdit: Add camel case navigationAndre Hartmann2019-08-022-239/+20
| | | | | | | | | | | | | | | | | | | | | | | | Use it for search and replace functions as well as for Locator. The camel case navigation can be switched on / off with the existing menu Options > Text Editor > Behavior > Enable Build-in camel case navigation. Fixes: QTCREATORBUG-21140 Change-Id: I3f2dcafff231366b3c8f08c14514dd8940cca2a0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Compile fix with recent Qt devhjk2019-07-294-11/+6
| | | | | | | | | | | | | | | | | | The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Standardize on int for line and column valueshjk2019-07-263-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | GenericProposalModel: Rename PrefixMatch to ProposalMatchAndre Hartmann2019-07-252-9/+9
| | | | | | | | | | Change-Id: I70e583d489f27b2dad1b9ab874091e638bbaff1f Reviewed-by: David Schulz <david.schulz@qt.io>
* | GenericProposalModel: Remove unneeded conditionAndre Hartmann2019-07-241-2/+1
| | | | | | | | | | Change-Id: I60234bbf8291d950c475e45866018978d4c423a8 Reviewed-by: David Schulz <david.schulz@qt.io>
* | TextEditor: Privatize BaseHoverHandler::decorateToolTip()hjk2019-07-241-1/+1
| | | | | | | | | | | | | | | | Never overridden, and does not look safe to invoke more than once. Change-Id: If5f3830f3fbf26badb6335443defd628c05cf65a Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Utils: Add CommandLine convenience constructorshjk2019-07-232-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ... taking a QString for the executable. This weakens the very explicit QString -> FileName conversion via the named constructors for the special case of constructing a CommandLine. I think that's worthwhile here, as it reduces the noise on the caller site under circumstance where the nature of the thing is obvious. Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Avoid warning on empty expressionshjk2019-07-2311-31/+31
| | | | | | | | | | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | GenericProposalModel: Allow substring matchesAndre Hartmann2019-07-232-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, if we had these three functions: int getSomething() { return 44; } int get_something() { return 43; } int something() { return 42; } then we did not get a completion for getSomething() or get_something() if we just typed "some", as only the prefix was taken into account. This patch adds support for substring matches, and adds these with lower priority to the proposal list. Task-number: QTCREATORBUG-19170 Fixes: QTCREATORBUG-19918 Change-Id: Ifc5e2149e4b1fa995f1f8550efc84e7ff4fb1522 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Escape tooltip textMichael Weghorn2019-07-221-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tooltip text may contain characters that need to be escaped without 'Qt::mightBeRichText' categorizing this as rich text. This is needed e.g. to show the proper type when hovering over a variable of type 'std::vector<int>' (or some smart pointer) in edit view (no debugging session). Otherwise, just "std::vector" is shown since 'Qt::mightBeRichText' returns false for that string and "<int>" is then probably just ignored as an invalid tag when the tooltip is displayed. Change-Id: I25ded2b21e4350a1036ab4b3d8f144383aee776d Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Revert "Use QComboBox::currentTextChanged instead of currentIndexChanged"Eike Ziller2019-07-221-1/+2
| | | | | | | | | | | | | | | | | | This reverts commit 25f9d9c43481b0a02d632bf609417c4302fe1fe1. The deprecation was reverted in qtbase 298f750cdba2bd15e735a47ba8d3b9c093367ba3. Change-Id: I8a05f038be4b7fc89e05830435e08c3212e4f116 Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-07-223-3/+26
|\ \ | |/ | | | | Change-Id: I88a6704fb8d723a3cbdfb1a2d9c84741f30d4da6
| * LanguageClient: Show outline after server startDavid Schulz2019-07-183-3/+26
| | | | | | | | | | | | | | | | | | | | If the server was started by opening a document the outline factory and client was not properly initialized in the time the outline was requested. Update the outline after the client is fully initialized. Fixes: QTCREATORBUG-22695 Change-Id: I84dc56eead9774d80ed6baf7792daff930a7cb8e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | GenericProposalModel: Modernize and cleanupAndre Hartmann2019-07-141-6/+5
| | | | | | | | | | Change-Id: Iae0733c9734f63900af32c89f553d6a337b49daf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | GenericProposalWidget: Fix typoAndre Hartmann2019-07-141-1/+1
| | | | | | | | | | Change-Id: I131ccffa3e80092c1b79a28305974c57d32844ea Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Highlighter: Apply specific ksyntax format attributesDavid Schulz2019-07-081-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | If a ksyntax format explicitly defines font attributes like bold, italic, underline or strike through we now apply those attributes. If the format defines a colors, we first check whether the color is readable before setting it. Fixes: QTCREATORBUG-22646 Fixes: QTCREATORBUG-22229 Fixes: QTCREATORBUG-13545 Change-Id: Id0389b3c71a078dc6d6df74ee5de7f5d479a9bcb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Tim Jenssen2019-07-042-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/libs/utils/synchronousprocess.cpp src/plugins/baremetal/iarewtoolchain.cpp src/plugins/cmakeprojectmanager/cmakeproject.cpp tests/unit/unittest/CMakeLists.txt Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
| * Utils: Add toSet/toList functionshjk2019-07-022-2/+3
| | | | | | | | | | | | | | | | | | As replacement for functionality that's being deprecated in Qt but still useful or needed, or that cannot easily be handled without resorting to #if QT_VERSION checks in user code. Change-Id: Id3575a54ff944bf0e89d452d13944fcaee270208 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Use QComboBox::currentTextChanged instead of currentIndexChangedAlessandro Portale2019-07-041-2/+1
| | | | | | | | | | | | | | | | QComboBox::currentIndexChanged is depcrecated as of Qt 5.13 and QComboBox::currentTextChanged is available since Qt 4.1 Change-Id: I97b8eb37765cbb7556cfbde87ea90f91f63bfa63 Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-06-281-7/+21
|\ \ | |/ | | | | | | | | | | | | Conflicts: CMakeLists.txt tests/unit/unittest/unittest.pro Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
| * Highlighter: Use file pattern matching if mime type is 'text/plain'David Schulz2019-06-241-7/+21
| | | | | | | | | | | | | | | | | | | | | | Do not try to match 'text/plain' mime types against highlight definitions, because it is automatically set if the file contains just printable characters in the first bytes, in this case file pattern matching gives better results. Fixes: QTCREATORBUG-22540 Change-Id: Ifd662cd6961011f5cf5d9232ce5f17d2314b4824 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | LanguageClient: add support for proposed semantic highlightDavid Schulz2019-06-213-2/+8
| | | | | | | | | | | | | | | | | | implements the current proposal for the semantic highlighting via the language server protocol. https://github.com/microsoft/vscode-languageserver-node/pull/367 Change-Id: I857d606fcf5c782e0ea8e18e5d098edd26286aed Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-06-201-1/+14
|\ \ | |/ | | | | | | | | | | Conflicts: src/libs/utils/consoleprocess.h Change-Id: I771630cb4dc60a9e87e9d30d6295040c27348d8c
| * TextEditor: fix low contrast of hovered folding markersDavid Schulz2019-06-181-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | When using the 'windowsvista' style the folding markers are blue when hovered. This color is almost invisible on the default folding range background color. Use the tested folding markers of the fusion style, because it is already used when device pixel ratio != 1.0 Change-Id: I23659cce71a2eb101692597a1d256d43f6426920 Fixes: QTCREATORBUG-21702 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | TextEditor: add additional formats setter to semantic highlighterDavid Schulz2019-06-202-0/+35
| | | | | | | | | | | | | | | | | | The old setter incremental applies formats to the semantic highlighter, in contrast to the new setter, which removes all old additional formats and then applies all passed formats. Change-Id: If8569c180d8eaef7aee99509c84a03ba362c9e4a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: directly create format range for resultDavid Schulz2019-06-191-12/+11
| | | | | | | | | | | | | | | | | | ... instead of just the text char format. Preparation for another way to set extra additional formats to the highlighter. Change-Id: I3635853ee8f4b432ffe48a4a4ebe0e790be603b1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: add convenience function to clear all extra highlightsDavid Schulz2019-06-192-0/+10
| | | | | | | | | | Change-Id: Id3a3c45041a23ba100447d926ed6ab829abbc92b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: explicit cast unsigned to int in semantichighlighterDavid Schulz2019-06-191-7/+7
| | | | | | | | | | Change-Id: Icb279331f1d8b0da068a46c59d9eeb8ea46c1549 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: make it obvious that formats are consumed by setExtraFormatsDavid Schulz2019-06-193-4/+4
| | | | | | | | | | | | | | | | ... by transforming the parameter to an r value and pass the argument by std::move. Change-Id: I6949ee6bbac7d8675fdbbcb62bb4f4c394bb395f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: add convenience function to clear additional highlightsDavid Schulz2019-06-193-4/+23
| | | | | | | | | | Change-Id: Ie3cf6e7f9fb37f3e2270abaf5fca412e7a4a40da Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | TextEditor: modernize SyntaxHighlighter::setExtraFormatsDavid Schulz2019-06-191-31/+5
| | | | | | | | | | Change-Id: Iaebf30d56702ef90b610d2db03c7abb40d1d2bab Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-06-121-9/+12
|\ \ | |/ | | | | Change-Id: If85094fcd5bc2a85de9dbbaf065636f4b568401e
| * Merge remote-tracking branch 'origin/4.9' into 4.10Eike Ziller2019-06-121-9/+12
| |\ | | | | | | | | | Change-Id: I7725557a279cc13fe03a72c20accf63b50571608