Commit Graph

1464 Commits

Author SHA1 Message Date
Eike Ziller
4cba1d7c71 Merge remote-tracking branch 'origin/4.6' into 4.7
Change-Id: I5ffa9febea2ced10892a145aa0b930d45d84aea5
2018-06-11 14:31:54 +02:00
Marco Benelli
50f536b9ae QmlJs: check markers before cleaning them
Task-number: QTCREATORBUG-20197
Change-Id: If4594a72abf4acf2455e55688679ba7f78900f76
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-06-08 09:02:21 +00:00
Eike Ziller
3f356f31bc Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I3d42bd52fb7b977cfdfad83092fb6f6eac974e24
2018-06-06 09:57:01 +02:00
Eike Ziller
f8e88e8ce4 Fix compilation issues with C++17
Testable on Linux/macOS by changing c++14 to c++1z in qtcreator.pri.
Testable with latest MSVC2017 by setting _CL_=/std:c++17.

unary_function, binary_function, and a few other things that were
deprecated are removed in C++17.
std::string got a non-const overload for its "data" member function,
so we cannot create a function pointer on it without specifying its
type. Use std::declval instead (though it requires a default constructor
for the type).

MSVC seems to have an issue with Utils::transform for std::vector
(used in Nim plugin), but that looks like a compiler issue.

Change-Id: I94f9a93d591d55b610f86fabfc618158927d6221
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-05 12:04:59 +00:00
hjk
829df213a4 QmlJSEditor: Remove unused class QmlJSPreviewRunner
Change-Id: Ide6f2ba000e361545500da398740cc6b54efdc6d
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-05-30 13:04:12 +00:00
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Marco Benelli
d14e89f899 QmlJS: improve support for enum declarations
Add indentation and little highlighting for enums.
It just highlights the 'enum' keyword and the name of the enum, not its
values.

Task-number: QTCREATORBUG-19226
Change-Id: I36e46a27b0e32c4aecc8e91875c3d22df1814d93
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-05-23 08:04:26 +00:00
David Schulz
d4c7814e9e Utils: remove Clang from ClangCodeModel_*_TextMarkColor
They are also used by the qml code model, and may be used by additional
code models in the future.

Change-Id: If216cbeb7b77be0f3b6f31671c71d913206315cb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-17 05:55:53 +00:00
Tobias Hunger
053e4494cf Qml: Consistently use nullptr
Fixed by clang-tidy modernize-use-nullptr.

Change-Id: Ibe0dddaacbabd47b5a0519ae361132818d5b8be2
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-05-08 07:43:40 +00:00
Tobias Hunger
0cb0c0451d QmlJsEditor/QmlJsTools: Use override consistently
clang-tidy fixes from modernize-use-override check.

Change-Id: I29716dcf73946b5762568d349a3f5a3da4f656e6
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-05-07 15:44:57 +00:00
Eike Ziller
45f8d221bf Use FileName in TextMark
Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-03 06:51:47 +00:00
Eike Ziller
d1ec4c1204 Clean up options page category display name and icon set up
In cases where plugins extend an existing settings category of a plugin
that they depend on anyhow, they do not need to specify the translated
display name and icon for that category.
Some options pages were already not setting the icon, but still the
translated name, which makes even less sense.
Clean up this mess, only setting display name and icon if that is
necessary.

Change-Id: I8bc9d0c51b11d48f1d847337838704d663e70b45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-23 11:12:26 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
David Schulz
a2c362af31 QmlJSEditor: fix crash after document reload
Clean up all marks in the document destructor, to prevent accessing
already deleted member in a TextMark callback.

Task-number: QTCREATORBUG-20199
Change-Id: Ica996ea393b9ae636c731f009a6d39552ff35e26
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-04-11 08:18:49 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +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
Robert Loehning
37aea43479 Don't translate default windowTitle again and again
Change-Id: I4b4ff16e02c517bcd5a7c5ae73f62dd2a5bcc7cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-06 14:57:40 +00:00
David Schulz
f288dc639c QmlJSEditor: use static icons in assist interface
Change-Id: Ibfe515a3cea5a447b1cc1d01bc02e9fc70a2d948
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-06 12:08:52 +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
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Christian Stenger
3e81fe628a QmlJSEditor: Avoid detaching of containers
Change-Id: I52bb5b073793c11cf157cb72244ba3552ca1ac72
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-01-22 13:58:57 +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
Nikolai Kosjar
0a4073ef90 TextEditor: Return hover handler priority by callback
...to get rid of the asynchronous code path.

