Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
89b096041 (dev), be92908ac (dev), 1c566c512 (dev), fba9a80d4 (dev), a9e821d6a (dev), 4a1559862 (dev), 447fbe918 (dev), 091191853 (dev), af6234be9 (dev), 087a988ef (dev), ed131e936 (dev), 81f3dca10 (dev), 83f3213ba (dev), c98719b8c (dev), 70977b0d1 (dev)
Description
QmlJSScope supports js scopes and usages, it should be cleanly integrated in the Dom, to give access to declarations and usages in QML code. As QQmlJSScope itself is not enough to implement all the LSP-features, model JS statements and expressions in the DOM to complement its information.
For example, implementing findUsages in qmlls cannot be done only with QQmlJSScope's, as the semantic scopes contain the definitions of JS identifiers but not their usages in the code. Also, the current JS-reformatting works directly on the AST-classes used by the Parser and the DOM for JS statements/expressions might leave a door open to move the reformatting implementation inside the DOM JS classes for later...
Also, model the JS-stuff in the DOM with their own classes etc.
For FF of 6.6, try first to implement the Dom elements such that the Dom can be constructed (leaving out some information that are not needed for qmlls's find usages feature).
Mostly, all of the JS support for classes can be left out for now, assuming that most of the users are using QML objects instead.
List of statements/expressions to model in the DOM:
done
to be done
do not do
in progress
- PrimaryExpressions (https://262.ecma-international.org/7.0/#sec-primary-expression)
* this
* IdentifierQTBUG-113208
* Literal
* NullLiteral
* BooleanLiteral
* NumericLiteralQTBUG-113208
* StringLiteralQTBUG-113208
* ArrayLiteral (https://codereview.qt-project.org/c/qt/qtdeclarative/+/479913)
* ObjectLiteral (https://codereview.qt-project.org/c/qt/qtdeclarative/+/479913)
* FunctionExpression
* ClassExpression (not needed for now)
* GeneratorExpression
* RegularExpressionLiteral
* TemplateLiteral
* CoverParenthesizedExpressionAndArrowParameterList- this is being parsed as AST::FormalParameterList or
- AST::NestedExpression for expressions inside of `()` brackets
- Left-Hand-Side expressions (https://262.ecma-international.org/7.0/#sec-left-hand-side-expressions)
- Property Accessors
- Bracket expressions (`id[something]`)
QTBUG-113381 - Field Member access (`id.field`)
QTBUG-113381
- Bracket expressions (`id[something]`)
- New expressions (`new Something ()`) (not needed for now)
- Function calls
- Property Accessors
-
-
- inclusive ArgumentLists, passed to the calls (https://codereview.qt-project.org/c/qt/qtdeclarative/+/479913)
- Template Literal
- Super property (not needed for now)
- Meta Property (new.target support) (not needed for now)
-
- UpdateExpressions (https://262.ecma-international.org/7.0/#sec-update-expressions)
- pre/post increment/decrements
- Unary Operators (https://262.ecma-international.org/7.0/#sec-unary-operators)
- delete/void/typeof/+/-/~/!
- BinaryExpressions:
-
- Exponentiation operator (https://262.ecma-international.org/7.0/#sec-exp-operator )
- Multiplicative operators (https://262.ecma-international.org/7.0/#sec-multiplicative-operators )
- Additive Operators (https://262.ecma-international.org/7.0/#sec-additive-operators )
- Bitwise Shifts (https://262.ecma-international.org/7.0/#sec-bitwise-shift-operators )
- Relational operators (https://262.ecma-international.org/7.0/#sec-relational-operators )
- Equality Operators ( https://262.ecma-international.org/7.0/#sec-equality-operators )
- Binary bitwise operators (https://262.ecma-international.org/7.0/#sec-binary-bitwise-operators )
- Binary logical operators (https://262.ecma-international.org/7.0/#sec-binary-logical-operators )
- Assignment Operators (https://262.ecma-international.org/7.0/#sec-assignment-operators )
- Comma operators (https://262.ecma-international.org/7.0/#sec-comma-operator )
-
-
- note: this is being parsed as an "AST::Expression"!!!
-
- Conditional operator (https://262.ecma-international.org/7.0/#sec-conditional-operator )
- Statements and Declarations (https://262.ecma-international.org/7.0/#sec-ecmascript-language-statements-and-declarations)
* BlockStatementQTBUG-113208
* VariableStatementQTBUG-113328
* EmptyStatement (does not do anything but needs to be supported still)
* ExpressionStatementQTBUG-113208
* IfStatementQTBUG-113208
* BreakableStatement https://bugreports.qt.io/browse/QTBUG-113334
* SwitchStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/481423
* IterationStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/480658
* For-loops (to be split further in foreach, for, ....)
* Do-while loops
* while loops
* ContinueStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/522977/4
* BreakStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/522977/4
* ReturnStatementQTBUG-113208
* WithStatement
* LabelledStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/522979/5
* ThrowStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/522572/5
* TryStatement done in https://codereview.qt-project.org/c/qt/qtdeclarative/+/520284/5
* DebuggerStatement - Functions and Classes (https://262.ecma-international.org/7.0/#sec-ecmascript-language-functions-and-classes)
* Function Definitions
* Arrow Function Definitions (to be tested at least)
* Method Definitions (not needed now)
* Generator Function Definitions (to be tested at least)
* Class Definitions (not needed now)
Attachments
Issue Links
- depends on
-
QTBUG-98637 Reduce duplication/harmonize Dom with libCompiler
- Closed
- is required for
-
QTBUG-100084 LSP: find usages in qml
- In Progress
-
QTBUG-113727 qmlls: improve Code completion using new QQmlLSUtils stuff
- In Progress
-
QTBUG-119798 qmlls: completions in JS expressions
- In Progress
-
QTBUG-92874 support the LSP protocol as server
- Closed
-
QTBUG-111410 qmlls: scriptexpression support for go-to type definition
- Closed
-
QTBUG-111415 qmlls: find JS-stuff usages
- Closed
- relates to
-
QTBUG-119964 New QML LSP features (6.8)
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-92876 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
557219,1 | WIP: dom: support lambdas | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |