Commit Graph

367 Commits

Author SHA1 Message Date
Aleksei German
103a602f8d QmlDesigner: Auxiliary data auto-fold
- Made TextEditorWidget::restoreState() virtual
 - Added function to fold qml Auxiliary Data
 - Extended settings page to fit the new option

Task: QDS-1667
Change-Id: Id1256fcc72a67ac822888d5fd2e23d6076349573
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-03-04 08:43:46 +00:00
Fawzi Mohamed
b09a48599e Update qmljs parser to Qt 5.15 parser
* parser side support for annotations, inline components, new UiVersion
  and all the things included in QT 5.15 parser
* SourceLocation moved from QmlJS:AST to QmlJS
* Visitors now need to handle throwRecursionDepthError
* BaseVisitor for visitors that want to override all visit

Task-number: QTCREATORBUG-23591
Change-Id: I682a30d0b08b6c929739fd0e339ef6fbde3eb630
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-03 15:31:10 +00:00
David Schulz
7021b1f078 Workaround 5.15 deprecations in QTextStreams
Change-Id: Ifc2b7fd353e7c12346e9716115e830679cea7666
Reviewed-by: hjk <hjk@qt.io>
2020-01-17 13:50:57 +00:00
hjk
0120e462b2 Partial compile fix for current Qt dev and/or Qt 6
This does not cover Utils::MapReduceOption with QVector, and code
that's not compiled on my machine.

Change-Id: Ib63923985c52b1bb74e5ec2068a2bb37469ac618
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-12 10:50:51 +00:00
Eike Ziller
59e2774d0d Qt Quick: Separate Qt Quick Designer and QMLJS editor factories
Currently the QmlJSEditorFactory hardcodes that .qml.ui files are opened
"in Design mode", without any option to explicitly open them directly in
text mode.
While this is the preferred way of working, there are always exceptions.

Separate the "Edit mode by default" and the "Design mode by default"
parts into separate editor factories. The former one is the default
editor for .qml files, the latter for .qml.ui files.

This allows users to explicitly choose "Open With > QML JS Editor" to
open .qml.ui files directly in Edit mode.

Fixes: QTCREATORBUG-18123
Change-Id: I72ab2d25fdc538210123782f6611f9c6e3157dea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-15 12:29:07 +00:00
Aleksei German
76cf08a886 QmlJSEditor Exporting AutoCompleter
One more change for the new Binding Editor

Change-Id: I17c9eb02212a29abcc4ef568e7d85cffc14c023d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-09 08:29:12 +00:00
Aleksei German
735cdf88df QMLJSEditor Exporting few classes
These changes are required for the new Binding Editor

Change-Id: Ic1e833819c69831aa1a930ab668a644ae4ccdd6f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-08 12:18:06 +00:00
Eike Ziller
e9272d848b QmlJsEditor: Avoid unneeded exports of constants
Change-Id: I332ff9a01963fe4d37dce9ecd0586d8f0fa6573c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-19 07:21:26 +00:00
Christian Stenger
3ea670d207 QmlJSEditor: Remove registration of json files
Do not open json files with the QmlJSEditor as this produces
strange warnings and Json is not JavaScript at all.
Rely on the correct syntax highlighting by the generic
highlighter and KSyntaxHighlighting respectively.
Beside this it helps also when using a json language server.

Task-number: QTCREATORBUG-22697
Change-Id: Iebd0009c550d9ea701d504797d528226dc32b0ec
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-11 13:54:57 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
David Schulz
7b7a2ad630 TextEditor: Use callback in refactoring markers
Allows to trigger actions without adding specific handling into the
editor.

Change-Id: Ia63d65d3feca37bcefca1b6322ade039027a92d8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-25 06:13:11 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +00:00
Alessandro Portale
5242f58173 QmlJSEditor: Modernize
modernize-*

Change-Id: I4dceb82c3904069a0d9848b2af61122d9282cb36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-10 18:54:57 +00:00
Eike Ziller
8fa449126c Fix context of Locator input
- In the main window, the locator input (actually the status bar)
  visually feels like being part of the mode widget, so give
  it its context.
- In extra editor windows, the whole editor window should have
  "editor manager" context, so that is also active for the locator
  input.

