Debian Codegraph @

runtime/queries/qml/textobjects.scm

raw symbols SCIP
1 ; (comment) is used for both // and /* ... */ comment syntax
2 (comment) @comment.inside
3 (comment)+ @comment.around
4
5 (ui_object_definition
6 initializer: (_) @class.inside) @class.around
7
8 (ui_binding
9 name: (identifier) @parameter.inside) @parameter.around
10
11 (ui_property
12 (_)+ @parameter.inside ":") @parameter.around
13
14 (function_declaration
15 body: (_) @function.inside) @function.around
16
17 (arrow_function
18 body: (_) @function.inside) @function.around
19
20 ; e.g. `onClicked: console.log("Button clicked!")`
21 ((ui_binding
22 name: (identifier) @_name
23 value: (_) @function.around @function.inside)
24 (#match? @_name "^on[A-Z].*"))
25
26 ; e.g.
27 ; Component.onCompleted: {
28 ; console.log("completed")
29 ; }
30 (statement_block (expression_statement)* @function.inside) @function.around
31
32 ; e.g.
33 ; states: [
34 ; State { name: "activated" },
35 ; State { name: "deactivated" }
36 ; ]
37 (ui_object_array
38 ((_) @entry.inside . ","? @entry.around) @entry.around)
39
40 ; e.g. [1, 2, 3, 4]
41 (array
42 ((_) @entry.inside . ","? @entry.around) @entry.around)
43
44 ; Tests in QML are written using "Qt Quick Test" and it's `TestCase` type
45 ; ref: https://doc.qt.io/qt-6/qtquicktest-index.html
46 ((ui_object_definition
47 type_name: (identifier) @_name
48 initializer: (_) @test.inside) @test.around
49 (#eq? @_name "TestCase"))