Commit Graph

108 Commits

Author SHA1 Message Date
Christian Kamm
042ee8de01 QmlJS: Don't warn on 'numbervalue == 0'.
Reviewed-by: Roberto Raggi
2010-11-29 11:20:45 +01:00
Christian Kamm
055aa15fcc QmlJS: Remove overzealous 'undefined' check for enums.
The "value might be 'undefined'" warning triggered whenever the static
expression evaluator failed to produce a value. At the moment, it does
so for almost all non-trivial expressions.

The warning is now disabled.

Task-number: QTCREATORBUG-3208
2010-11-29 09:01:40 +01:00
Christian Kamm
f40b3c22f4 QmlJS: Add JSLint-style warnings for common JS traps.
Task-number: QTCREATORBUG-3071
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:45 +01:00
Christian Kamm
124358d258 QmlJS: Enhance check pass to do lookup... and disable it.
It still generates too many false-negatives for now. Will be enabled
once the remaining lookup failures have been fixed.

Reviewed-by: Erik Verbruggen
2010-11-25 15:06:45 +01:00
Christian Kamm
b548ab16c8 QmlJS: Mark invalid urls and files in url properties as an error.
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:44 +01:00
Christian Kamm
3f505e9982 QmlJS: Add initial 'Find Usages' support. 2010-09-24 14:11:06 +02:00
Christian Kamm
c7b3e3c81c QmlJS: Speed up Link significantly, provide more info on imports.
Link now caches imports. That means importing the same library (say, Qt)
from more than one file no longer creates an importing namespace for
each one. Instead, a single one is created for the instance of Link.

To make this work, the type environment in ScopeChain has been given its
own type: Interpreter::TypeEnvironment. That has the added benefit of
being able to carry meta-information about imports. You can use
TypeEnvironment::importInfo(qmlComponentName) to get information about
the import node that caused the import of the component.
2010-09-16 15:51:21 +02:00
Christian Kamm
f3f3b96c85 QmlJS: Improve performance by avoiding two links in SemanticHighlighter.
Reviewed-by: Roberto Raggi
2010-08-31 10:39:07 +02:00
Christian Kamm
32bb7bffc0 QmlJS: Add missing null checks before using scopeChain().qmlTypes. 2010-08-30 13:35:35 +02:00
Christian Kamm
87e04df257 QmlJS: Refactor LookupContext creation for speed.
* If possible, create LookupContexts through SemanticInfo; it caches the
  linked Context and will be faster.
* Contexts now own their Engine.

Reviewed-by: Lasse Holmstedt
2010-08-26 11:34:29 +02:00
Leandro Melo
e8ac7ead06 Make QML color validation code reusable.
Reviewed-by: ckamm
2010-08-02 14:56:55 +02:00
Christian Kamm
50cc55af80 QmlJS: Change to a nicer way of marking strings for translation.
Reviewed-by: ossi
2010-05-19 13:32:11 +02:00
Christian Kamm
fadfe9c64e QmlJS: Generalize EasingCurve name check to all enums.
Reviewed-by: Erik Verbruggen
2010-05-19 12:24:32 +02:00
Christian Kamm
b7b50edad5 QmlJS: Allow numbers to be assigned to easing.type.
Task-number: QTCREATORBUG-1439
2010-05-19 11:21:01 +02:00
Christian Kamm
bbf5bf611c QmlJS: Change way to translate strings to nicer one.
Done-with: Erik Verbruggen
2010-04-28 10:32:45 +02:00
Christian Kamm
3286f48504 QmlJS: Remove Link::scopeChainAt, initialize scope chain in constructor.
Use ScopeBuilder.push(...) for the same functionality.

Reviewed-by: Erik Verbruggen
2010-04-22 16:36:43 +02:00
Christian Kamm
db2f91ef8f QmlJS: Don't produce Qml type errors if plugins are imported.
Task-number: QTCREATORBUG-1021
Reviewed-by: Erik Verbruggen
2010-04-07 11:09:27 +02:00
Erik Verbruggen
491bf79d5f Changed QML reading in QML designer to use the interpreter for property types. 2010-04-06 11:46:36 +02:00
Christian Kamm
285e2ffbb2 QmlJS: Only collect linker errors for the current file being checked.
Avoids bug where import errors would show up in all files.

Reviewed-by: Roberto Raggi
2010-03-29 11:33:25 +02:00
Christian Kamm
dab558d4fe Add errors for incorrect imports in Qml.
Task-number: QTCREATORBUG-874
Reviewed-by: Erik Verbruggen
2010-03-25 14:55:44 +01:00
Christian Kamm
9ea01cf5fb Improve Qml code model import handling.
* Fill the snapshot with files that could be imported.
* Implement package imports.

* The qmldir file is not parsed yet.