Task-number: QTCREATORBUG-20626
Task-number: QTCREATORBUG-20071
Change-Id: Ib68d6a8177446572ea59c3cc057eca0706173e11
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:55:25 +00:00
David Schulz
da739959ea Move PathChooserDelegate to Utils
Change-Id: I94b3c0b60477145f0f084719fc1cf5f3f4a98534
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-23 13:05:35 +00:00
Eike Ziller
8623a93998 Fix that bookmarks couldn't be added to .pro files with mouse
The area with the marks was not showing up.
This patch reverses the logic for showing the marks area to opt-out.
Almost all editors were opting in for it already. The AndroidManifest
editor, VCS base editor, and widget designer text editor opt out now.

Task-number: QTCREATORBUG-20339
Change-Id: Iccb6d0256618f7ef70e8921847ce2fd46fd660c0
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-19 07:59:17 +00:00
Ivan Donchevskii
08d1274ccc CppTools: Remove processEvents call from follow symbol
processEvents is a bad way of dealing with asynchronous
requests. Use QFutureWatcher for that purpose.

Change-Id: I3839cb9db80a6d391f6af1178e96986a325b7b99
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-19 13:37:46 +00:00
David Schulz
a4b5fc00a8 CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752
Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67
Reviewed-by: hjk <hjk@qt.io>
2018-02-27 12:32:36 +00:00
Christian Stenger
e7663d0cce QmlJSEditor: Fix crash when triggering context menu
Regression introduced with 3da9c89981.

Change-Id: Ia0ede1b46b7bc8cbce8b55335b3a548e7f8d384d
Reviewed-by: hjk <hjk@qt.io>
2018-02-22 09:05:55 +00:00
hjk
3da9c89981 QmlJSEditorPlugin: Refactor
This follows the recently introduced pattern for plugin setup
- Pimpl QmlJSEditorPlugin
- remove unneeded uses of global object pool
- apply "static pattern"
- simplify some constructors of data members in some cases
- use in-class initialization in some case

Change-Id: I95b42d0885f4a8d6c9bfe1e4c004d3ace0a3eba5
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-15 13:31:13 +00:00
David Schulz
f9c959cee2 QmlJSEditor: Move ownership of QmlJSTextMarks to document
Task-number: QTCREATORBUG-19607
Change-Id: I65fa11b43dcbe3c28ab100a1636ad592cfff5a4d
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-22 12:10:02 +00:00
Nikita Baryshnikov
e393422618 Qml&Js: better formatting of enums inspection
Change-Id: I3d3948fcebb6b902a18fcf492122229c69c5ac3e
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-12-13 12:09:06 +00:00
Ivan Donchevskii
8efb598e60 TextEditor: move Link class to separate header in Utils
Link is a common class and is used across the plugins.

Change-Id: Id92e47e1b8604316ca8b970804e57abaf404ec28
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-27 13:57:02 +00:00
David Schulz
b9d00c3f27 QmlJSEditor: Display code model warnings as annotations
Change-Id: Ief6ed8fe551846f5e788c14a49269231462ea40a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-11-17 05:51:06 +00:00
Ulf Hermann
e902980dde Treat .ui.qml mime type the same as .qml
Right now, the qmake project manager offers a "Build" context menu entry
for .ui.qml files and various other things are off because the mime
types are different.

Change-Id: Icc966e56513b9c5aed05f929dc8cb728ed408723
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-10-18 08:11:42 +00:00
Tobias Hunger
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00
Eike Ziller
11333a03cd Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: I624040b7910d4025208709b22157869c6085df2f
2017-07-05 14:55:46 +02:00
Marco Benelli
8e72432654 QmlJs: avoid overwrites by auto-completion
During auto-completion, the cursor used to randomly jump to the
beginning of line, eventually overwriting existing text.
This patch blocks the signals of the selectionModel while it refreshes
the content of the outline model.
Also cleans up a unnecessary variable and make it clear where we blocks
with using a lambda.

Task-number: QTCREATORBUG-18449
Change-Id: I94317c76b4e13d07ef7f3355b766e5473ab21011
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-04 12:17:40 +00:00
Eike Ziller
73f2c0f4e8 Allow giving TextEditorFactory custom CommentDefinition
It was not possible to set custom comment styles.
Also simplifies the code for the predefined styles.

