-
Task
-
Resolution: Fixed
-
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)
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 implement support (or at least add tests) for ![]()
- find usages
- go to definition
- go to type definition
- completions
- rename usage
on the newly introduced dom representations!
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
* Identifier
QTBUG-113208
* Literal
* NullLiteral
* BooleanLiteral
* NumericLiteral
QTBUG-113208
* StringLiteral
QTBUG-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

- this is being parsed as AST::FormalParameterList
- 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 ()`)

- Function calls

- Property Accessors
-
-
- inclusive ArgumentLists, passed to the calls
(https://codereview.qt-project.org/c/qt/qtdeclarative/+/479913)
- inclusive ArgumentLists, passed to the calls
- Template Literal

- Super property

- Meta Property (new.target support)

-
- UpdateExpressions (https://262.ecma-international.org/7.0/#sec-update-expressions)
- pre/post increment/decrements

- pre/post increment/decrements
- Unary Operators (https://262.ecma-international.org/7.0/#sec-unary-operators)
- delete/void/typeof/+/-/~/!

- 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 )

- Exponentiation operator (https://262.ecma-international.org/7.0/#sec-exp-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)
* BlockStatement
QTBUG-113208
* VariableStatement
QTBUG-113328
* EmptyStatement
* ExpressionStatement
QTBUG-113208
* IfStatement
QTBUG-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
* ReturnStatement
QTBUG-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
* Method Definitions
(not needed now)
* Generator Function Definitions
* Class Definitions
(not needed now)
- covers
-
QTBUG-127532 Using JS template literals breaks qmlls' auto-completion list
-
- Closed
-
- depends on
-
QTBUG-126676 qml lexer creates function tokens with wrong length
-
- Closed
-
-
QTBUG-98637 Reduce duplication/harmonize Dom with libCompiler
-
- Closed
-
- duplicates
-
QTCREATORBUG-25988 "Find References to Symbol Under Cursor" on QML signals
-
- Closed
-
- is required for
-
QTBUG-92874 support the LSP protocol as server
-
- Closed
-
-
QTBUG-100084 LSP: find usages in qml
-
- Closed
-
-
QTBUG-111410
qmlls: scriptexpression support for go-to type definition
-
- Closed
-
-
QTBUG-111415
qmlls: find JS-stuff usages
-
- Closed
-
-
QTBUG-113727 qmlls: improve Code completion using new QQmlLSUtils stuff
-
- Closed
-
-
QTBUG-119798
qmlls: completions in JS expressions
-
- Closed
-
- relates to
-
QTBUG-119964
New QML LSP features (6.8)
-
- Closed
-
- split from
-
QTBUG-100084 LSP: find usages in qml
-
- Closed
-
-
QTBUG-113727 qmlls: improve Code completion using new QQmlLSUtils stuff
-
- Closed
-
-
QTBUG-119798
qmlls: completions in JS expressions
-
- Closed
-
| For Gerrit Dashboard: QTBUG-92876 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 464035,11 | WIP: integrate scriptexpressions inside the DOM | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
| 470761,27 | Dom: Introduce scriptelements in the DOM representation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 470935,5 | Dom: add overload helper to create visitors | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 470936,8 | Dom: add QQmlJSScope to QmlObject | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 471116,5 | Use X-Macro for AST-visitor declaration | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 471117,8 | QQmlDomAstCreator: split into header and implementation and rename | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 474745,3 | QQmlDomAstCreator: Rename StackEl to QmlStackElement | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 474791,4 | tst_qmldomitem:domContructionTime for scriptexpression | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 475804,16 | qmlls: find usages of id's and properties | dev | qt/qtdeclarative | Status: MERGED | -1 | 0 |
| 475919,16 | QmlDom: implement the FieldMemberExpression | dev | qt/qtdeclarative | Status: MERGED | -1 | 0 |
| 476093,9 | QmlDom: support id-bindings | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 476432,12 | QmlDom: Add GenericScriptElement and CallExpression | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 477294,9 | WIP: QmlDom: Handle all kind of arguments to calls | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
| 479913,11 | QmlDom: support function parameters and co | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 480607,3 | AST list classes: fix visitation | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
| 480658,6 | qmldom: Add dom representations for iteration statement | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 481423,6 | qmldom: Add switch statement dom representation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 523366,6 | qmlls: completions for comma expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 523367,7 | qmlls: support completions in conditional expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 523377,9 | dom: add representation for unary expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 525822,6 | qmlls: adapt parser for attached/grouped properties completion | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 527234,13 | qmlls: support nested expressions in completion | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 527914,2 | qmlls: adapt parser for attached/grouped properties completion | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 531086,4 | qmlls: support nested expressions in completion | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 557219,3 | dom: add support for lambdas | dev | qt/qtdeclarative | Status: ABANDONED | 0 | +1 |
| 564674,8 | dom: add dom representation for lambdas | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 564675,14 | adapt qmllsutils to the newly introduced lambdas | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 565909,10 | dom: add dom representation for template literals | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 565910,10 | dom: add representation for regexp literals | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568806,7 | adapt qqmllsutils to templateliterals | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568807,8 | Disable completion inside of regexpliterals | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568808,9 | dom: add representation for new + new member expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568809,9 | qmlls: implement completion for new and new member expressions | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568810,9 | dom: add representation for super and this literals | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 568811,9 | dom: add test for metaproperty (new.target) | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 570366,3 | qmlls: fix resolveTypeExpression for JS object member accesses | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 571480,2 | dom: add dom representation for lambdas | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | -1 |
| 578856,3 | qmlls: fix resolveTypeExpression for JS object member accesses | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 578857,3 | adapt qmllsutils to the newly introduced lambdas | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 578858,3 | dom: add dom representation for template literals | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 578859,3 | adapt qqmllsutils to templateliterals | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 578860,3 | dom: add representation for regexp literals | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 578861,3 | Disable completion inside of regexpliterals | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | +1 |
| 582459,2 | dom: add representation for new + new member expressions | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 582460,2 | qmlls: implement completion for new and new member expressions | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 582481,2 | dom: add representation for super and this literals | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 582482,2 | dom: add test for metaproperty (new.target) | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |