Commit Graph

972 Commits

Author SHA1 Message Date
Fawzi Mohamed
d90bd09499 qmljs: tests of the import architecture
First tests using the new qmljs testing architecture

Change-Id: Id88fe53dddbb720c56cd0473e74f476862feb803
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-07-30 15:07:50 +02:00
Fawzi Mohamed
02bdf30f45 qmljs: improve handling of qml dialects
Language::Enum -> QmlDialect
 * class instead of enum
 * moved Language specific operations to it (from Document)
 * nicer handling
QStringList -> PathsAndLanguages
 * store language along with path, to perform a correct scan and improve
   path handling

Change-Id: If69d35c63cfeb48aa670b51870916cd0c40f1916
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-07-30 15:07:35 +02:00
Fawzi Mohamed
281161c242 qmljs: improve multithreading safety
ensure that the QSet copy operation of the scannedPaths in importScan
is atomic.

Change-Id: Ifb3566a86d1d6ac6abf29f1b4cbe19868947d0cc
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-07-30 13:24:43 +02:00
Fawzi Mohamed
4a60aa7f05 qmljs: uniform property info
CppComponent has extra information on properties that makes sense
also for ObjectValues, change the processProperty method to pass
in an extra struct with that info (and that can be later extended).

Change-Id: If09b178a4095bed03ff59bfb2164088309d2c8e2
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-07-29 15:21:51 +02:00
Fawzi Mohamed
6763352340 qmljs: move defaultProjectInfoForProject to the qmljs library
This removes qmakeprojectmanager and qmlprojectmanager dependency on
qmljstools.
Qmlprojectmanager still imports qmltoolsconstants.h for a constant
but that gives no runtime dependency.

Change-Id: Ifd2e76500a3b27a21937603925f03a70049900e1
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-24 16:54:42 +02:00
Alessandro Portale
35d6394523 "foreach (QString" -> "foreach (const QString &"
Change-Id: Idb866407347722766edbc85ce20799b088ce36dd
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-07-24 12:15:49 +02:00
Fawzi Mohamed
06dc8140ff qmljs: disable console warnings for failed dumping
Change-Id: I7905dedb15ae7d84bf55013abdd822dd40984588
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2014-07-23 11:00:11 +02:00
Fawzi Mohamed
d83aa93780 qmljs: fix import search paths collecting
Change-Id: I0b977d3186d8a0ab8f48e1d689e0ab9d045b46e3
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-22 14:50:56 +02:00
Robert Loehning
4f5747e348 Compile fix for Qt 4.8.6
Task-number: QTCREATORBUG-12695
Done-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Change-Id: Id184bb051c08ee954474cca89308712e14710f23
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-17 17:02:33 +02:00
Fawzi Mohamed
883545a03d qmljs: avoid shortened names
libPath -> libraryQualifiedPath
vContext -> viewerContext

Change-Id: I085f5f3304a6becaa00f715cb3395c8cee5227c6
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-17 13:21:22 +02:00
Fawzi Mohamed
176096d112 qmljs: track origin of ObjectValues
allows unique identification of types

Change-Id: Id4e6a9c1fa23409b1e2d5eb32708a0bacd04a5da
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-17 12:14:33 +02:00
Fawzi Mohamed
dae0d5afcd qmljs: add libPath utility method
Change-Id: Ie99d3cbff602e38418faeda565526793089a543c
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-17 12:14:08 +02:00
Fawzi Mohamed
5e68b6b1be qmljs: make Context::vContext publicly accessible
Change-Id: I3307bd37f55de9d769e1fa9ecaf253fa5887ca64
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-07-17 12:12:49 +02:00
Fawzi Mohamed
43aa3902b3 qmljs: remove absolute path library imports
Change-Id: Ib1d6708b7f280d5906452ae5fefc11f8a8700db9
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-07-15 17:06:11 +02:00
Fawzi Mohamed
cd92b70f65 qmljs: avoid reset if C++ types did not really change
Change-Id: I00b59a6b140eb33e2f3206f11e6ab0f9b470dff0
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-07-15 17:05:27 +02:00
Fawzi Mohamed
ce4dc86d58 qmljs: avoid adding the full path without required path
full path imports of modules did not have a required path (not even /),
so did show up with any import paths.

Change-Id: I494edc50339f0c707499b13f6c16c2a264cbaa79
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-07-07 20:07:07 +02:00
Fawzi Mohamed
7f91cf58b9 qmljs: put file specific logs in anonymous namespace
putting file specific log categories in anonymous namespace
avoid the possibility of nameclashes.