Change-Id: I56377510440631b0be712333b2a4018717c86389
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-19 13:57:57 +00:00
hjk
b4faec80ba QmlJSEditor: Create QuickFixes directly
So far there have been factories instantiated and maintained to get
a list of 'matching' operation by iterating over the factories'
match() functions. The same effect can be achieved more directly
by calling stand-alone functions.

Change-Id: I868489d36f9d8339e0d8855d832df8400501026c
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-01-10 07:03:49 +00:00
hjk
479ab4ef22 TextEditor: Split the global QuickFixFactory list
It's only ever used in the filtered Cpp/QmlJs variants. Splitting
the class simplifies the code and avoids re-doing filtering over
and over again.

Also inline QuickFixFactory::matchingOperations() into callers

Change-Id: I730756315f2e0321649259ef229631233b12fbdd
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-18 15:39:51 +00:00
hjk
a137ece13b Cpp/QmlJSEditor: Add some 'override'
Change-Id: Ic73f1602922fffa6cb8610e45ada292c759669c5
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-18 07:32:03 +00:00
hjk
6c537b35d5 TextEditor: Dissolve QuickFixAssistProcessor
... into QuickFixAssistProcessor and QmlJSQuickFixAssistProcessor,
by essentially duplicating the class, but moving the actual work to
a new a GenericProposal::createProposal(...QuickFixOperations...)

Less indirection, and less code in total.

Change-Id: I2f8cba970bf587c9cbf04321269a60ed51bfae2a
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:59:33 +00:00
hjk
ff04632b92 TextEditor: Remove QuickFixAssistProvider
It did not contain any functionality beyond the base IAssistProvider
anymore.

Change-Id: I0198b3d629f81be8c994ffed3904b5f12ee7f9b9
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:42:40 +00:00
hjk
4f3ac0382a TextEditor: Use more direct access to quick fix factories
Change-Id: I65fc5c0ca6c7806e09b4bd626fd1679686df7d7f
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:33:23 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +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
Tobias Hunger
7c35a38100 Session: Move all functionality related to Nodes into ProjectTree
Do no longer expose Nodes from the SessionManager's API. These are now
exclusively handled by the ProjectTree.

Change-Id: I585c2ac919462073870363436e767640775d9045
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 13:44:09 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Marco Benelli
7376336e15 QmlJs: prevent "copy" icon in outline drag and drop
Copying items in the outline tree is not allowed, so the icon it is
not shown while dragging with the CTRL button pressed.

Task-number: QTCREATORBUG-13450
Change-Id: Ibfcf954c273051ef03112d11ee6a3457530802bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-12-05 10:16:39 +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
Orgad Shaneh
371b2bbbab Merge remote-tracking branch 'origin/4.5' into master
Change-Id: Ibcdd1230b40d1ca7a414843ee0f9ae4cddb29f6f
2017-10-17 20:00:44 +03:00
Marco Benelli
32e444d9cc qmljs: use IEditor to positioning cursor after reformat
Thanks to the IEditor interface, there is no more need to use the
editor's widget.

Change-Id: Ic316dd21572ec5c36e10c9213a6c5d19bd7c62e6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-16 13:15:19 +00:00
Marco Benelli
267167a097 qmljs: do not reset undo/redo history in reformatting
Task-number: QTCREATORBUG-18645
Change-Id: I5b64fa5e59af3d871d3124d668bfd1f86883e752
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-16 13:15:03 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02: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
Laurent Montel
fd2cca08c0 qmljseditor: fix forward declaration
Change-Id: If44cf14eb04c74a164d6b3cd68cd5a114fff1533
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-28 14:57:06 +00:00
Ivan Donchevskii
ad62b1e022 EditorManager: move all openEditor functions to one place
Remove code duplication for openEditor function that
gets search result as a parameter.

Change-Id: I3eb1c41b8a0fda3b2e8a4929cef1d5924295f1f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-25 14:26:12 +00:00
Marco Benelli
6f7aa1f962 QmlJS: user defined style in reformatting file
The size of tabs and indentation used to be ignored when reformatting
a file.

Task-number: QTCREATORBUG-12849
Change-Id: I0b522b526a199c6397b78b5e193159ec52fc941a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-18 06:58:35 +00:00
Eike Ziller
04da881268 Fix copyright year in plugin info, --version, and macOS info
By using the new QTCREATOR_COPYRIGHT_YEAR variable

Task-number: QTCREATORBUG-18612
Change-Id: I3bcf0319660d210436d3130c00f43325c460a66c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-08-24 11:23:40 +00:00
Eike Ziller
5a1a20f2ee Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: Ifb1dcc847ba4b32a79b349955fad5207e402cb7b
2017-07-12 10:50:49 +02:00