Commit Graph

954 Commits

Author SHA1 Message Date
Christian Kandeler
1ca649994c Fix qbs build.
Change-Id: I3d335648bed71faf92079b08b19f11119a664a02
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-28 10:31:38 +00:00
BogDan Vatra
28d2b16165 Allow plugins to insert custom imports.
This patch allows a plugin to insert custom imports. These imports are
used by QtC for syntax highlighting and code completion. This way a
plugin can register types and objects that are available only at
runtime.

This is an example of an imports function implementation:

QList<Import> MyPlugin::imports(ValueOwner *valueOwner, const Document
*context) const
{
  // context is needed to know from which project is the opened document
  // in this example we don't care about multiple projects

  Import import;
  import.object = new QmlJS::ObjectValue(valueOwner, "<defaults>");
  import.valid = true;
  const ComponentVersion version(1, 0);
  import.info = ImportInfo::moduleImport("MyPlugin", version,
QString());
  auto myType = valueOwner->newObject(nullptr)
  myType->setMember("myProperty", valueOwner->valueOwner->intValue());
  // add more properties & methods/signals to myType

  import.object->setMember("MyType", myType);

  // in this example we return only one, but you care return more than
one
  return QList<Import>(import);
}

Change-Id: I395c273c7b15a9e4ed5a89a81d70ff92db2b7c0c
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-28 06:17:58 +00:00
Eike Ziller
3858c33d74 Merge remote-tracking branch 'origin/3.4'
Change-Id: I35ba4cc7f7052699c3006545514c866be3cb5fdd
2015-05-26 15:12:42 +02:00
Denis Kormalev
2105115fdf QmlJS: allProjectsInfosForPath method
Method that returns list of all project infos where this file belongs (similar to methods in cpp module).

Change-Id: I94eb86ffa5bdbee8d794377a03160418b7340662
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-19 08:00:50 +00:00
Orgad Shaneh
6c2bcb588b QmlJS: Mark some overridden functions
Change-Id: I5c85dda01a442e4b227c846d6fa5057e1fe82939
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-18 17:26:04 +00:00
Kai Koehne
40dc289360 Remove QmLJSDelta class
The class was only used for the Apply on Save functionality in the
QML Debugger, which got nuked in 3bf81efbe7.

Change-Id: I1842cc07d61fe84f8da23210ebac04dd4d567fce
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-24 13:26:37 +00:00
Orgad Shaneh
cb350bfeb2 C++: Rename ClassOrNamespace -> LookupScope
Change-Id: Ide74482b133dd1fec40a725d9aa81bd749385f37
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 14:51:56 +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
Alessandro Portale
8983ccc284 Remove a few unneeded "QT += script"s
Change-Id: I078300c7b7a9667109754522048736c886b815ae
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-04-01 08:55:16 +00:00
Alessandro Portale
1e7fa33a13 Remove a few unneeded "QT += xml"s
Must at some point in time have been changed to use QXmlStream*

Change-Id: I8ed535f51246a0917454352d459a0f24c34f4a62
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-03-31 17:58:26 +00:00
Friedemann Kleint
1b9be30371 Clean headers in lib qmljs and plugins qmljstools, qmljseditor.
Change-Id: I3256db8f4d42b6326d986d754b45e6c6c2030839
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 08:17:10 +00:00
hjk
e36b40161e QmlJS: Fix crash in PathsAndLanguages::compact()
Task-number: QTCREATORBUG-13786
Change-Id: If8c84714382c751f51315d62e1d4b0764e4431ff
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2015-03-04 09:33:19 +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
Fawzi Mohamed
6a120df7f7 qmljs: do not look up types in the prototypes
looking up types in prototypes leads to a recursive blowup when resolving
the prototype of a type returns (for incorrect code) the type itself.