Change-Id: I17a07015ffe1c539824fcfcbc2296335d9225dd1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-07 15:03:00 +02:00
Fawzi Mohamed
52cb3d5a7a qmljs: improve handling of default values for AnyLanguage
Change-Id: I97ae24c386a6316b32b8213ab5fc5cb5c6800c65
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-07 09:29:51 +02:00
Orgad Shaneh
def9695e42 Fix Qt4 compilation
Change-Id: I59f5e4ceec008adedb6f548502c7c90854c033ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-07-06 07:21:48 +02:00
Fawzi Mohamed
9a60137448 qmljs: add explicit typeName to exports
Change-Id: If777f312c6532db9a37214f173c10b5542c02e60
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-04 14:06:22 +02:00
Fawzi Mohamed
ef54a29c7b qmljs: add possible exports given by its path if no other exports found
Change-Id: I23c99aacf0c76fe9ceca0c7c05c17102b90244cd
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-04 14:05:16 +02:00
Fawzi Mohamed
fa24266972 qmljs: improve handling of relocatable dumps
Change-Id: Ie329911a3f7f9266ead41087cbc7d78b95c1497a
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-04 14:03:30 +02:00
Fawzi Mohamed
c44cffa49d qmljs: eagerly import library typeinfo
Change-Id: I599b84e9938d021343cca1cdb7d54d53155eaf91
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-04 14:00:20 +02:00
Fawzi Mohamed
4dc438db5e qmljs: switch to the new category logging
Change-Id: Id4e43779590939e9d6dd2d0dab536f70e721f097
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-07-01 11:31:12 +02:00
Fawzi Mohamed
def863eec6 qmljs: split Unknown in NoLanguage and AnyLanguage
Change-Id: I31276084af5e2f0c5f4ca861f17e29430563bb13
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-07-01 10:19:50 +02:00
Fawzi Mohamed
329952f5ee qmljs: fix race condition in defaultVContext
defaultVContext did call defaultProjectInfo which could
be called only from the ui thread (as it did check the current
project)
Now update the defaultProjectInfo via signals, and lock on access
making defaultProjectInfo threadsafe.

Task-number: QTCREATORBUG-12556
Change-Id: Ibffeb59bbcef7120f08766160bb1e2ddc9af2922
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-06-30 15:25:43 +02:00
hjk
2cd9a97510 Utils: Remove function wrapper
This was an intentional, time-limited workaround that has
served its purpose now that we require C++11.

Change-Id: I96ece9c21bd405d281fd381bd9b87edc00c5ee84
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-06-30 10:44:07 +02:00
Thomas Hartmann
2aa7df6dff QmlJS: Move ensuredGetDocumentForPath to ModelManagerInterface
The new function does properly update the latest snapshot.

Change-Id: If3148701e2f98c39a0822d1395b43f4fa7ee1949
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-06-26 17:49:28 +02:00
Fawzi Mohamed
d17157f83a qmljs: fix qml scan sequence and progress
Change-Id: I8aafb23f1708400936507ab75e4c2893906f9aff
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-06-24 16:25:02 +02:00
Fawzi Mohamed
4ae01e973a qmljs/qmljsdescribevalue: try to use context to resolve prototypes
Change-Id: I0e8529dc339e995be1817b2f3d18ca9bc2c80738
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-06-23 11:37:11 +02:00
Fawzi Mohamed
ba282d23c7 qmlj/qmljsdescribevalue: fix dump of ASTObjectValues
Change-Id: I35713ca8ff54030cf062c31802af703ee2e7c468
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-06-02 18:14:23 +02:00
Fawzi Mohamed
149642d600 qmljs/qmljsmodelmanager: fix spacing
Change-Id: Ifa456173089d9220327d18bcaba85885c3e708d9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-06-02 16:48:14 +02:00
Nikolai Kosjar
41aa2cb3bd C++: Use Token::utf16chars{Begin,End} where appropriate
...especially in CppTools/CppEditor where the offsets are used with a
QString/QTextDocument.

