diff --git a/packages/app-web-docs/src/docs/user/languages/fixtures/java.json b/packages/app-web-docs/src/docs/user/languages/fixtures/java.json
index 44f1422b22..1906c13af3 100644
--- a/packages/app-web-docs/src/docs/user/languages/fixtures/java.json
+++ b/packages/app-web-docs/src/docs/user/languages/fixtures/java.json
@@ -1203,6 +1203,40 @@
}
]
},
+ {
+ "name": "scopes/java/class3",
+ "languageId": "java",
+ "facet": "class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:15",
+ "removal": "0:0-0:15"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/class4",
+ "languageId": "java",
+ "facet": "class",
+ "code": "@bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:15",
+ "removal": "0:0-1:15"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/java/collectionItem.unenclosed.iteration",
"languageId": "java",
@@ -2850,6 +2884,40 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.class3",
+ "languageId": "java",
+ "facet": "name.class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/name/name.class4",
+ "languageId": "java",
+ "facet": "name.class",
+ "code": "@Bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:7-1:10",
+ "removal": "1:7-1:10"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.constant",
"languageId": "java",
@@ -2919,6 +2987,32 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.constructor3",
+ "languageId": "java",
+ "facet": "name.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:7",
+ "removal": "1:4-1:8"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.enum",
"languageId": "java",
@@ -2980,6 +3074,32 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.field.class2",
+ "languageId": "java",
+ "facet": "name.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:15-1:18",
+ "removal": "1:4-1:21"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.field.enum",
"languageId": "java",
@@ -3446,6 +3566,23 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.constructor3",
+ "languageId": "java",
+ "facet": "namedFunction.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:4-1:10",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/namedFunction.iteration.class",
"languageId": "java",
@@ -3462,6 +3599,22 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.iteration.class2",
+ "languageId": "java",
+ "facet": "namedFunction.iteration.class",
+ "code": "record Foo() { }",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:14-0:15"
+ }
+ ],
+ "domain": "0:14-0:15"
+ }
+ ]
+ },
{
"name": "scopes/java/namedFunction.method",
"languageId": "java",
@@ -3496,6 +3649,23 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.method3",
+ "languageId": "java",
+ "facet": "namedFunction.method",
+ "code": "record Foo() {\n void bar() {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:4-1:17",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:17"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.assignment.compound",
"languageId": "java",
@@ -3659,6 +3829,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.constructor3",
+ "languageId": "java",
+ "facet": "statement.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:10",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.continue",
"languageId": "java",
@@ -3754,6 +3950,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.field.class2",
+ "languageId": "java",
+ "facet": "statement.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:23",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.field.interface",
"languageId": "java",
@@ -4067,6 +4289,30 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.iteration.class3",
+ "languageId": "java",
+ "facet": "statement.iteration.class",
+ "code": "record Foo(int aaa) { }",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:23"
+ }
+ ],
+ "domain": "0:0-0:23"
+ },
+ {
+ "targets": [
+ {
+ "content": "0:21-0:22"
+ }
+ ],
+ "domain": "0:21-0:22"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.iteration.document",
"languageId": "java",
@@ -4185,6 +4431,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.method3",
+ "languageId": "java",
+ "facet": "statement.method",
+ "code": "record Foo() {\n void bar() {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:17",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:17"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.misc",
"languageId": "java",
@@ -4831,6 +5103,57 @@
}
]
},
+ {
+ "name": "scopes/java/type/type.class2",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "@bar\npublic class Foo {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:19",
+ "removal": "0:0-1:19"
+ }
+ ],
+ "domain": "0:0-1:19"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/type/type.class3",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:15",
+ "removal": "0:0-0:15"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/type/type.class4",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "@bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:15",
+ "removal": "0:0-1:15"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/java/type/type.constant",
"languageId": "java",
@@ -4900,6 +5223,32 @@
}
]
},
+ {
+ "name": "scopes/java/type/type.field.class2",
+ "languageId": "java",
+ "facet": "type.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:11-1:14",
+ "removal": "1:11-1:15"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/type/type.field.interface",
"languageId": "java",
@@ -5389,6 +5738,23 @@
}
]
},
+ {
+ "name": "scopes/java/value/value.field.class2",
+ "languageId": "java",
+ "facet": "value.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:21-1:22",
+ "removal": "1:18-1:22"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/value/value.field.interface",
"languageId": "java",
diff --git a/packages/app-web-docs/src/docs/user/languages/java.mdx b/packages/app-web-docs/src/docs/user/languages/java.mdx
index 76af343397..895a4ccee7 100644
--- a/packages/app-web-docs/src/docs/user/languages/java.mdx
+++ b/packages/app-web-docs/src/docs/user/languages/java.mdx
@@ -357,6 +357,10 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
+
+
#### 2. Class (iteration class)
Iteration scope for classes: class bodies.
@@ -705,6 +709,10 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
+
+
#### 8. Name: Constant
Name (LHS) of a constant declaration
@@ -719,6 +727,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 10. Name: Enum
Name of an enum declaration
@@ -731,6 +741,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 12. Name: Field enum
Name (LHS) of a field declaration in an enum
@@ -851,6 +863,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 2. Named function: Method
A method declaration
@@ -859,12 +873,16 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 3. Named function (iteration class)
Iteration scope for named functions: class bodies.
+
+
### Statement
#### 1. Statement: Assignment
@@ -907,6 +925,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 7. Statement: Continue
A continue statement
@@ -931,6 +951,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 11. Statement: Field interface
A field declaration in an interface
@@ -983,6 +1005,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 19. Statement: Method interface
A method declaration in an interface
@@ -1089,6 +1113,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 35. Statement (iteration document)
Iteration scope for statements: the entire document including leading and trailing empty lines.
@@ -1139,6 +1165,12 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
+
+
+
+
#### 7. Type: Constant
Type of a constant declaration
@@ -1157,6 +1189,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 10. Type: Field interface
Type of a field declaration in an interface
@@ -1289,6 +1323,8 @@ Below are visualizations of all our scope tests for this language. These were cr
+
+
#### 5. Value: Field interface
Value (RHS) of a field declaration in an interface
diff --git a/packages/app-web-docs/src/docs/user/scopes/class.mdx b/packages/app-web-docs/src/docs/user/scopes/class.mdx
index 2f889edb29..ff74cb5a05 100644
--- a/packages/app-web-docs/src/docs/user/scopes/class.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/class.mdx
@@ -67,6 +67,10 @@ Default: `class`
+
+
+
+
##### JavaScript
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/class.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/class.json
index 914335f92c..a25d6d31cf 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/class.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/class.json
@@ -331,6 +331,40 @@
}
]
},
+ {
+ "name": "scopes/java/class3",
+ "languageId": "java",
+ "facet": "class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:15",
+ "removal": "0:0-0:15"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/class4",
+ "languageId": "java",
+ "facet": "class",
+ "code": "@bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:15",
+ "removal": "0:0-1:15"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/javascript.core/class.iteration.document",
"languageId": "javascript.core",
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json
index e4038d9e6c..60af9cf303 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/name.json
@@ -4203,6 +4203,40 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.class3",
+ "languageId": "java",
+ "facet": "name.class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/name/name.class4",
+ "languageId": "java",
+ "facet": "name.class",
+ "code": "@Bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:7-1:10",
+ "removal": "1:7-1:10"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.constant",
"languageId": "java",
@@ -4272,6 +4306,32 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.constructor3",
+ "languageId": "java",
+ "facet": "name.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:7",
+ "removal": "1:4-1:8"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.enum",
"languageId": "java",
@@ -4333,6 +4393,32 @@
}
]
},
+ {
+ "name": "scopes/java/name/name.field.class2",
+ "languageId": "java",
+ "facet": "name.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:7-0:10",
+ "removal": "0:7-0:10"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:15-1:18",
+ "removal": "1:4-1:21"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/name/name.field.enum",
"languageId": "java",
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json
index e20c1b706f..a0342cf03c 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/namedFunction.json
@@ -532,6 +532,23 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.constructor3",
+ "languageId": "java",
+ "facet": "namedFunction.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:4-1:10",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/namedFunction.iteration.class",
"languageId": "java",
@@ -548,6 +565,22 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.iteration.class2",
+ "languageId": "java",
+ "facet": "namedFunction.iteration.class",
+ "code": "record Foo() { }",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:14-0:15"
+ }
+ ],
+ "domain": "0:14-0:15"
+ }
+ ]
+ },
{
"name": "scopes/java/namedFunction.method",
"languageId": "java",
@@ -582,6 +615,23 @@
}
]
},
+ {
+ "name": "scopes/java/namedFunction.method3",
+ "languageId": "java",
+ "facet": "namedFunction.method",
+ "code": "record Foo() {\n void bar() {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:4-1:17",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:17"
+ }
+ ]
+ },
{
"name": "scopes/javascript.core/namedFunction/namedFunction.constructor",
"languageId": "javascript.core",
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json
index 2573e483a0..8ffb3574ac 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/statement.json
@@ -3446,6 +3446,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.constructor3",
+ "languageId": "java",
+ "facet": "statement.constructor",
+ "code": "record Foo() {\n Foo {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:10",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:10"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.continue",
"languageId": "java",
@@ -3541,6 +3567,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.field.class2",
+ "languageId": "java",
+ "facet": "statement.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:23",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.field.interface",
"languageId": "java",
@@ -3854,6 +3906,30 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.iteration.class3",
+ "languageId": "java",
+ "facet": "statement.iteration.class",
+ "code": "record Foo(int aaa) { }",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:23"
+ }
+ ],
+ "domain": "0:0-0:23"
+ },
+ {
+ "targets": [
+ {
+ "content": "0:21-0:22"
+ }
+ ],
+ "domain": "0:21-0:22"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.iteration.document",
"languageId": "java",
@@ -3972,6 +4048,32 @@
}
]
},
+ {
+ "name": "scopes/java/statement/statement.method3",
+ "languageId": "java",
+ "facet": "statement.method",
+ "code": "record Foo() {\n void bar() {}\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:4-1:17",
+ "removal": "1:0-2:0"
+ }
+ ],
+ "domain": "1:4-1:17"
+ }
+ ]
+ },
{
"name": "scopes/java/statement/statement.misc",
"languageId": "java",
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/type.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/type.json
index d6fc0be164..016f6d24a5 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/type.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/type.json
@@ -3298,6 +3298,57 @@
}
]
},
+ {
+ "name": "scopes/java/type/type.class2",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "@bar\npublic class Foo {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:19",
+ "removal": "0:0-1:19"
+ }
+ ],
+ "domain": "0:0-1:19"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/type/type.class3",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "record Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-0:15",
+ "removal": "0:0-0:15"
+ }
+ ],
+ "domain": "0:0-0:15"
+ }
+ ]
+ },
+ {
+ "name": "scopes/java/type/type.class4",
+ "languageId": "java",
+ "facet": "type.class",
+ "code": "@bar\nrecord Foo() {}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-1:15",
+ "removal": "0:0-1:15"
+ }
+ ],
+ "domain": "0:0-1:15"
+ }
+ ]
+ },
{
"name": "scopes/java/type/type.constant",
"languageId": "java",
@@ -3367,6 +3418,32 @@
}
]
},
+ {
+ "name": "scopes/java/type/type.field.class2",
+ "languageId": "java",
+ "facet": "type.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "0:0-2:1",
+ "removal": "0:0-2:1"
+ }
+ ],
+ "domain": "0:0-2:1"
+ },
+ {
+ "targets": [
+ {
+ "content": "1:11-1:14",
+ "removal": "1:11-1:15"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/type/type.field.interface",
"languageId": "java",
diff --git a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json
index 2c7cb357b6..c016ad2d23 100644
--- a/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json
+++ b/packages/app-web-docs/src/docs/user/scopes/fixtures/value.json
@@ -2749,6 +2749,23 @@
}
]
},
+ {
+ "name": "scopes/java/value/value.field.class2",
+ "languageId": "java",
+ "facet": "value.field.class",
+ "code": "record Foo() {\n static int bar = 0;\n}",
+ "scopes": [
+ {
+ "targets": [
+ {
+ "content": "1:21-1:22",
+ "removal": "1:18-1:22"
+ }
+ ],
+ "domain": "1:4-1:23"
+ }
+ ]
+ },
{
"name": "scopes/java/value/value.field.interface",
"languageId": "java",
diff --git a/packages/app-web-docs/src/docs/user/scopes/name.mdx b/packages/app-web-docs/src/docs/user/scopes/name.mdx
index 3cb0c52e78..eb9fab5fbe 100644
--- a/packages/app-web-docs/src/docs/user/scopes/name.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/name.mdx
@@ -539,6 +539,10 @@ Default: `name`
+
+
+
+
##### JavaScript
@@ -671,6 +675,8 @@ Default: `name`
+
+
##### JavaScript
@@ -767,6 +773,8 @@ Default: `name`
+
+
##### JavaScript
diff --git a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx
index c524b98ecb..38773029e1 100644
--- a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx
@@ -187,6 +187,8 @@ Default: `funk`
+
+
##### JavaScript
@@ -235,6 +237,8 @@ Default: `funk`
+
+
##### JavaScript
@@ -317,6 +321,8 @@ Default: `funk`
+
+
##### JavaScript
diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx
index 7252f79c8e..6d1af43396 100644
--- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx
@@ -383,6 +383,8 @@ Default: `state`
+
+
##### JavaScript
@@ -567,6 +569,8 @@ Default: `state`
+
+
##### JavaScript
@@ -1101,6 +1105,8 @@ Default: `state`
+
+
##### JavaScript
@@ -2055,6 +2061,8 @@ Default: `state`
+
+
##### JavaScript
diff --git a/packages/app-web-docs/src/docs/user/scopes/type.mdx b/packages/app-web-docs/src/docs/user/scopes/type.mdx
index b726a017ea..ba0e80816f 100644
--- a/packages/app-web-docs/src/docs/user/scopes/type.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/type.mdx
@@ -365,6 +365,12 @@ Default: `type`
+
+
+
+
+
+
##### Kotlin
@@ -529,6 +535,8 @@ Default: `type`
+
+
##### Kotlin
diff --git a/packages/app-web-docs/src/docs/user/scopes/value.mdx b/packages/app-web-docs/src/docs/user/scopes/value.mdx
index 55bf69acac..6c395878ed 100644
--- a/packages/app-web-docs/src/docs/user/scopes/value.mdx
+++ b/packages/app-web-docs/src/docs/user/scopes/value.mdx
@@ -477,6 +477,8 @@ Default: `value`
+
+
##### JavaScript
diff --git a/resources/fixtures/scopes/java/class3.scope b/resources/fixtures/scopes/java/class3.scope
new file mode 100644
index 0000000000..06b6ce96e4
--- /dev/null
+++ b/resources/fixtures/scopes/java/class3.scope
@@ -0,0 +1,10 @@
+record Foo() {}
+---
+
+[Content] =
+[Removal] =
+[Domain] = 0:0-0:15
+ >---------------<
+0| record Foo() {}
+
+[Insertion delimiter] = "\n\n"
diff --git a/resources/fixtures/scopes/java/class4.scope b/resources/fixtures/scopes/java/class4.scope
new file mode 100644
index 0000000000..55adbc8c3f
--- /dev/null
+++ b/resources/fixtures/scopes/java/class4.scope
@@ -0,0 +1,13 @@
+@bar
+record Foo() {}
+---
+
+[Content] =
+[Removal] =
+[Domain] = 0:0-1:15
+ >----
+0| @bar
+1| record Foo() {}
+ ---------------<
+
+[Insertion delimiter] = "\n\n"
diff --git a/resources/fixtures/scopes/java/name/name.class3.scope b/resources/fixtures/scopes/java/name/name.class3.scope
new file mode 100644
index 0000000000..5b0b3294d9
--- /dev/null
+++ b/resources/fixtures/scopes/java/name/name.class3.scope
@@ -0,0 +1,17 @@
+record Foo() {}
+---
+
+[Content] =
+[Removal] = 0:7-0:10
+ >---<
+0| record Foo() {}
+
+[Leading delimiter] = 0:6-0:7
+ >-<
+0| record Foo() {}
+
+[Domain] = 0:0-0:15
+ >---------------<
+0| record Foo() {}
+
+[Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/name/name.class4.scope b/resources/fixtures/scopes/java/name/name.class4.scope
new file mode 100644
index 0000000000..12d224b578
--- /dev/null
+++ b/resources/fixtures/scopes/java/name/name.class4.scope
@@ -0,0 +1,20 @@
+@Bar
+record Foo() {}
+---
+
+[Content] =
+[Removal] = 1:7-1:10
+ >---<
+1| record Foo() {}
+
+[Leading delimiter] = 1:6-1:7
+ >-<
+1| record Foo() {}
+
+[Domain] = 0:0-1:15
+ >----
+0| @Bar
+1| record Foo() {}
+ ---------------<
+
+[Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/name/name.constructor3.scope b/resources/fixtures/scopes/java/name/name.constructor3.scope
new file mode 100644
index 0000000000..8a64a306f9
--- /dev/null
+++ b/resources/fixtures/scopes/java/name/name.constructor3.scope
@@ -0,0 +1,45 @@
+record Foo() {
+ Foo {}
+}
+---
+
+[#1 Content] =
+[#1 Removal] = 0:7-0:10
+ >---<
+0| record Foo() {
+
+[#1 Leading delimiter] = 0:6-0:7
+ >-<
+0| record Foo() {
+
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| Foo {}
+2| }
+ -<
+
+[#1 Insertion delimiter] = " "
+
+
+[#2 Content] = 1:4-1:7
+ >---<
+1| Foo {}
+
+[#2 Removal] = 1:4-1:8
+ >----<
+1| Foo {}
+
+[#2 Leading delimiter] = 1:0-1:4
+ >----<
+1| Foo {}
+
+[#2 Trailing delimiter] = 1:7-1:8
+ >-<
+1| Foo {}
+
+[#2 Domain] = 1:4-1:10
+ >------<
+1| Foo {}
+
+[#2 Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/name/name.field.class2.scope b/resources/fixtures/scopes/java/name/name.field.class2.scope
new file mode 100644
index 0000000000..b1f12a9d0a
--- /dev/null
+++ b/resources/fixtures/scopes/java/name/name.field.class2.scope
@@ -0,0 +1,45 @@
+record Foo() {
+ static int bar = 0;
+}
+---
+
+[#1 Content] =
+[#1 Removal] = 0:7-0:10
+ >---<
+0| record Foo() {
+
+[#1 Leading delimiter] = 0:6-0:7
+ >-<
+0| record Foo() {
+
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| static int bar = 0;
+2| }
+ -<
+
+[#1 Insertion delimiter] = " "
+
+
+[#2 Content] = 1:15-1:18
+ >---<
+1| static int bar = 0;
+
+[#2 Removal] = 1:4-1:21
+ >-----------------<
+1| static int bar = 0;
+
+[#2 Leading delimiter] = 1:14-1:15
+ >-<
+1| static int bar = 0;
+
+[#2 Trailing delimiter] = 1:18-1:19
+ >-<
+1| static int bar = 0;
+
+[#2 Domain] = 1:4-1:23
+ >-------------------<
+1| static int bar = 0;
+
+[#2 Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/namedFunction.constructor3.scope b/resources/fixtures/scopes/java/namedFunction.constructor3.scope
new file mode 100644
index 0000000000..409684faf5
--- /dev/null
+++ b/resources/fixtures/scopes/java/namedFunction.constructor3.scope
@@ -0,0 +1,21 @@
+record Foo() {
+ Foo {}
+}
+---
+
+[Content] =
+[Domain] = 1:4-1:10
+ >------<
+1| Foo {}
+
+[Removal] = 1:0-2:0
+ >----------
+1| Foo {}
+2| }
+ <
+
+[Leading delimiter] = 1:0-1:4
+ >----<
+1| Foo {}
+
+[Insertion delimiter] = "\n\n"
diff --git a/resources/fixtures/scopes/java/namedFunction.iteration.class2.scope b/resources/fixtures/scopes/java/namedFunction.iteration.class2.scope
new file mode 100644
index 0000000000..cd73105195
--- /dev/null
+++ b/resources/fixtures/scopes/java/namedFunction.iteration.class2.scope
@@ -0,0 +1,7 @@
+record Foo() { }
+---
+
+[Content] =
+[Domain] = 0:14-0:15
+ >-<
+0| record Foo() { }
diff --git a/resources/fixtures/scopes/java/namedFunction.method3.scope b/resources/fixtures/scopes/java/namedFunction.method3.scope
new file mode 100644
index 0000000000..128d15c08b
--- /dev/null
+++ b/resources/fixtures/scopes/java/namedFunction.method3.scope
@@ -0,0 +1,21 @@
+record Foo() {
+ void bar() {}
+}
+---
+
+[Content] =
+[Domain] = 1:4-1:17
+ >-------------<
+1| void bar() {}
+
+[Removal] = 1:0-2:0
+ >-----------------
+1| void bar() {}
+2| }
+ <
+
+[Leading delimiter] = 1:0-1:4
+ >----<
+1| void bar() {}
+
+[Insertion delimiter] = "\n\n"
diff --git a/resources/fixtures/scopes/java/statement/statement.constructor3.scope b/resources/fixtures/scopes/java/statement/statement.constructor3.scope
new file mode 100644
index 0000000000..221ab9bcb5
--- /dev/null
+++ b/resources/fixtures/scopes/java/statement/statement.constructor3.scope
@@ -0,0 +1,33 @@
+record Foo() {
+ Foo {}
+}
+---
+
+[#1 Content] =
+[#1 Removal] =
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| Foo {}
+2| }
+ -<
+
+[#1 Insertion delimiter] = "\n"
+
+
+[#2 Content] =
+[#2 Domain] = 1:4-1:10
+ >------<
+1| Foo {}
+
+[#2 Removal] = 1:0-2:0
+ >----------
+1| Foo {}
+2| }
+ <
+
+[#2 Leading delimiter] = 1:0-1:4
+ >----<
+1| Foo {}
+
+[#2 Insertion delimiter] = "\n"
diff --git a/resources/fixtures/scopes/java/statement/statement.field.class2.scope b/resources/fixtures/scopes/java/statement/statement.field.class2.scope
new file mode 100644
index 0000000000..cd06760961
--- /dev/null
+++ b/resources/fixtures/scopes/java/statement/statement.field.class2.scope
@@ -0,0 +1,33 @@
+record Foo() {
+ static int bar = 0;
+}
+---
+
+[#1 Content] =
+[#1 Removal] =
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| static int bar = 0;
+2| }
+ -<
+
+[#1 Insertion delimiter] = "\n"
+
+
+[#2 Content] =
+[#2 Domain] = 1:4-1:23
+ >-------------------<
+1| static int bar = 0;
+
+[#2 Removal] = 1:0-2:0
+ >-----------------------
+1| static int bar = 0;
+2| }
+ <
+
+[#2 Leading delimiter] = 1:0-1:4
+ >----<
+1| static int bar = 0;
+
+[#2 Insertion delimiter] = "\n"
diff --git a/resources/fixtures/scopes/java/statement/statement.iteration.class3.scope b/resources/fixtures/scopes/java/statement/statement.iteration.class3.scope
new file mode 100644
index 0000000000..ce0906b752
--- /dev/null
+++ b/resources/fixtures/scopes/java/statement/statement.iteration.class3.scope
@@ -0,0 +1,13 @@
+record Foo(int aaa) { }
+---
+
+[#1 Content] =
+[#1 Domain] = 0:0-0:23
+ >-----------------------<
+0| record Foo(int aaa) { }
+
+
+[#2 Content] =
+[#2 Domain] = 0:21-0:22
+ >-<
+0| record Foo(int aaa) { }
diff --git a/resources/fixtures/scopes/java/statement/statement.method3.scope b/resources/fixtures/scopes/java/statement/statement.method3.scope
new file mode 100644
index 0000000000..ab09db34e0
--- /dev/null
+++ b/resources/fixtures/scopes/java/statement/statement.method3.scope
@@ -0,0 +1,33 @@
+record Foo() {
+ void bar() {}
+}
+---
+
+[#1 Content] =
+[#1 Removal] =
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| void bar() {}
+2| }
+ -<
+
+[#1 Insertion delimiter] = "\n"
+
+
+[#2 Content] =
+[#2 Domain] = 1:4-1:17
+ >-------------<
+1| void bar() {}
+
+[#2 Removal] = 1:0-2:0
+ >-----------------
+1| void bar() {}
+2| }
+ <
+
+[#2 Leading delimiter] = 1:0-1:4
+ >----<
+1| void bar() {}
+
+[#2 Insertion delimiter] = "\n"
diff --git a/resources/fixtures/scopes/java/type/type.class2.scope b/resources/fixtures/scopes/java/type/type.class2.scope
new file mode 100644
index 0000000000..82046fac60
--- /dev/null
+++ b/resources/fixtures/scopes/java/type/type.class2.scope
@@ -0,0 +1,13 @@
+@bar
+public class Foo {}
+---
+
+[Content] =
+[Removal] =
+[Domain] = 0:0-1:19
+ >----
+0| @bar
+1| public class Foo {}
+ -------------------<
+
+[Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/type/type.class3.scope b/resources/fixtures/scopes/java/type/type.class3.scope
new file mode 100644
index 0000000000..40b0dd563e
--- /dev/null
+++ b/resources/fixtures/scopes/java/type/type.class3.scope
@@ -0,0 +1,10 @@
+record Foo() {}
+---
+
+[Content] =
+[Removal] =
+[Domain] = 0:0-0:15
+ >---------------<
+0| record Foo() {}
+
+[Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/type/type.class4.scope b/resources/fixtures/scopes/java/type/type.class4.scope
new file mode 100644
index 0000000000..ac3bb06007
--- /dev/null
+++ b/resources/fixtures/scopes/java/type/type.class4.scope
@@ -0,0 +1,13 @@
+@bar
+record Foo() {}
+---
+
+[Content] =
+[Removal] =
+[Domain] = 0:0-1:15
+ >----
+0| @bar
+1| record Foo() {}
+ ---------------<
+
+[Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/type/type.field.class2.scope b/resources/fixtures/scopes/java/type/type.field.class2.scope
new file mode 100644
index 0000000000..10ace54f00
--- /dev/null
+++ b/resources/fixtures/scopes/java/type/type.field.class2.scope
@@ -0,0 +1,38 @@
+record Foo() {
+ static int bar = 0;
+}
+---
+
+[#1 Content] =
+[#1 Removal] =
+[#1 Domain] = 0:0-2:1
+ >--------------
+0| record Foo() {
+1| static int bar = 0;
+2| }
+ -<
+
+[#1 Insertion delimiter] = " "
+
+
+[#2 Content] = 1:11-1:14
+ >---<
+1| static int bar = 0;
+
+[#2 Removal] = 1:11-1:15
+ >----<
+1| static int bar = 0;
+
+[#2 Leading delimiter] = 1:10-1:11
+ >-<
+1| static int bar = 0;
+
+[#2 Trailing delimiter] = 1:14-1:15
+ >-<
+1| static int bar = 0;
+
+[#2 Domain] = 1:4-1:23
+ >-------------------<
+1| static int bar = 0;
+
+[#2 Insertion delimiter] = " "
diff --git a/resources/fixtures/scopes/java/value/value.field.class2.scope b/resources/fixtures/scopes/java/value/value.field.class2.scope
new file mode 100644
index 0000000000..159c95eb9d
--- /dev/null
+++ b/resources/fixtures/scopes/java/value/value.field.class2.scope
@@ -0,0 +1,22 @@
+record Foo() {
+ static int bar = 0;
+}
+---
+
+[Content] = 1:21-1:22
+ >-<
+1| static int bar = 0;
+
+[Removal] = 1:18-1:22
+ >----<
+1| static int bar = 0;
+
+[Leading delimiter] = 1:18-1:21
+ >---<
+1| static int bar = 0;
+
+[Domain] = 1:4-1:23
+ >-------------------<
+1| static int bar = 0;
+
+[Insertion delimiter] = " "
diff --git a/resources/queries/java.scm b/resources/queries/java.scm
index 339c8032f6..46590c0cba 100644
--- a/resources/queries/java.scm
+++ b/resources/queries/java.scm
@@ -27,6 +27,7 @@
(yield_statement)
(method_declaration)
(constructor_declaration)
+ (compact_constructor_declaration)
(field_declaration)
(constant_declaration)
(static_initializer)
@@ -82,6 +83,13 @@
name: (_) @name
) @class @type @_.domain
+;;!! record Foo(int aaa) {}
+;;! ^^^^^^^^^^^^^^^^^^^^^^
+;;! ^^^
+(record_declaration
+ name: (_) @name
+) @class @type @_.domain
+
;;!! interface Foo {}
;;! ^^^^^^^^^^^^^^^^
;;! ^^^
@@ -117,10 +125,18 @@
name: (_) @name
) @namedFunction @name.domain
+;;!! class Foo { Foo {} }
+;;! ^^^^^^
(constructor_declaration
name: (_) @name
) @namedFunction @name.domain
+;;!! record Foo() { Foo {} }
+;;! ^^^^^^
+(compact_constructor_declaration
+ name: (_) @name
+) @namedFunction @name.domain
+
;;!! "string"
;;! ^^^^^^^^
;;!! """string"""