Change-Id: Iebcbdda7554e5fe01f0ef323ccc2079888c7ef4e
Task-number: QTCREATORBUG-13906
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2015-02-16 15:15:33 +00:00
Fawzi Mohamed
b3f049aa7d qmljs: load qmltypes even if there is no plugin
Change-Id: Ib193113c2c6bf085765d20e4f8d0b89b43cca0e1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-02-16 15:10:59 +00:00
BogDan Vatra
bb0dc34c50 Allow the user to add instantiating components
This feature is needed to enable code-completion in a dynamically loaded
qml file e.g. let's say that Main.qml is our application entry point and
in it will load *dynamically* another qml file: MyView.qml. At runtime
MyView.qml will see all Main.qml ids and properties. The problem is that
QtCreator doesn't know that MyView.qml will be loaded dynamically by
Main.qml and it can't offer code-completion of Main.qml ids and
properties. This patch allows the user to inform QtCreator that
MyView.qml will be loaded by Main.qml using a simple annotation in
MyView.qml: // @scope Main.qml

It also works recursively e.g. if MyView.qml loads dynamically another
qml file (MyView1.qml) and in MyView1.qml we can add "// @socpe
MyView.qml" annotation. This way QtCreator will offer code-completion of
MyView.qml and Main.qml ids and properties when coding on MyView1.qml.

Change-Id: If50aee81cae40c8b95dbb4c0653e5a91f7a4cff4
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2015-02-16 10:56:22 +00:00
Eike Ziller
56aadc407d Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/debugger/watchhandler.cpp
	src/plugins/projectexplorer/kitmodel.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/shared/qbs

Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
2015-02-12 17:36:29 +01: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
Fawzi Mohamed
73a9bea51d qmljs: do not rely on future.isCanceled to be sticky
Change-Id: I92f32b9cbea1ddb1660895264f853068c31af4cd
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-22 11:37:26 +01:00
Takumi Asaki
0efe82475f qmljs: fix message
Add missing comma.

Change-Id: I1828389f209c1ba369596a6b509a9c586db1e79a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-21 10:11: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
Robert Loehning
18aa49e7c2 String improvements
Change-Id: I45778c9562ba530a36ddaf201f0c61d380d701cf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2015-01-06 11:50:19 +01:00
Eike Ziller
541d00453a Merge remote-tracking branch 'origin/3.3'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/projectexplorer/projectexplorer.cpp
	src/shared/qbs

Change-Id: I6d91042bb48314d00be721099aed19feca74e0ce
2014-12-10 13:20:02 +01:00
Fawzi Mohamed
b02904597b qmljs: lookup libraries in the correct place
This lead some libraries to be “lost”, typically QtQuick

Change-Id: I44e8fd12f53ce1371a2d4bd094fe5b67cad30676
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-12-04 13:36:28 +01:00
Fawzi Mohamed
cfe29cc936 qmljs: fix projectInfoForPath and fileToPath mapping
m_fileToPath was not always updated correctly which lead
projectInfoForPath to return a wrong/invalid project info,
messing up the paths used by the code model.

Change-Id: If5e144f1ef2c7353b9077deb1b9c9aa9d1708651
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-12-03 11:53:50 +01:00
Eike Ziller
d341c48246 Merge remote-tracking branch 'origin/3.3' 2014-12-01 15:44:30 +01:00
Fawzi Mohamed
9b0bdf981f qmljs: fix library path for builtins
Change-Id: Ie43f7a3241ae8d253853a0b38781774a70cb6897
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-26 17:34:36 +01:00
Eike Ziller
938326ef2c Merge remote-tracking branch 'origin/3.3' 2014-11-26 11:11:46 +01:00
Fawzi Mohamed
fbaa9d8389 qmljs:reduce warnings for private plugins
Private plugin are considered those whose name ends with "private".
Avoid being misleading, i.e. do not declare the plugin dump as successful.

Change-Id: Id181d3a09dc9c4895f6566e22ad670435bd5a7f8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 14:37:02 +01:00
Fawzi Mohamed
27d5e309a9 qmljs: ignore dump errors on initial scan
Change-Id: I7dd5d472148244116bf3d5e3dcc55e74f2c8f203
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 14:36:39 +01:00
Fawzi Mohamed
addb1c171a qmljs: phase out qtImportPaths
builtins were always using qtimportPath, which is now being removed,
so prefer qtQmlPath.

Change-Id: I99d9214c2188507859f27b729c027aaf77eb579e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 14:30:17 +01:00
Fawzi Mohamed
ebea99d399 qmljs: make dumping nonrelocatable by default
Change-Id: I543a72a90be38e6d2af49c70cb9c3f3301cf9bad
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 14:29:42 +01:00
Fawzi Mohamed
af803b60ae qmljs: cleanup
Change-Id: I951403ecec2b896e5b0322d79dfad952deeaae4a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 13:06:41 +01:00
Fawzi Mohamed
9c3f5dd3a4 qmljs: avoid storing qmltypes and qmlproject
qmltypes files were stored in the snapshot during scan, this is wrong
and bloats the memory usage.