Change-Id: Ic6d18fbc01fb9cc899a9bd2d7424cd2edae487f1
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:51 +02:00
Fawzi Mohamed
21dd82ed23 qmljs: codestyle fixes
Change-Id: I1b5a597d92e865d2235b15c62e3bbae362e5b7c0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:04:13 +02:00
Fawzi Mohamed
1d961d4ea4 qmljs: adding dumper for value types
Change-Id: I3ae420ea29ed32b08f95f388b0ced5b5293219da
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:03:43 +02:00
Fawzi Mohamed
35128701cd qmljs: exposing a bit more the existence of private value types
Change-Id: I85e29b0d60234407561ecbeb2883d68c1acb71d6
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:03:18 +02:00
Fawzi Mohamed
a1e4efe2e3 qmljs: adding missing Qt attributes/functions
Change-Id: I2dbe6fdaf5850e5ea10efb5330b1a32c73945f3a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 10:56:42 +02:00
Fawzi Mohamed
a4cb022fa3 qmljs: fixing font type name
Change-Id: I3c6d827868a4e36eeedeac25887be64a7969c620
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 10:08:37 +02:00
Orgad Shaneh
7f924976e0 QmlJS: Cleanup whitespace
Change-Id: Ifd6ec2a2aa33e1adca5afa8f41c4b4619ed017b5
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-05-22 04:54:54 +02:00
Thiago Macieira
d79b47a6b8 Fix warnings in release mode (unused variables)
qmljsimportdependencies.cpp:937:18: warning: variable ‘found’ set but not used [-Wunused-but-set-variable]
findtoolbar.cpp:665:18: warning: unused variable ‘w’ [-Wunused-variable]

Change-Id: I75930fa6f5a7cbb91d9c39e6808f8c3ce913327e
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-20 20:52:09 +02:00
Orgad Shaneh
a77e75c36e QmlJS: Fix wrong conditions
Change-Id: I31740bca2b17e635c28af70779334f2b52ddb709
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-05-19 19:17:39 +02:00
Eike Ziller
6d1cc58697 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	src/plugins/clangcodemodel/test/clangcompletion_test.cpp
	src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
	src/plugins/projectexplorer/projectexplorer.pro
	src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
	src/plugins/vcsbase/vcsplugin.cpp
	src/shared/qbs

Change-Id: I9e5882be79ac5e8c7dfab4a57f16509d7569636a
2014-05-16 16:54:50 +02:00
Nikolai Kosjar
126e69137a C++: Clarify units of a Token
This will avoid confusion when later more length and indices methods are
added.

In Token:
    length() --> bytes()
    begin() --> bytesBegin()
    end() --> bytesEnd()

Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-15 15:55:38 +02:00
Fawzi Mohamed
a17c231b07 qmljs: correct slot name for properties starting with “_”
Task-number: QTCREATORBUG-12214
Change-Id: Ie8009846ce27d4acbc3e9ad4dd7dda73fde39413
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-15 11:10:07 +02:00
Fawzi Mohamed
58489e50a8 qmljs: better defaults, more uniform handling of paths
Uniform handling of the different qml dialects.

Now paths for a given document prefer the project of that document.

For Qt the following sequence is used:
- Qt of the project of the document
- Qt of the active target
- Qt used to run creator

Currently all paths of the open projects are still merged, but that
can be changed.

Change-Id: Id302c13c893b66fbfe24e301602fe69de152eed4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-09 17:13:05 +02:00
Fawzi Mohamed
329b1535c8 Revert "qmljs: better defaults, more uniform handling of paths"
moving to master

This reverts commit 0c46692244def9edb89c2914b9b1e5eff10cb6ce

Change-Id: Ie09f6db02058f4a5539221f1a0cc4f9225f38300
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-07 12:36:38 +02:00
Fawzi Mohamed
307526da40 Revert "qmljs: fix compilation for Qt4"
moving original patch to master

This reverts commit c5b6e6ae1c60cb5692deef0db4c3dfbcf0859a1d

Change-Id: I84153a3aaf3ab5ca670ed62aa62babce5bbd51e9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-07 12:35:46 +02:00
Fawzi Mohamed
e3b3e21eda qmljs: fix compilation for Qt4
Change-Id: Idb3ad6962e74dd7a34f108c6e3c3810d843a3f3a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-05-07 08:44:39 +02:00
Fawzi Mohamed
8b8c5e8fe8 qmljs: ensure that opening an editor always updates the modelmanager
Change-Id: Ia23d9c84240bd2c54b0c331494474d0fa74674e8
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-06 14:31:15 +02:00
Fawzi Mohamed
08163f3b9a qmljs: better defaults, more uniform handling of paths
Uniform handling of the different qml dialects.

Now paths for a given document prefer the project of that document.

For Qt the following sequence is used:
- Qt of the project of the document
- Qt of the active target
- Qt used to run creator

Currently all paths of the open projects are still merged, but that
can be changed.

Change-Id: Iacf28d63184c05e2bcdfe0210ec472d2bf140d66
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-06 14:28:40 +02:00