Commit Graph

1464 Commits

Author SHA1 Message Date
Tim Jenssen
429163ea1e Qmljs: fix a crash when m_treeview is deleted
Change-Id: I3743815c14151b49784a20cdb0c0bba2fbde4e7b
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-11 12:30:07 +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
d12f5ca4aa Remove unused IAssistProvider::supportsEditor
Change-Id: Ieb2a36bfddbf4f2cade02cbf62b28d112dcb8f10
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-03 13:23:08 +00:00
Nikolai Kosjar
3afbd1e5cc De-qobjectify BaseHoverHandler and derivatives
Change-Id: I9bc1d849349f85b5c7fd6013396b8b15b6cb1568
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-29 07:25:15 +00:00
Eike Ziller
e4a6267036 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/shared/qbs

Change-Id: I521ed7703298062d3860ddce3c82444bedd49e60
2017-06-28 10:28:16 +02:00
Marco Benelli
2123aebf65 QmlJS: keep track of cursor position in reformatting
Task-number: QTCREATORBUG-18416
Change-Id: I30c07e0bff1b3f3933ff0e4aee8f1f2c81bd5ef6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-06-26 07:09:48 +00:00
Robert Loehning
d75ff0aab8 QmlJS: Remove redundant code
Change-Id: I8ad31899fb8c866c086c6e4a1fdbf7e10f939290
Task-number: QTCREATORBUG-18331
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-02 15:10:42 +00:00
Eike Ziller
cf57965ebc Simplify text format handling in syntax highlighters
Pass the mapping from custom enum to text style in form of a function,
which then can use a switch which is checked by compilers, and
avoids the need to lookup a different enum somewhere else to find
out what the mapping actually is.
That mapping is cached to keep performance as before.

Also, most highlighters created an enum just for the purpose of mapping
to text styles, basically creating duplicated subsets of text style like
enums everywhere. Instead provide a default, identity mapping from text
styles to text styles.

Change-Id: I2ea1ca702b99e36b8742dfda510b1b2753f0a1c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-23 07:47:22 +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
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
Thomas Hartmann
5cf8fbabda QmlDesigner: Fix Crash
Task-number: QTCREATORBUG-17998
Change-Id: Ic0ad46455a0e56af3082c1d9ce8995a7f07c2238
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-11 12:44:55 +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
2c1c51bbea QmlJSEditor: remove modeUpdated method
It does not say what it does, it is better for understanding
to call the direct method instead.

Change-Id: I2150d4c84254f684474e353995b466b59d4844c0
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-07 10:20:52 +00:00
Tim Jenssen
17fbbda57e QmlJSEditor: use initializer lists
Change-Id: Id02f4313cd789fabd1223c6934e1aa5a39ed43ca
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-07 10:20:10 +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
7e6d88ed49 QmlJSEditor: add some overrides to QmlJSOutlineWidget
Change-Id: I6053900493728433a5631f5aa6f1e3e967e270e9
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-03 12:28:58 +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
Tim Jenssen
cff6a97a9b QmlJSEditor: add missing class forward
Change-Id: Ic2f7c8e9366f86f6f768cc21a060112f25c31278
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-03 12:28:41 +00:00
Thomas Hartmann
7ff7aefeb3 QmlJS: Add special severity for loading type information
The designer has to be able to handle this error/warning
explicitly. To be able to identify the warning I added
a special severity.

Change-Id: I99571497f7327a7857244ef48334c14a254c8ca0
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-30 13:07:28 +00:00
Marco Benelli
61d30a20ce QmlJs: sync qmljs parser
The last version of the grammar contains some constructs that the code model
needs to know.

Task-number: QTCREATORBUG-17842
Change-Id: I6250f96431acc05b19f3fd1b6cc268a07485cf0f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 07:50:26 +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
Eike Ziller
c175f1e62f Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/ios/iossimulator.cpp
	src/plugins/projectexplorer/projectwindow.cpp
	src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp
	src/shared/qbs

Change-Id: Ie98e2401a2259903141a13170c78388f2da467d2
2016-12-09 12:42:01 +01:00
Marco Benelli
f78dd2be64 QmlJs: disambiguate help lookup
The help system used to be confused by types from QtControls2, since
they have often the same name and version as the ones in QtControls.
This patch resolve the issue by looking for a number in the module
name, and then using the url found as helpId.

Task-number: QTCREATORBUG-16851
Change-Id: I48196d90b0fea5edf50751900864a39075894866
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-12-07 10:50:07 +00:00
Marco Bubke
ddfd29852a Utils: First step to extend search results for clang query support
We need multi line support, multi text range support. This is only adding
enablers and adds later the multi line and multi text support because this
triggers larger changes because you have to know the text document.

Change-Id: I44e46d9d80d7d73b2650c69cc83657c20c85bfae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-23 10:48:59 +00:00
Orgad Shaneh
6d1d1a4416 Merge remote-tracking branch 'origin/4.2'
Change-Id: I957c22020fbacb2f631220b0cdc7fa16a782798b
2016-11-21 10:25:45 +02:00
Friedemann Kleint
3b1308bb43 TextEditor: Remove exported class QuickFixOperations
Define an operator << that accepts a raw pointer for the list of
QuickFixOperation::Ptr instead.

Fixes MSVC 17 warnings