Task-number: QTCREATORBUG-13369
Change-Id: Ie8c3970ad7a8d732230f3dc73a9ba65ab62ea4e9
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-25 11:05:47 +01:00
Eike Ziller
a47fbb8309 Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/coreplugin/coreplugin.cpp
	src/plugins/coreplugin/themesettingswidget.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.h
	src/plugins/qmlprofiler/qml/Overview.js
	src/shared/qbs

Change-Id: Ibe92c166fc5bfbcb4d6964e50ca7298d8459d60e
2014-11-24 15:43:48 +01:00
Christian Kandeler
4b0992568f QmlJS: Fix potential null pointer access.
Change-Id: Ib3e6256343e912a0af4e9618d0f17e1075b94ff0
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-20 14:08:49 +01:00
Fawzi Mohamed
9181e06ef2 qmljs: avoid warnings for empty qmltypes files
Change-Id: I5cd29540afa5c7ec1a7031d6e698e873003b3f0a
Task-number: QTCREATORBUG-13354
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-19 21:42:31 +01:00
Christian Stenger
8f546fee37 QmlJS: Allow scan of files
Change-Id: I25fd0d76cf69fa144112de96cc677d6f316da736
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2014-11-19 10:52:37 +01:00
Fawzi Mohamed
7e1b512f31 qmljs: add isIdle method to detect background parsing/scannig
If the qmljsmodel has no background task, then isIdle returns true

Change-Id: I31420343c560c5ed118f371f7be347eadb6622f4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-11-18 10:04:54 +01:00
Christian Kandeler
9d677e3302 qbs build: Remove unneeded import statements.
The respective items are available without it.

Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-11-10 15:45:14 +01:00
Fawzi Mohamed
6fed775226 qmljs: do not warn for QT_TR* functions
Change-Id: If5cf78434458ae639b4ebd0cb156110b5a291613
Task-number: QTCREATORBUG-12494
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-11-06 11:40:19 +01:00
Leena Miettinen
b93ba85c58 Doc: new QML code syntax check messages
Edit the new messages and add them to the Qt Creator Manual.

Change-Id: Ib494fd20861473ea824dd0d4260cad621c4081a4
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-11-05 10:40:15 +01:00
Robert Loehning
4161e7f9d9 qmljsscopebuilder: avoid warning from clang
Change-Id: I7ea4b8cd971bee1368dec3ce92ef27bf45d4c88b
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-11-04 16:46:45 +01:00
Eike Ziller
9c7019f0b2 License update.
Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-15 15:19:55 +02:00
Thomas Hartmann
7956107187 QmlJS: Distinguish between erros for ui.qml files and designer warnings
We properly distinguish between warnings in the Qt Quick Designer and
error in a .ui.qml file.

The warnings are a subset of the errors anyway.

Change-Id: Ib3b21a845436381df10863b464c975b0b39fc063
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 12:37:28 +02:00
Sebastian Sauer
97c955a323 Add QmlPrototypeReference::document() getter
Enable access to the private Document
instance in the same way its done
already in the ASTObjectValue class
by adding a const getter.

Change-Id: I0581e527bb766fc72682f2e38d0d8d52d4452deb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 11:16:18 +02:00
Thomas Hartmann
11b30a22ed QmlJS:: Allow qsTr() for .ui.qml files
Change-Id: I8ccae13653bbb010853d99be9136bf364b823c3d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 09:24:01 +02:00
Thomas Hartmann
033b711dc7 QmlJS: Adding checks for .ui.qml files
Change-Id: I88eab65e1c1187ffd5a88fb5c9780d0156a17729
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 09:23:41 +02:00
Eike Ziller
020c86038c Merge "Merge remote-tracking branch 'origin/3.2'" 2014-10-14 16:28:45 +02:00
Thomas Hartmann
93c3ee1bbf QmlJSEditor: warn when editing .ui.qml, activate designer checks
Change-Id: I2f6d39633341bd1197d16c5c097573d4ab090896
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-10-14 15:38:50 +02:00