Reviewed-by: Erik Verbruggen
2010-03-18 11:25:37 +01:00
hjk
9595504bda Long live the king! 2010-03-05 11:28:13 +01:00
Erik Verbruggen
9539a8dcb0 Changed error to warning when using a string literal for an ID. 2010-03-04 16:41:08 +01:00
ck
7058367556 Silence silly gcc warning.
Reviewed-by: Erik Verbruggen
2010-03-02 11:00:14 +01:00
Erik Verbruggen
3b2c2c2253 Changed color name checks to use new QColor::isValidColor method. 2010-03-02 10:37:04 +01:00
Erik Verbruggen
13d7612f09 Removed private header dependencies and introduced loading QML types from XML file. 2010-03-01 13:13:02 +01:00
Kai Koehne
318fee6f5c QmlJS: Fix compilation with latest changes of QDeclarative
All files have been renamed from Qml to QDeclarative
2010-02-26 14:43:39 +01:00
Erik Verbruggen
8fbf0dd08f Fixed possible crash when error recovery yielded a partially correct AST. 2010-02-24 17:14:51 +01:00
Christian Kamm
f0674aa7e9 Add check for anchor line, changed value assignment checks into visitor.
Done-with: Erik Verbruggen
2010-02-23 17:03:05 +01:00
Christian Kamm
feacbf8a2a Check that the id property is a plain lowercase identifier. 2010-02-23 14:57:19 +01:00
Christian Kamm
0e2685332c Add check for correct color string in Qml. 2010-02-23 14:57:19 +01:00
Christian Kamm
f717a7df30 Add Qml type checks for assigning literals to properties.
Done-with: Erik Verbruggen
2010-02-23 12:36:48 +01:00
Christian Kamm
e9039db984 Move the scope building logic into QmlJS::ScopeBuilder. 2010-02-22 10:22:23 +01:00
Christian Kamm
08cfc8f28c Pass in the whole AST path for scope creation.
Just the declaring member isn't enough.
2010-02-22 10:22:23 +01:00
Christian Kamm
c289897351 Make QmlJS scope building more flexible.
Instead of only maintaining a flat list of scopes, actually store the
global, component chain, root object, scope object, function, id and js
scopes separately.
2010-02-22 10:22:23 +01:00
Erik Verbruggen
78b3145477 Semantic checking for easing curve names.
Done-with: Christian Kamm
2010-02-19 15:11:03 +01:00
Erik Verbruggen
b17fc90310 Made the warnings/errors translatable. 2010-02-19 15:11:03 +01:00
Erik Verbruggen
7ee1bc5242 Suppress 'unknown property' warning after finding an unknown type.
And made the warnings/errors translatable.
2010-02-19 15:11:03 +01:00
Christian Kamm
2440bfc5dc Don't try to look up members of attached properties. 2010-02-18 15:01:26 +01:00
Christian Kamm
2ce1592a14 Error when binding to nonexistant member of property in Qml.
This now errors for:
anchors.undefinedAnchor: foo
x.undefinedAnchor
2010-02-18 14:24:24 +01:00
Christian Kamm
4d5e1a9a0c Fix possible crash in QmlJS semantic checker. 2010-02-18 10:42:15 +01:00
Christian Kamm
499f7780e4 Fix possible crash in QmlJS semantic checker. 2010-02-18 10:39:18 +01:00
Christian Kamm
3035733415 Workaround for not erroring on anchors { ... } in Qml for now. 2010-02-17 09:29:13 +01:00
Christian Kamm
a0431f0563 Don't error for unknown property names inside ListElement for now. 2010-02-17 09:01:39 +01:00
Christian Kamm
45efd5b5b1 Don't show 'invalid property name' errors if we can't resolve the type.
The idea is that it may be a plugin-provided type. We don't want user
code to be riddled with error markers in that case.

Reviewed-by: Roberto Raggi
2010-02-16 13:30:40 +01:00
Christian Kamm
e6d9d9e387 Fix incorrect 'invalid property' errors for PropertyChanges.
Reviewed-by: Roberto Raggi
2010-02-16 11:55:41 +01:00
Christian Kamm
da3679066e Add QmlJS semantic checker.
* Add SemanticHighlighter to QmlJSTextEditor to update the semantic info
  in a background thread.
* Add QmlJS::Check to run semantic checks on qml and js documents.
* Add a check for incorrect property names.
* Fix hoverhandler to show tool tips from extra selections over help
  tooltips.
2010-02-16 10:38:56 +01:00
Christian Kamm
b23fc0c572 Rename QmlJS::Check -> QmlJS::Evaluate.
It is used to evaluate expressions to values.
Done to make room for a real 'check' pass.
2010-02-15 11:52:39 +01:00
Christian Kamm
9245c7bab5 Removed unnecessary includes of qmljslink.h 2010-02-12 10:10:20 +01:00
Roberto Raggi
967ed09c29 Initial support of `Follow symbol under cursor' for QML/JS. 2010-02-09 11:37:58 +01:00