Details
-
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)
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 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
* 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 ()`)
- Function calls
- Property Accessors
-
-
- inclusive ArgumentLists, passed to the calls (https://codereview.qt-project.org/c/qt/qtdeclarative/+/479913)
- Template Literal
- Super property
- Meta Property (new.target support)
-
- 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
* 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
* Method Definitions (not needed now)
* Generator Function Definitions
* Class Definitions (not needed now)
Attachments
Issue Links
- 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)
- In Progress
- 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