Change-Id: Id7f345d65b747bfac5a15e3eb15cd2beb106b281
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-26 07:34:29 +00:00
Eike Ziller
9443f7104b Remove the need to create ISnippetProvider subclasses
Change-Id: I1810aaa945136d9726a66dad41377429a6adc8e1
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-25 12:03:08 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
Tim Jenssen
76dc24c3b7 QmlJSEditor: avoid jumping cursor while editing
Writing a property made the cursor jumped to the beginning. Now we
only set the cursor if the textedit has not the focus and no code
completion open.

Change-Id: I7e5d41d5f7f9d75ebc90506d276ccaeb193c64b2
Task-number: QTCREATORBUG-15680
Task-number: QTCREATORBUG-17413
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-04-07 10:21:46 +00:00
Tim Jenssen
c643095f17 QmlJSEditor: cleanup updateOutlineIndexNow
It was called to often - it was already connected in setEditor method.
Change outlineModelIndex() to be just a getter and call the
updateOutlineIndexNow() where an update is necessary.

Change-Id: I6f30bfaff74237416c1aef5418860179c1f8ebf7
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-07 10:21:21 +00:00
Tim Jenssen
e4a6f62001 QmlJSEditor: remove unused method
Change-Id: Idab6b104a9e057afde3bcc3059f00592deacfed7
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-05 08:37:19 +00:00
Tim Jenssen
99f2fc9b45 QmlJSEditor: use direct member initialization
Change-Id: I03aada10107a9d80d920d18c92df7ec36e6a22d4
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-03 12:28:49 +00:00
Ulf Hermann
c70b689526 Unify projectexplorer language IDs
We don't need two IDs for C++ and the QmlJS ID should look the same as
as the others.

Change-Id: Ib9747f6b36a90bb652951d85eec69666615670c4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 15:34:46 +00:00
Jarek Kobus
8b67458a95 Prefix editor's uniqueId with plugin name
In this way we minimize the chance of
generating non-unique id.

Change-Id: Idd177c5a4b44b17a58c2a944ec77b9517e91964e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-10 15:14:19 +00:00
Orgad Shaneh
9fd5d64194 Remove unneeded QSignalMapper includes
Change-Id: Idec6b1357d7c1db316c8cb29e82c7c9a62e4f6d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-20 08:12:30 +00:00
Orgad Shaneh
7609e56ee3 QmlJS[|Editor|Tools]: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I56550546b341d486d321329e9a90b9369d56af40
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-28 08:47:26 +00:00
hjk
5e47d35fcd Use Core::Id in ModeManager interface
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.

Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-04-08 10:38:49 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Marco Bubke
6e5f90917f Use text settings instead of hard coded diagnostic text formats
Change-Id: Id51d03a46b4403d9224508ff3c7647b829ee69cd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-09 11:31:02 +00:00
Marco Bubke
b278dc87ca Clang: Add diagnostics
Diagnostics are now moved to the clang backend process. Fixits are
supported too.

Change-Id: I20faacf466bbf78dec479220c3d7b336a47bc453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 14:59:16 +00:00
Eike Ziller
78e8871207 QML/JS: Fix that warnings about editing .ui.qml files accumulated
Splitting the editor would add the warning again. Since the warning is a
document property, handle it in the document instead of the widgets.

Change-Id: Ie20377b05dee14983f7ff46ba04ed2af2b737c96
Task-number: QTCREATORBUG-14923
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2015-08-19 10:21:59 +00:00
Nikita Baryshnikov
12dffc6590 Qml&Js: properties/methods/enums inspection
.. of builtIn qml and cpp code over "Inspect API For Element Under
Cursor" action.

Change-Id: I70d5bec2933b682295c5242248a2b0f95dba4e76
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-15 08:02:50 +00:00
Orgad Shaneh
b6de2d1bd8 QmlDesigner: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I492792bb9e5655c55795e938031efc557c9a462f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2015-02-18 09:53:25 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Orgad Shaneh
c6a983d271 Core: Use FileName for file path in IDocument
Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-12 10:23:37 +01:00
hjk
eacaf93a59 TextEditor: Factory cosmetics
Pimpl, add some convenience setters.

Change-Id: I525c080179fddab6fe2bd2270505fdbf33e56be2
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-10-15 12:35:41 +02:00