src/corelib/tools/qlist.h(423): warning C4661: 'QVector<T> QList<T>::toVector(void) const': no suitable definition provided for explicit template instantiation request        ]
src/corelib/tools/qlist.h(389): note: see declaration of 'QList<TextEditor::QuickFixOperation::Ptr>::toVector'
src/corelib/tools/qlist.h(423): warning C4661: 'QSet<T> QList<T>::toSet(void) const': no suitable definition provided for explicit template instantiation request
src/corelib/tools/qlist.h(390): note: see declaration of 'QList<TextEditor::QuickFixOperation::Ptr>::toSet'
src/corelib/tools/qlist.h(423): warning C4661: 'QList<TextEditor::QuickFixOperation::Ptr> QList<TextEditor::QuickFixOperation::Ptr>::fromVector(const QVector<T> &)': no suitable definition provided for explicit template instantiation request
...

Task-number: QTBUG-57086
Change-Id: I879511656c39eb7a3eae54ea7daca3eca8ebe8d7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-18 11:47:59 +00:00
Michael Dönnebrink
ed6abae46d QmlJSEditor: Add option to automatically format QML/JS file on save
Change-Id: Ide1810efdef98595705daa32c83fecc2ad367a49
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-02 19:38:38 +00:00
Thomas Hartmann
5a3aa3fc3e QmlDesigner: Allow .ui.qml file in component creation
Change-Id: I3ae5822820c365d0cbc7d679c6365a25f34b1637
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-04 08:59:13 +00:00
Tim Jenssen
d915b22db9 improve static initializers
Change-Id: I304fdd6627f01fc216c84930da607127c52409d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-09-23 14:27:01 +00:00
Tim Jenssen
a9221a53d8 QmlJS: improve static initializings
Change-Id: Ifa37c912d0e43bcda896cb0ea851f97566c88d78
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-09-21 12:05:23 +00:00
Alessandro Portale
e809594fae Core: Make IOptionsPage::categoryIcon a Utils::Icon
This is necessary for themable + HighDPI icons in the options dialog.

Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 12:52:49 +00:00
Thomas Hartmann
e0e314427d QmlJSEditor: Expose helper function for auto completion
The function qmlJSAutoComplete() will be used by the QmlDesigner.

Change-Id: If569e3f22e2dd934b9043b2e139da597686496ae
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-09-05 12:21:45 +00:00
Tobias Hunger
8393b35af9 ISnippetProvider: Code polish
Remove useless constructors and destructors and consistently apply override/final.

Change-Id: I83d8e75803caa9007454b528f555a11a7930aefc
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-22 11:36:28 +00:00
Andre Hartmann
fc75b96dca BaseHoverHandler: Remove virtual and add override to derivations
Change-Id: I2bd3fd4774d7ffeb54c373309c98aa879a391227
Reviewed-by: Marc Reilly <marc.reilly@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-10 11:04:18 +00:00
Nazar Gerasymchuk
90629108fc UI files: Fix tab order in lots of UI forms
For unknown reasons tab order in listed UI files was set incorrectly and
behave unexpectedly. Now tab order behave naturally.

Changes made for listed objects and touches only UI.

Change-Id: I057b95eb21943ddb29b108682618382661db7be9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-02 14:29:27 +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
b6bc52065c QmlJSEditor: Minor cleanup
Remove unneeded variable, and connect directly to member functions.

Change-Id: I2c5077676fc8d3f975d03a71b3e566b692e6b7c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-29 09:05:28 +00:00
Christian Stenger
06b2df0e27 QmlJSEditor: Fix compile with Qt5.5
Avoid using functionality introduced with Qt5.6.

Change-Id: Icfa4eeb547b651a19aa745b5de1cb413f9b6b4ef
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-28 11:53:04 +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
David Schulz
6750607244 Editor: Skip auto completed character only if it was recently inserted.
This means you can skip automatically inserted characters as long as you
don't explicitly move the text cursor and the editor doesn't lose the
focus. This will be visualized by highlighting the automatically
inserted character as long as you can perform the skipping.

This will reduce unexpected skipping in the case a cursor was explicitly
placed before an closing brace and a closing brace is typed.

Change-Id: I28e29e79ba10c9c48e8bc8817405fea630cca9bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-21 11:56:56 +00:00
David Schulz
7595aaa227 Editor: Separate auto insert brace and quote magic.
To allow enabling/disabling both features separately.

Change-Id: Ica154e3b400823de7cf22daf006958802d751c64
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-25 13:55:50 +00:00
Vlad Seryakov
af56457ab6 Add support for new javascript methods to QML/JS outline
Extened AST visitor for outline, declaration and locator to include
Javascript methods, prototype functions with formal parameters for
better readability.

Change-Id: Ifbb2b157699c929412196f356b0c28ae0564f866
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-05-20 10:07:58 +00:00
Tim Jenssen
7e08363052 qbs build: remove unnecessary script dependency
Change-Id: I0e5764ffc9a6146932c43d96a31138451260c161
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-13 11:42:43 +00:00
Tim Jenssen
16063554da QmlDesigner: fix showing a new component in item library view with vcs
- not completely sure why this fixed the issue

Change-Id: I3e514c64246831899511774cada4497ce86f5b7d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-04 10:56:37 +00:00
Thomas Hartmann
000b82523b QmlJSEditor: Do not open created component
The user can easily navigate to the new component
and in many cases the user wants to continue in the
original document.

Change-Id: Id91ed4c0adb26cf91d39be73689aec4f34034488
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-02 09:16:11 +00:00