From ee285a93108915751e021d2493724c8b083dee59 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 20:47:47 +0200 Subject: [PATCH 1/9] Added more interface facets --- .../scopes/csharp/interior.interface.scope | 25 ++++++++++ data/fixtures/scopes/csharp/name.class.scope | 28 +++++------ .../scopes/csharp/name.interface.scope | 24 ++++++++++ .../csharp/name.iteration.interface.scope | 13 +++++ .../scopes/csharp/statement.class.scope | 8 ++-- .../scopes/csharp/statement.interface.scope | 10 ++++ .../statement.iteration.interface.scope | 13 +++++ data/fixtures/scopes/csharp/type.class.scope | 8 ++-- .../scopes/csharp/type.interface.scope | 8 ++-- .../csharp/type.iteration.interface.scope | 13 +++++ .../csharp/value.iteration.interface.scope | 13 +++++ packages/common/src/scopeSupportFacets/c.ts | 11 ++++- .../common/src/scopeSupportFacets/csharp.ts | 9 +++- packages/common/src/scopeSupportFacets/css.ts | 13 ++++- .../common/src/scopeSupportFacets/html.ts | 13 ++++- .../common/src/scopeSupportFacets/json.ts | 13 ++++- .../common/src/scopeSupportFacets/markdown.ts | 13 ++++- packages/common/src/scopeSupportFacets/scm.ts | 13 ++++- .../scopeSupportFacetInfos.ts | 48 +++++++++++++++---- .../scopeSupportFacets.types.ts | 9 +++- .../common/src/scopeSupportFacets/talon.ts | 15 ++++-- packages/common/src/scopeSupportFacets/xml.ts | 13 ++++- .../common/src/scopeSupportFacets/yaml.ts | 13 ++++- queries/csharp.scm | 29 +++++++++-- 24 files changed, 315 insertions(+), 60 deletions(-) create mode 100644 data/fixtures/scopes/csharp/interior.interface.scope create mode 100644 data/fixtures/scopes/csharp/name.interface.scope create mode 100644 data/fixtures/scopes/csharp/name.iteration.interface.scope create mode 100644 data/fixtures/scopes/csharp/statement.interface.scope create mode 100644 data/fixtures/scopes/csharp/statement.iteration.interface.scope create mode 100644 data/fixtures/scopes/csharp/type.iteration.interface.scope create mode 100644 data/fixtures/scopes/csharp/value.iteration.interface.scope diff --git a/data/fixtures/scopes/csharp/interior.interface.scope b/data/fixtures/scopes/csharp/interior.interface.scope new file mode 100644 index 0000000000..e213945b2e --- /dev/null +++ b/data/fixtures/scopes/csharp/interior.interface.scope @@ -0,0 +1,25 @@ +interface IFoo { } +--- + +[#1 Content] = +[#1 Removal] = 0:16-0:17 + >-< +0| interface IFoo { } + +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:16-0:17 + >-< +0| interface IFoo { } + +[#2 Domain] = 0:15-0:18 + >---< +0| interface IFoo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.class.scope b/data/fixtures/scopes/csharp/name.class.scope index 004c73ac7b..211086562c 100644 --- a/data/fixtures/scopes/csharp/name.class.scope +++ b/data/fixtures/scopes/csharp/name.class.scope @@ -1,24 +1,24 @@ -class MyClass {} +class Foo {} --- -[Content] = 0:6-0:13 - >-------< -0| class MyClass {} +[Content] = 0:6-0:9 + >---< +0| class Foo {} -[Removal] = 0:6-0:14 - >--------< -0| class MyClass {} +[Removal] = 0:6-0:10 + >----< +0| class Foo {} [Leading delimiter] = 0:5-0:6 >-< -0| class MyClass {} +0| class Foo {} -[Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass {} +[Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo {} -[Domain] = 0:0-0:16 - >----------------< -0| class MyClass {} +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.interface.scope b/data/fixtures/scopes/csharp/name.interface.scope new file mode 100644 index 0000000000..61aab8b7ce --- /dev/null +++ b/data/fixtures/scopes/csharp/name.interface.scope @@ -0,0 +1,24 @@ +interface IFoo {} +--- + +[Content] = 0:10-0:14 + >----< +0| interface IFoo {} + +[Removal] = 0:10-0:15 + >-----< +0| interface IFoo {} + +[Leading delimiter] = 0:9-0:10 + >-< +0| interface IFoo {} + +[Trailing delimiter] = 0:14-0:15 + >-< +0| interface IFoo {} + +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.iteration.interface.scope b/data/fixtures/scopes/csharp/name.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/name.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/statement.class.scope b/data/fixtures/scopes/csharp/statement.class.scope index bcfb80fe89..a6008d311f 100644 --- a/data/fixtures/scopes/csharp/statement.class.scope +++ b/data/fixtures/scopes/csharp/statement.class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.interface.scope b/data/fixtures/scopes/csharp/statement.interface.scope new file mode 100644 index 0000000000..72a42868ea --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.interface.scope @@ -0,0 +1,10 @@ +interface IFoo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.iteration.interface.scope b/data/fixtures/scopes/csharp/statement.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/type.class.scope b/data/fixtures/scopes/csharp/type.class.scope index 696dd5c641..79c274ccc6 100644 --- a/data/fixtures/scopes/csharp/type.class.scope +++ b/data/fixtures/scopes/csharp/type.class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.interface.scope b/data/fixtures/scopes/csharp/type.interface.scope index fcc6af440a..e2787b7fde 100644 --- a/data/fixtures/scopes/csharp/type.interface.scope +++ b/data/fixtures/scopes/csharp/type.interface.scope @@ -1,10 +1,10 @@ -interface IClass { } +interface IFoo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:20 - >--------------------< -0| interface IClass { } +[Domain] = 0:0-0:17 + >-----------------< +0| interface IFoo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.iteration.interface.scope b/data/fixtures/scopes/csharp/type.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/type.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/data/fixtures/scopes/csharp/value.iteration.interface.scope b/data/fixtures/scopes/csharp/value.iteration.interface.scope new file mode 100644 index 0000000000..8760b1f7ef --- /dev/null +++ b/data/fixtures/scopes/csharp/value.iteration.interface.scope @@ -0,0 +1,13 @@ +interface IFoo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:18 + >------------------< +0| interface IFoo { } + + +[#2 Range] = +[#2 Domain] = 0:16-0:17 + >-< +0| interface IFoo { } diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index d5d40c66ff..a53a30748c 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -190,9 +190,18 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "branch.try.iteration": notApplicable, "interior.try": notApplicable, + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, + // Miscellaneous "key.attribute": notApplicable, - "type.interface": notApplicable, "value.attribute": notApplicable, "value.yield": notApplicable, "value.field": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index a356c8121d..a3c4414d2e 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -66,6 +66,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": supported, "name.assignment": supported, "name.class": supported, + "name.interface": supported, "name.constructor": supported, "name.field": supported, "name.foreach": supported, @@ -74,6 +75,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.variable": supported, "name.iteration.block": supported, "name.iteration.class": supported, + "name.iteration.interface": supported, "name.iteration.document": supported, "value.argument.formal.constructor": supported, @@ -93,6 +95,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.yield": supported, "value.iteration.block": supported, "value.iteration.class": supported, + "value.iteration.interface": supported, "value.iteration.document": supported, "type.argument.formal": supported, @@ -103,9 +106,9 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.cast": supported, "type.class": supported, + "type.interface": supported, "type.foreach": supported, "type.field": supported, - "type.interface": supported, "type.enum": supported, "type.return": supported, "type.variable": supported, @@ -113,6 +116,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "key.mapPair": supported, @@ -166,8 +170,10 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.interface": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, + "statement.iteration.interface": supported, "statement.iteration.document": supported, "string.singleLine": supported, @@ -179,6 +185,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.block": supported, "interior.class": supported, + "interior.interface": supported, "interior.function": supported, "interior.constructor": supported, "interior.method": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 1f19ea7e0d..90beaede47 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -40,7 +40,17 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { selector: supported, unit: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -200,7 +210,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.return": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 47252f9149..aaa12e24b2 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -18,7 +18,17 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { startTag: supported, tags: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, "argument.actual.constructor.iteration": notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -167,7 +177,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.return": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 3d52245d80..546dbe9af1 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -21,7 +21,17 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -192,7 +202,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 2eae77e952..5349ac0966 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -17,7 +17,17 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "collectionItem.unenclosed": supported, list: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -189,7 +199,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 1c618d56f9..0b94c000a6 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -23,7 +23,17 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -190,7 +200,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index c1ed99cc9b..ac1bdb3fc1 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -88,14 +88,22 @@ export const scopeSupportFacetInfos: Record< description: "A class declaration", scopeType: "statement", }, + "statement.interface": { + description: "A interface declaration", + scopeType: "statement", + }, "statement.iteration.document": { description: "Iteration scope for statements. The entire document.", scopeType: "statement", isIteration: true, }, "statement.iteration.class": { - description: - "Iteration scope for type in a class / interface; should be entire class / interface body", + description: "Iteration scope for types; class body", + scopeType: "statement", + isIteration: true, + }, + "statement.iteration.interface": { + description: "Iteration scope for types; interface body", scopeType: "statement", isIteration: true, }, @@ -631,6 +639,10 @@ export const scopeSupportFacetInfos: Record< description: "Name of a class", scopeType: "name", }, + "name.interface": { + description: "Name of a interface", + scopeType: "name", + }, "name.namespace": { description: "Name of a namespace", scopeType: "name", @@ -650,6 +662,11 @@ export const scopeSupportFacetInfos: Record< scopeType: "name", isIteration: true, }, + "name.iteration.interface": { + description: "Iteration scope for names: interface body", + scopeType: "name", + isIteration: true, + }, "name.iteration.document": { description: "Iteration scope for names: the entire document", scopeType: "name", @@ -779,6 +796,11 @@ export const scopeSupportFacetInfos: Record< scopeType: "value", isIteration: true, }, + "value.iteration.interface": { + description: "Iteration scope for values: interface body", + scopeType: "value", + isIteration: true, + }, "value.iteration.document": { description: "Iteration scope for values: the entire document", scopeType: "value", @@ -885,10 +907,6 @@ export const scopeSupportFacetInfos: Record< description: "Type of variable in a for each loop", scopeType: "type", }, - "type.interface": { - description: "An interface declaration", - scopeType: "type", - }, "type.enum": { description: "An enum declaration", scopeType: "type", @@ -897,6 +915,10 @@ export const scopeSupportFacetInfos: Record< description: "A class declaration", scopeType: "type", }, + "type.interface": { + description: "An interface declaration", + scopeType: "type", + }, "type.alias": { description: "A type alias declaration", scopeType: "type", @@ -932,13 +954,17 @@ export const scopeSupportFacetInfos: Record< isIteration: true, }, "type.iteration.class": { - description: - "Iteration scope for type in a class / interface; should be entire class / interface body", + description: "Iteration scope for types; class body", + scopeType: "type", + isIteration: true, + }, + "type.iteration.interface": { + description: "Iteration scope for types; interface body", scopeType: "type", isIteration: true, }, "type.iteration.document": { - description: "Iteration scope for a type. This is the entire document.", + description: "Iteration scope for types; entire document.", scopeType: "type", isIteration: true, }, @@ -959,6 +985,10 @@ export const scopeSupportFacetInfos: Record< description: "The body of a class", scopeType: { type: "interior" }, }, + "interior.interface": { + description: "The body of a interface", + scopeType: { type: "interior" }, + }, "interior.function": { description: "The body of a function declaration", scopeType: { type: "interior" }, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 15c72ab7fe..11a127d5c2 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -29,8 +29,10 @@ export const scopeSupportFacets = [ "statement", "statement.class", + "statement.interface", "statement.iteration.document", "statement.iteration.class", + "statement.iteration.interface", "statement.iteration.block", "class", @@ -156,6 +158,7 @@ export const scopeSupportFacets = [ "name.method", "name.constructor", "name.class", + "name.interface", "name.namespace", "name.field", "name.resource", @@ -170,6 +173,7 @@ export const scopeSupportFacets = [ "name.argument.formal.constructor.iteration", "name.iteration.block", "name.iteration.class", + "name.iteration.interface", "name.iteration.document", "key.attribute", @@ -200,17 +204,18 @@ export const scopeSupportFacets = [ "value.argument.formal.constructor.iteration", "value.iteration.block", "value.iteration.class", + "value.iteration.interface", "value.iteration.document", "type.variable", "type.return", "type.field", "type.foreach", - "type.interface", "type.enum", "type.alias", "type.cast", "type.class", + "type.interface", "type.resource", "type.resource.iteration", "type.typeArgument", @@ -223,9 +228,11 @@ export const scopeSupportFacets = [ "type.argument.formal.constructor.iteration", "type.iteration.block", "type.iteration.class", + "type.iteration.interface", "type.iteration.document", "interior.class", + "interior.interface", "interior.function", "interior.constructor", "interior.method", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index bb413db6df..7f1164b4cc 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -39,11 +39,21 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, - // Unsupported + /* UNSUPPORTED */ fieldAccess: unsupported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -201,7 +211,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, "type.typeArgument": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 4fdb4637bb..a3a104c563 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -18,7 +18,17 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { startTag: supported, tags: supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -187,7 +197,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, "type.resource": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 00b2a1444f..973dfe66d4 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -27,7 +27,17 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.string.singleLine": supported, "textFragment.comment.line": supported, - // Not applicable + /* NOT APPLICABLE */ + + // Interface + "statement.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.iteration.interface": notApplicable, + "value.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -195,7 +205,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.field": notApplicable, "type.foreach": notApplicable, - "type.interface": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, "type.resource": notApplicable, diff --git a/queries/csharp.scm b/queries/csharp.scm index 06a94e11d1..8d8aa9a6bc 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -217,6 +217,29 @@ ) ) +;;!! interface IFoo {} +;;! ^^^^^^^^^^^^^^^^^ +(interface_declaration + body: (_ + "{" @interior.start.endOf + "}" @interior.end.startOf + ) +) @type @interior.domain + +(interface_declaration + body: (_ + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf + ) +) + +(interface_declaration + body: (_ + "{" @statement.iteration.start.endOf + "}" @statement.iteration.end.startOf + ) +) + ;;!! "Hello world" ( (string_literal) @string @textFragment @@ -475,11 +498,7 @@ ) @_.domain ;;!! enum Foo {} -;;!! interface IFoo {} -[ - (enum_declaration) - (interface_declaration) -] @type +(enum_declaration) @type ;; Dictionary values; ;;! ^^^^^^ ^^^ From 5035d5b6b955639079e6fb1e6f2bcab35d5873f5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 22:11:02 +0200 Subject: [PATCH 2/9] More languages --- ...ame.field.scope => name.field.class.scope} | 0 ...e.field2.scope => name.field.class2.scope} | 0 ...e.field3.scope => name.field.class3.scope} | 0 data/fixtures/scopes/c/statement.class.scope | 88 +++++++++---------- .../scopes/c/statement.field.class.scope | 33 +++++++ .../scopes/c/statement.field.class2.scope | 33 +++++++ data/fixtures/scopes/c/type.field.class.scope | 38 ++++++++ .../type.field.class2.scope} | 30 +++---- data/fixtures/scopes/c/type.field.scope | 33 ------- data/fixtures/scopes/c/type.field2.scope | 33 ------- .../scopes/cpp/name.field.class.scope | 73 +++++++++++++++ .../fixtures/scopes/cpp/statement.class.scope | 34 ++----- .../scopes/cpp/statement.class2.scope | 10 +++ .../scopes/cpp/type.field.class.scope | 63 +++++++++++++ ...ue.field.scope => value.field.class.scope} | 10 +-- ...ame.field.scope => name.field.class.scope} | 0 ...ype.field.scope => type.field.class.scope} | 6 +- ...ue.field.scope => value.field.class.scope} | 0 .../csharp/value.iteration.interface.scope | 13 --- ...ame.field.scope => name.field.class.scope} | 0 ...ype.field.scope => type.field.class.scope} | 0 ...ue.field.scope => value.field.class.scope} | 2 +- .../name.field.class.scope} | 32 +++---- .../scopes/javascript.core/name.field.scope | 48 ---------- .../javascript.core/value.field.class.scope | 22 +++++ .../scopes/php/name.field.class.scope | 49 +++++++++++ data/fixtures/scopes/php/name.field.scope | 49 ----------- ...ype.field.scope => type.field.class.scope} | 18 ++-- ...ame.field.scope => name.field.class.scope} | 28 +++--- .../scopes/python/type.field.class.scope | 32 +++++++ data/fixtures/scopes/python/type.field.scope | 32 ------- .../value.field.class.scope} | 17 ++-- data/fixtures/scopes/python/value.field.scope | 21 ----- ...ame.field.scope => name.field.class.scope} | 0 ...ue.field.scope => value.field.class.scope} | 0 ...ame.field.scope => name.field.class.scope} | 0 ...ype.field.scope => type.field.class.scope} | 0 ...ue.field.scope => value.field.class.scope} | 0 packages/common/src/scopeSupportFacets/c.ts | 13 +-- packages/common/src/scopeSupportFacets/cpp.ts | 2 +- .../common/src/scopeSupportFacets/csharp.ts | 7 +- packages/common/src/scopeSupportFacets/css.ts | 47 +++++----- .../common/src/scopeSupportFacets/html.ts | 47 +++++----- .../common/src/scopeSupportFacets/java.ts | 6 +- .../src/scopeSupportFacets/javascript.ts | 6 +- .../common/src/scopeSupportFacets/json.ts | 42 ++++----- .../common/src/scopeSupportFacets/markdown.ts | 12 +-- packages/common/src/scopeSupportFacets/php.ts | 4 +- .../common/src/scopeSupportFacets/python.ts | 6 +- packages/common/src/scopeSupportFacets/r.ts | 4 +- packages/common/src/scopeSupportFacets/scm.ts | 47 +++++----- .../scopeSupportFacetInfos.ts | 33 ++++--- .../scopeSupportFacets.types.ts | 11 ++- .../common/src/scopeSupportFacets/talon.ts | 49 ++++++----- .../src/scopeSupportFacets/typescript.ts | 2 +- packages/common/src/scopeSupportFacets/xml.ts | 47 +++++----- .../common/src/scopeSupportFacets/yaml.ts | 47 +++++----- queries/c.scm | 4 +- queries/csharp.scm | 11 +-- 59 files changed, 719 insertions(+), 575 deletions(-) rename data/fixtures/scopes/c/{name.field.scope => name.field.class.scope} (100%) rename data/fixtures/scopes/c/{name.field2.scope => name.field.class2.scope} (100%) rename data/fixtures/scopes/c/{name.field3.scope => name.field.class3.scope} (100%) create mode 100644 data/fixtures/scopes/c/statement.field.class.scope create mode 100644 data/fixtures/scopes/c/statement.field.class2.scope create mode 100644 data/fixtures/scopes/c/type.field.class.scope rename data/fixtures/scopes/{cpp/type.field.scope => c/type.field.class2.scope} (53%) delete mode 100644 data/fixtures/scopes/c/type.field.scope delete mode 100644 data/fixtures/scopes/c/type.field2.scope create mode 100644 data/fixtures/scopes/cpp/name.field.class.scope create mode 100644 data/fixtures/scopes/cpp/statement.class2.scope create mode 100644 data/fixtures/scopes/cpp/type.field.class.scope rename data/fixtures/scopes/cpp/{value.field.scope => value.field.class.scope} (70%) rename data/fixtures/scopes/csharp/{name.field.scope => name.field.class.scope} (100%) rename data/fixtures/scopes/csharp/{type.field.scope => type.field.class.scope} (89%) rename data/fixtures/scopes/csharp/{value.field.scope => value.field.class.scope} (100%) delete mode 100644 data/fixtures/scopes/csharp/value.iteration.interface.scope rename data/fixtures/scopes/java/{name.field.scope => name.field.class.scope} (100%) rename data/fixtures/scopes/java/{type.field.scope => type.field.class.scope} (100%) rename data/fixtures/scopes/java/{value.field.scope => value.field.class.scope} (94%) rename data/fixtures/scopes/{cpp/name.field.scope => javascript.core/name.field.class.scope} (51%) delete mode 100644 data/fixtures/scopes/javascript.core/name.field.scope create mode 100644 data/fixtures/scopes/javascript.core/value.field.class.scope create mode 100644 data/fixtures/scopes/php/name.field.class.scope delete mode 100644 data/fixtures/scopes/php/name.field.scope rename data/fixtures/scopes/php/{type.field.scope => type.field.class.scope} (50%) rename data/fixtures/scopes/python/{name.field.scope => name.field.class.scope} (55%) create mode 100644 data/fixtures/scopes/python/type.field.class.scope delete mode 100644 data/fixtures/scopes/python/type.field.scope rename data/fixtures/scopes/{javascript.core/value.field.scope => python/value.field.class.scope} (54%) delete mode 100644 data/fixtures/scopes/python/value.field.scope rename data/fixtures/scopes/talon/{name.field.scope => name.field.class.scope} (100%) rename data/fixtures/scopes/talon/{value.field.scope => value.field.class.scope} (100%) rename data/fixtures/scopes/typescript.core/{name.field.scope => name.field.class.scope} (100%) rename data/fixtures/scopes/typescript.core/{type.field.scope => type.field.class.scope} (100%) rename data/fixtures/scopes/typescript.core/{value.field.scope => value.field.class.scope} (100%) diff --git a/data/fixtures/scopes/c/name.field.scope b/data/fixtures/scopes/c/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/c/name.field.scope rename to data/fixtures/scopes/c/name.field.class.scope diff --git a/data/fixtures/scopes/c/name.field2.scope b/data/fixtures/scopes/c/name.field.class2.scope similarity index 100% rename from data/fixtures/scopes/c/name.field2.scope rename to data/fixtures/scopes/c/name.field.class2.scope diff --git a/data/fixtures/scopes/c/name.field3.scope b/data/fixtures/scopes/c/name.field.class3.scope similarity index 100% rename from data/fixtures/scopes/c/name.field3.scope rename to data/fixtures/scopes/c/name.field.class3.scope diff --git a/data/fixtures/scopes/c/statement.class.scope b/data/fixtures/scopes/c/statement.class.scope index 74ab361834..f6680edf50 100644 --- a/data/fixtures/scopes/c/statement.class.scope +++ b/data/fixtures/scopes/c/statement.class.scope @@ -1,48 +1,48 @@ -struct aaa { int bbb; }; -union bbb { int ccc; }; -enum ccc { ddd, eee }; +struct aaa {}; +union bbb {}; +enum ccc {}; -typedef struct { int fff; } ggg; -typedef union { int hhh; } iii; -typedef enum { jjj, kkk } lll; +typedef struct {} ddd; +typedef union {} eee; +typedef enum {} fff; --- [#1 Content] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| struct aaa { int bbb; }; +[#1 Domain] = 0:0-0:14 + >--------------< +0| struct aaa {}; [#1 Removal] = 0:0-1:0 - >------------------------ -0| struct aaa { int bbb; }; -1| union bbb { int ccc; }; + >-------------- +0| struct aaa {}; +1| union bbb {}; < [#1 Insertion delimiter] = "\n" [#2 Content] = -[#2 Domain] = 1:0-1:23 - >-----------------------< -1| union bbb { int ccc; }; +[#2 Domain] = 1:0-1:13 + >-------------< +1| union bbb {}; [#2 Removal] = 1:0-2:0 - >----------------------- -1| union bbb { int ccc; }; -2| enum ccc { ddd, eee }; + >------------- +1| union bbb {}; +2| enum ccc {}; < [#2 Insertion delimiter] = "\n" [#3 Content] = -[#3 Domain] = 2:0-2:22 - >----------------------< -2| enum ccc { ddd, eee }; +[#3 Domain] = 2:0-2:12 + >------------< +2| enum ccc {}; [#3 Removal] = 2:0-3:0 - >---------------------- -2| enum ccc { ddd, eee }; + >------------ +2| enum ccc {}; 3| < @@ -50,42 +50,42 @@ typedef enum { jjj, kkk } lll; [#4 Content] = -[#4 Domain] = 4:0-4:32 - >--------------------------------< -4| typedef struct { int fff; } ggg; +[#4 Domain] = 4:0-4:22 + >----------------------< +4| typedef struct {} ddd; [#4 Removal] = 4:0-5:0 - >-------------------------------- -4| typedef struct { int fff; } ggg; -5| typedef union { int hhh; } iii; + >---------------------- +4| typedef struct {} ddd; +5| typedef union {} eee; < [#4 Insertion delimiter] = "\n" [#5 Content] = -[#5 Domain] = 5:0-5:31 - >-------------------------------< -5| typedef union { int hhh; } iii; +[#5 Domain] = 5:0-5:21 + >---------------------< +5| typedef union {} eee; [#5 Removal] = 5:0-6:0 - >------------------------------- -5| typedef union { int hhh; } iii; -6| typedef enum { jjj, kkk } lll; + >--------------------- +5| typedef union {} eee; +6| typedef enum {} fff; < [#5 Insertion delimiter] = "\n" [#6 Content] = -[#6 Domain] = 6:0-6:30 - >------------------------------< -6| typedef enum { jjj, kkk } lll; - -[#6 Removal] = 5:31-6:30 - > -5| typedef union { int hhh; } iii; -6| typedef enum { jjj, kkk } lll; - ------------------------------< +[#6 Domain] = 6:0-6:20 + >--------------------< +6| typedef enum {} fff; + +[#6 Removal] = 5:21-6:20 + > +5| typedef union {} eee; +6| typedef enum {} fff; + --------------------< [#6 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement.field.class.scope b/data/fixtures/scopes/c/statement.field.class.scope new file mode 100644 index 0000000000..e57c6f1c0a --- /dev/null +++ b/data/fixtures/scopes/c/statement.field.class.scope @@ -0,0 +1,33 @@ +struct foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >------------ +0| struct foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| }; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/statement.field.class2.scope b/data/fixtures/scopes/c/statement.field.class2.scope new file mode 100644 index 0000000000..5d66283a5d --- /dev/null +++ b/data/fixtures/scopes/c/statement.field.class2.scope @@ -0,0 +1,33 @@ +union foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >----------- +0| union foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| }; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/c/type.field.class.scope b/data/fixtures/scopes/c/type.field.class.scope new file mode 100644 index 0000000000..dbd73b7fe3 --- /dev/null +++ b/data/fixtures/scopes/c/type.field.class.scope @@ -0,0 +1,38 @@ +struct foo { + int bar; +}; +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:2 + >------------ +0| struct foo { +1| int bar; +2| }; + --< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/type.field.scope b/data/fixtures/scopes/c/type.field.class2.scope similarity index 53% rename from data/fixtures/scopes/cpp/type.field.scope rename to data/fixtures/scopes/c/type.field.class2.scope index 69c762d264..15bacc8a01 100644 --- a/data/fixtures/scopes/cpp/type.field.scope +++ b/data/fixtures/scopes/c/type.field.class2.scope @@ -1,38 +1,38 @@ -class Foo { - int aaa = 2; -} +union foo { + int bar; +}; --- [#1 Content] = [#1 Removal] = -[#1 Domain] = 0:0-2:1 +[#1 Domain] = 0:0-2:2 >----------- -0| class Foo { -1| int aaa = 2; -2| } - -< +0| union foo { +1| int bar; +2| }; + --< [#1 Insertion delimiter] = " " [#2 Content] = 1:4-1:7 >---< -1| int aaa = 2; +1| int bar; [#2 Removal] = 1:4-1:8 >----< -1| int aaa = 2; +1| int bar; [#2 Leading delimiter] = 1:0-1:4 >----< -1| int aaa = 2; +1| int bar; [#2 Trailing delimiter] = 1:7-1:8 >-< -1| int aaa = 2; +1| int bar; -[#2 Domain] = 1:4-1:16 - >------------< -1| int aaa = 2; +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/type.field.scope b/data/fixtures/scopes/c/type.field.scope deleted file mode 100644 index 825a4cde7b..0000000000 --- a/data/fixtures/scopes/c/type.field.scope +++ /dev/null @@ -1,33 +0,0 @@ -struct aaa { int bbb; }; ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-0:24 - >------------------------< -0| struct aaa { int bbb; }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 0:13-0:16 - >---< -0| struct aaa { int bbb; }; - -[#2 Removal] = 0:13-0:17 - >----< -0| struct aaa { int bbb; }; - -[#2 Leading delimiter] = 0:12-0:13 - >-< -0| struct aaa { int bbb; }; - -[#2 Trailing delimiter] = 0:16-0:17 - >-< -0| struct aaa { int bbb; }; - -[#2 Domain] = 0:13-0:21 - >--------< -0| struct aaa { int bbb; }; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/type.field2.scope b/data/fixtures/scopes/c/type.field2.scope deleted file mode 100644 index 87c3f37f68..0000000000 --- a/data/fixtures/scopes/c/type.field2.scope +++ /dev/null @@ -1,33 +0,0 @@ -union aaa { int bbb; }; ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| union aaa { int bbb; }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 0:12-0:15 - >---< -0| union aaa { int bbb; }; - -[#2 Removal] = 0:12-0:16 - >----< -0| union aaa { int bbb; }; - -[#2 Leading delimiter] = 0:11-0:12 - >-< -0| union aaa { int bbb; }; - -[#2 Trailing delimiter] = 0:15-0:16 - >-< -0| union aaa { int bbb; }; - -[#2 Domain] = 0:12-0:20 - >--------< -0| union aaa { int bbb; }; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/name.field.class.scope b/data/fixtures/scopes/cpp/name.field.class.scope new file mode 100644 index 0000000000..91f93b5cc5 --- /dev/null +++ b/data/fixtures/scopes/cpp/name.field.class.scope @@ -0,0 +1,73 @@ +class Foo { + int bar; + int baz = 1; +} +--- + +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { + +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { + +[#1 Leading delimiter] = 0:5-0:6 + >-< +0| class Foo { + +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { + +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:8-2:11 + >---< +2| int baz = 1; + +[#3 Removal] = 2:8-2:12 + >----< +2| int baz = 1; + +[#3 Leading delimiter] = 2:7-2:8 + >-< +2| int baz = 1; + +[#3 Trailing delimiter] = 2:11-2:12 + >-< +2| int baz = 1; + +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 1; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/statement.class.scope b/data/fixtures/scopes/cpp/statement.class.scope index ee2f153e94..bec96ebba3 100644 --- a/data/fixtures/scopes/cpp/statement.class.scope +++ b/data/fixtures/scopes/cpp/statement.class.scope @@ -1,30 +1,10 @@ -class aaa { int bbb; }; -enum class ccc { ddd, eee }; +class foo {}; --- -[#1 Content] = -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| class aaa { int bbb; }; +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| class foo {}; -[#1 Removal] = 0:0-1:0 - >----------------------- -0| class aaa { int bbb; }; -1| enum class ccc { ddd, eee }; - < - -[#1 Insertion delimiter] = "\n" - - -[#2 Content] = -[#2 Domain] = 1:0-1:28 - >----------------------------< -1| enum class ccc { ddd, eee }; - -[#2 Removal] = 0:23-1:28 - > -0| class aaa { int bbb; }; -1| enum class ccc { ddd, eee }; - ----------------------------< - -[#2 Insertion delimiter] = "\n" +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement.class2.scope b/data/fixtures/scopes/cpp/statement.class2.scope new file mode 100644 index 0000000000..0de54d45ce --- /dev/null +++ b/data/fixtures/scopes/cpp/statement.class2.scope @@ -0,0 +1,10 @@ +enum class foo {}; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| enum class foo {}; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/type.field.class.scope b/data/fixtures/scopes/cpp/type.field.class.scope new file mode 100644 index 0000000000..f38bc25a02 --- /dev/null +++ b/data/fixtures/scopes/cpp/type.field.class.scope @@ -0,0 +1,63 @@ +class Foo { + int bar; + int baz = 1; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 1; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 1; + +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 1; + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 1; + +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 1; + +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 1; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/value.field.scope b/data/fixtures/scopes/cpp/value.field.class.scope similarity index 70% rename from data/fixtures/scopes/cpp/value.field.scope rename to data/fixtures/scopes/cpp/value.field.class.scope index feff9f2520..b012818782 100644 --- a/data/fixtures/scopes/cpp/value.field.scope +++ b/data/fixtures/scopes/cpp/value.field.class.scope @@ -1,22 +1,22 @@ class Foo { - int aaa = 2; + int bar = 1; } --- [Content] = 1:14-1:15 >-< -1| int aaa = 2; +1| int bar = 1; [Removal] = 1:11-1:15 >----< -1| int aaa = 2; +1| int bar = 1; [Leading delimiter] = 1:11-1:14 >---< -1| int aaa = 2; +1| int bar = 1; [Domain] = 1:4-1:16 >------------< -1| int aaa = 2; +1| int bar = 1; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/name.field.scope b/data/fixtures/scopes/csharp/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/csharp/name.field.scope rename to data/fixtures/scopes/csharp/name.field.class.scope diff --git a/data/fixtures/scopes/csharp/type.field.scope b/data/fixtures/scopes/csharp/type.field.class.scope similarity index 89% rename from data/fixtures/scopes/csharp/type.field.scope rename to data/fixtures/scopes/csharp/type.field.class.scope index 6228c94197..016967745a 100644 --- a/data/fixtures/scopes/csharp/type.field.scope +++ b/data/fixtures/scopes/csharp/type.field.class.scope @@ -1,4 +1,4 @@ -class MyClass { +class Foo { int value; } --- @@ -6,8 +6,8 @@ class MyClass { [#1 Content] = [#1 Removal] = [#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { + >----------- +0| class Foo { 1| int value; 2| } -< diff --git a/data/fixtures/scopes/csharp/value.field.scope b/data/fixtures/scopes/csharp/value.field.class.scope similarity index 100% rename from data/fixtures/scopes/csharp/value.field.scope rename to data/fixtures/scopes/csharp/value.field.class.scope diff --git a/data/fixtures/scopes/csharp/value.iteration.interface.scope b/data/fixtures/scopes/csharp/value.iteration.interface.scope deleted file mode 100644 index 8760b1f7ef..0000000000 --- a/data/fixtures/scopes/csharp/value.iteration.interface.scope +++ /dev/null @@ -1,13 +0,0 @@ -interface IFoo { } ---- - -[#1 Range] = -[#1 Domain] = 0:0-0:18 - >------------------< -0| interface IFoo { } - - -[#2 Range] = -[#2 Domain] = 0:16-0:17 - >-< -0| interface IFoo { } diff --git a/data/fixtures/scopes/java/name.field.scope b/data/fixtures/scopes/java/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/java/name.field.scope rename to data/fixtures/scopes/java/name.field.class.scope diff --git a/data/fixtures/scopes/java/type.field.scope b/data/fixtures/scopes/java/type.field.class.scope similarity index 100% rename from data/fixtures/scopes/java/type.field.scope rename to data/fixtures/scopes/java/type.field.class.scope diff --git a/data/fixtures/scopes/java/value.field.scope b/data/fixtures/scopes/java/value.field.class.scope similarity index 94% rename from data/fixtures/scopes/java/value.field.scope rename to data/fixtures/scopes/java/value.field.class.scope index d6449ef022..5bc27b44b0 100644 --- a/data/fixtures/scopes/java/value.field.scope +++ b/data/fixtures/scopes/java/value.field.class.scope @@ -1,4 +1,4 @@ -public class MyClass { +public class Foo { private int value = 123; } --- diff --git a/data/fixtures/scopes/cpp/name.field.scope b/data/fixtures/scopes/javascript.core/name.field.class.scope similarity index 51% rename from data/fixtures/scopes/cpp/name.field.scope rename to data/fixtures/scopes/javascript.core/name.field.class.scope index ffc1fc0f7e..51a87c5fff 100644 --- a/data/fixtures/scopes/cpp/name.field.scope +++ b/data/fixtures/scopes/javascript.core/name.field.class.scope @@ -1,5 +1,5 @@ class Foo { - int aaa = 2; + bar = 0; } --- @@ -22,31 +22,27 @@ class Foo { [#1 Domain] = 0:0-2:1 >----------- 0| class Foo { -1| int aaa = 2; +1| bar = 0; 2| } -< [#1 Insertion delimiter] = " " -[#2 Content] = 1:8-1:11 - >---< -1| int aaa = 2; +[#2 Content] = 1:2-1:5 + >---< +1| bar = 0; -[#2 Removal] = 1:8-1:12 - >----< -1| int aaa = 2; +[#2 Removal] = 1:2-1:8 + >------< +1| bar = 0; -[#2 Leading delimiter] = 1:7-1:8 - >-< -1| int aaa = 2; +[#2 Trailing delimiter] = 1:5-1:8 + >---< +1| bar = 0; -[#2 Trailing delimiter] = 1:11-1:12 - >-< -1| int aaa = 2; - -[#2 Domain] = 1:4-1:16 - >------------< -1| int aaa = 2; +[#2 Domain] = 1:2-1:10 + >--------< +1| bar = 0; [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name.field.scope b/data/fixtures/scopes/javascript.core/name.field.scope deleted file mode 100644 index c913e7d6ec..0000000000 --- a/data/fixtures/scopes/javascript.core/name.field.scope +++ /dev/null @@ -1,48 +0,0 @@ -class MyClass { - value = 0; -} ---- - -[#1 Content] = 0:6-0:13 - >-------< -0| class MyClass { - -[#1 Removal] = 0:6-0:14 - >--------< -0| class MyClass { - -[#1 Leading delimiter] = 0:5-0:6 - >-< -0| class MyClass { - -[#1 Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { - -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| value = 0; -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:2-1:7 - >-----< -1| value = 0; - -[#2 Removal] = 1:2-1:10 - >--------< -1| value = 0; - -[#2 Trailing delimiter] = 1:7-1:10 - >---< -1| value = 0; - -[#2 Domain] = 1:2-1:12 - >----------< -1| value = 0; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/value.field.class.scope b/data/fixtures/scopes/javascript.core/value.field.class.scope new file mode 100644 index 0000000000..f10f3be28c --- /dev/null +++ b/data/fixtures/scopes/javascript.core/value.field.class.scope @@ -0,0 +1,22 @@ +class Foo { + bar = 0; +} +--- + +[Content] = 1:8-1:9 + >-< +1| bar = 0; + +[Removal] = 1:5-1:9 + >----< +1| bar = 0; + +[Leading delimiter] = 1:5-1:8 + >---< +1| bar = 0; + +[Domain] = 1:2-1:10 + >--------< +1| bar = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name.field.class.scope b/data/fixtures/scopes/php/name.field.class.scope new file mode 100644 index 0000000000..119b07a120 --- /dev/null +++ b/data/fixtures/scopes/php/name.field.class.scope @@ -0,0 +1,49 @@ +---< +1| class Foo { + +[#1 Removal] = 1:6-1:10 + >----< +1| class Foo { + +[#1 Leading delimiter] = 1:5-1:6 + >-< +1| class Foo { + +[#1 Trailing delimiter] = 1:9-1:10 + >-< +1| class Foo { + +[#1 Domain] = 1:0-3:1 + >----------- +1| class Foo { +2| public string $bar; +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:18-2:22 + >----< +2| public string $bar; + +[#2 Removal] = 2:17-2:22 + >-----< +2| public string $bar; + +[#2 Leading delimiter] = 2:17-2:18 + >-< +2| public string $bar; + +[#2 Domain] = 2:4-2:23 + >-------------------< +2| public string $bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/name.field.scope b/data/fixtures/scopes/php/name.field.scope deleted file mode 100644 index 643d006731..0000000000 --- a/data/fixtures/scopes/php/name.field.scope +++ /dev/null @@ -1,49 +0,0 @@ --------< -1| class MyClass { - -[#1 Removal] = 1:6-1:14 - >--------< -1| class MyClass { - -[#1 Leading delimiter] = 1:5-1:6 - >-< -1| class MyClass { - -[#1 Trailing delimiter] = 1:13-1:14 - >-< -1| class MyClass { - -[#1 Domain] = 1:0-3:1 - >--------------- -1| class MyClass { -2| public string $value; -3| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 2:18-2:24 - >------< -2| public string $value; - -[#2 Removal] = 2:17-2:24 - >-------< -2| public string $value; - -[#2 Leading delimiter] = 2:17-2:18 - >-< -2| public string $value; - -[#2 Domain] = 2:4-2:25 - >---------------------< -2| public string $value; - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/php/type.field.scope b/data/fixtures/scopes/php/type.field.class.scope similarity index 50% rename from data/fixtures/scopes/php/type.field.scope rename to data/fixtures/scopes/php/type.field.class.scope index 9876e5c167..1a87b90e8f 100644 --- a/data/fixtures/scopes/php/type.field.scope +++ b/data/fixtures/scopes/php/type.field.class.scope @@ -1,27 +1,27 @@ ------< -2| public string $value; +2| public string $bar; [Removal] = 2:11-2:18 >-------< -2| public string $value; +2| public string $bar; [Leading delimiter] = 2:10-2:11 >-< -2| public string $value; +2| public string $bar; [Trailing delimiter] = 2:17-2:18 >-< -2| public string $value; +2| public string $bar; -[Domain] = 2:4-2:25 - >---------------------< -2| public string $value; +[Domain] = 2:4-2:23 + >-------------------< +2| public string $bar; [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/name.field.scope b/data/fixtures/scopes/python/name.field.class.scope similarity index 55% rename from data/fixtures/scopes/python/name.field.scope rename to data/fixtures/scopes/python/name.field.class.scope index c217c14462..96f44f2c5c 100644 --- a/data/fixtures/scopes/python/name.field.scope +++ b/data/fixtures/scopes/python/name.field.class.scope @@ -1,5 +1,5 @@ class Foo: - name: str + bar: int --- [#1 Content] = 0:6-0:9 @@ -14,29 +14,29 @@ class Foo: >-< 0| class Foo: -[#1 Domain] = 0:0-1:13 +[#1 Domain] = 0:0-1:12 >---------- 0| class Foo: -1| name: str - -------------< +1| bar: int + ------------< [#1 Insertion delimiter] = " " -[#2 Content] = 1:4-1:8 - >----< -1| name: str +[#2 Content] = 1:4-1:7 + >---< +1| bar: int -[#2 Removal] = 1:0-1:8 - >--------< -1| name: str +[#2 Removal] = 1:0-1:7 + >-------< +1| bar: int [#2 Leading delimiter] = 1:0-1:4 >----< -1| name: str +1| bar: int -[#2 Domain] = 1:4-1:13 - >---------< -1| name: str +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/type.field.class.scope b/data/fixtures/scopes/python/type.field.class.scope new file mode 100644 index 0000000000..61915292ae --- /dev/null +++ b/data/fixtures/scopes/python/type.field.class.scope @@ -0,0 +1,32 @@ +class Foo: + bar: int +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-1:12 + >---------- +0| class Foo: +1| bar: int + ------------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:12 + >---< +1| bar: int + +[#2 Removal] = 1:7-1:12 + >-----< +1| bar: int + +[#2 Leading delimiter] = 1:7-1:9 + >--< +1| bar: int + +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/type.field.scope b/data/fixtures/scopes/python/type.field.scope deleted file mode 100644 index 48e383dc7c..0000000000 --- a/data/fixtures/scopes/python/type.field.scope +++ /dev/null @@ -1,32 +0,0 @@ -class MyClass: - a: int ---- - -[#1 Content] = -[#1 Removal] = -[#1 Domain] = 0:0-1:10 - >-------------- -0| class MyClass: -1| a: int - ----------< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:7-1:10 - >---< -1| a: int - -[#2 Removal] = 1:5-1:10 - >-----< -1| a: int - -[#2 Leading delimiter] = 1:5-1:7 - >--< -1| a: int - -[#2 Domain] = 1:4-1:10 - >------< -1| a: int - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/value.field.scope b/data/fixtures/scopes/python/value.field.class.scope similarity index 54% rename from data/fixtures/scopes/javascript.core/value.field.scope rename to data/fixtures/scopes/python/value.field.class.scope index 3c396b9d74..809eab2a5c 100644 --- a/data/fixtures/scopes/javascript.core/value.field.scope +++ b/data/fixtures/scopes/python/value.field.class.scope @@ -1,22 +1,21 @@ -class MyClass { - value = 0; -} +class Foo: + bar = 0 --- [Content] = 1:10-1:11 >-< -1| value = 0; +1| bar = 0 [Removal] = 1:7-1:11 >----< -1| value = 0; +1| bar = 0 [Leading delimiter] = 1:7-1:10 >---< -1| value = 0; +1| bar = 0 -[Domain] = 1:2-1:12 - >----------< -1| value = 0; +[Domain] = 1:4-1:11 + >-------< +1| bar = 0 [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/value.field.scope b/data/fixtures/scopes/python/value.field.scope deleted file mode 100644 index 559b6c771f..0000000000 --- a/data/fixtures/scopes/python/value.field.scope +++ /dev/null @@ -1,21 +0,0 @@ -class Foo: - value = 123 ---- - -[Content] = 1:12-1:15 - >---< -1| value = 123 - -[Removal] = 1:9-1:15 - >------< -1| value = 123 - -[Leading delimiter] = 1:9-1:12 - >---< -1| value = 123 - -[Domain] = 1:4-1:15 - >-----------< -1| value = 123 - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.field.scope b/data/fixtures/scopes/talon/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/talon/name.field.scope rename to data/fixtures/scopes/talon/name.field.class.scope diff --git a/data/fixtures/scopes/talon/value.field.scope b/data/fixtures/scopes/talon/value.field.class.scope similarity index 100% rename from data/fixtures/scopes/talon/value.field.scope rename to data/fixtures/scopes/talon/value.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/name.field.scope b/data/fixtures/scopes/typescript.core/name.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/name.field.scope rename to data/fixtures/scopes/typescript.core/name.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/type.field.scope b/data/fixtures/scopes/typescript.core/type.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/type.field.scope rename to data/fixtures/scopes/typescript.core/type.field.class.scope diff --git a/data/fixtures/scopes/typescript.core/value.field.scope b/data/fixtures/scopes/typescript.core/value.field.class.scope similarity index 100% rename from data/fixtures/scopes/typescript.core/value.field.scope rename to data/fixtures/scopes/typescript.core/value.field.class.scope diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index a53a30748c..577de97e92 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -11,6 +11,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -79,7 +80,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.variable": supported, "name.function": supported, "name.class": supported, - "name.field": supported, + "name.field.class": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, "name.iteration.block": supported, @@ -96,7 +97,7 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { "type.variable": supported, "type.argument.formal": supported, "type.argument.formal.iteration": supported, - "type.field": supported, + "type.field.class": supported, "type.enum": supported, "type.cast": supported, "type.class": supported, @@ -192,19 +193,21 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, // Miscellaneous "key.attribute": notApplicable, "value.attribute": notApplicable, "value.yield": notApplicable, - "value.field": notApplicable, + "value.field.class": notApplicable, "interior.static": notApplicable, "branch.loop": notApplicable, "branch.loop.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/cpp.ts b/packages/common/src/scopeSupportFacets/cpp.ts index 2fffcdc879..ae77d7a157 100644 --- a/packages/common/src/scopeSupportFacets/cpp.ts +++ b/packages/common/src/scopeSupportFacets/cpp.ts @@ -66,7 +66,7 @@ export const cppScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.constructor": supported, "value.argument.formal.constructor.iteration": supported, "value.foreach": supported, - "value.field": supported, + "value.field.class": supported, "type.argument.formal.method": supported, "type.argument.formal.method.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index a3c4414d2e..1c1d0e080d 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -68,7 +68,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.class": supported, "name.interface": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, "name.foreach": supported, "name.function": supported, "name.method": supported, @@ -85,7 +85,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": supported, "value.argument.formal": supported, "value.assignment": supported, - "value.field": supported, + "value.field.class": supported, "value.foreach": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, @@ -95,7 +95,6 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "value.yield": supported, "value.iteration.block": supported, "value.iteration.class": supported, - "value.iteration.interface": supported, "value.iteration.document": supported, "type.argument.formal": supported, @@ -108,7 +107,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.class": supported, "type.interface": supported, "type.foreach": supported, - "type.field": supported, + "type.field.class": supported, "type.enum": supported, "type.return": supported, "type.variable": supported, diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 90beaede47..339918ad98 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -42,15 +42,39 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -103,12 +127,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try.iteration": notApplicable, "branch.try": notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - class: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, - className: notApplicable, command: notApplicable, "comment.line": notApplicable, "condition.doWhile": notApplicable, @@ -127,12 +145,10 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "functionName.constructor": notApplicable, "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, - "functionName.method.iteration.class": notApplicable, "functionName.method": notApplicable, functionName: notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -164,10 +180,8 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": notApplicable, "name.assignment.pattern": notApplicable, "name.assignment": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.method": notApplicable, @@ -175,11 +189,9 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "name.resource": notApplicable, "name.variable.pattern": notApplicable, "name.variable": notApplicable, - "name.iteration.class": notApplicable, "namedFunction.constructor": notApplicable, "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, - "namedFunction.method.iteration.class": notApplicable, "namedFunction.method": notApplicable, namedFunction: notApplicable, notebookCell: notApplicable, @@ -190,8 +202,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { section: notApplicable, startTag: notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, - "statement.class": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, @@ -206,9 +216,7 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, @@ -217,7 +225,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.variable": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.actual": notApplicable, @@ -229,7 +236,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource.iteration": notApplicable, "value.resource": notApplicable, @@ -240,6 +246,5 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index aaa12e24b2..13f9c4593b 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -20,15 +20,39 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, "argument.actual.constructor.iteration": notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -84,10 +108,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try.iteration": notApplicable, "branch.try": notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, "collectionItem.unenclosed": notApplicable, "comment.line": notApplicable, @@ -103,10 +123,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.constructor": notApplicable, "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, - "functionName.method.iteration.class": notApplicable, "functionName.method": notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -137,13 +155,10 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal": notApplicable, "name.assignment.pattern": notApplicable, "name.assignment": notApplicable, - "name.class": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource.iteration": notApplicable, @@ -154,13 +169,10 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.constructor": notApplicable, "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, - "namedFunction.method.iteration.class": notApplicable, "namedFunction.method": notApplicable, "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, "textFragment.comment.line": notApplicable, @@ -173,9 +185,7 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.resource": notApplicable, "type.resource.iteration": notApplicable, @@ -184,7 +194,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.variable": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual.iteration": notApplicable, "value.argument.actual": notApplicable, @@ -195,7 +204,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": notApplicable, "value.argument.formal": notApplicable, "value.assignment": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair.iteration": notApplicable, "value.mapPair": notApplicable, @@ -208,11 +216,8 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, anonymousFunction: notApplicable, - class: notApplicable, - className: notApplicable, command: notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index e7eba600b3..3e5d525a68 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -115,7 +115,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment": supported, "name.class": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, "name.foreach": supported, "name.method": supported, "name.variable": supported, @@ -126,7 +126,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "value.assignment": supported, "value.foreach": supported, - "value.field": supported, + "value.field.class": supported, "value.return": supported, "value.return.lambda": supported, "value.variable": supported, @@ -140,7 +140,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.argument.formal.method.iteration": supported, "type.foreach": supported, - "type.field": supported, + "type.field.class": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index aead4b7ea0..2da5fa9945 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -137,7 +137,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "name.method": supported, "name.constructor": supported, "name.class": supported, - "name.field": supported, + "name.field.class": supported, "name.iteration.document": supported, "name.iteration.class": supported, "name.iteration.block": supported, @@ -159,7 +159,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { "value.foreach": supported, "value.return": supported, "value.return.lambda": supported, - "value.field": supported, + "value.field.class": supported, "value.yield": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -265,7 +265,7 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": notApplicable, "type.alias": notApplicable, "type.cast": notApplicable, - "type.field": notApplicable, + "type.field.class": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.enum": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 546dbe9af1..cc90fdcc86 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -23,13 +23,34 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, "type.iteration.interface": notApplicable, @@ -89,12 +110,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, @@ -119,10 +134,8 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -153,14 +166,11 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -172,7 +182,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -181,9 +190,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -198,9 +205,7 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, @@ -209,7 +214,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -221,7 +225,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource": notApplicable, "value.resource.iteration": notApplicable, @@ -232,7 +235,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 5349ac0966..172484927d 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -21,13 +21,15 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -154,7 +156,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, + "name.field.class": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, @@ -197,7 +199,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, + "type.field.class": notApplicable, "type.foreach": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, @@ -218,7 +220,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, + "value.field.class": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/php.ts b/packages/common/src/scopeSupportFacets/php.ts index b04ef918ff..8806c9e1a9 100644 --- a/packages/common/src/scopeSupportFacets/php.ts +++ b/packages/common/src/scopeSupportFacets/php.ts @@ -43,11 +43,11 @@ export const phpScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal": supported, "type.argument.formal.iteration": supported, "type.cast": supported, - "type.field": supported, + "type.field.class": supported, "name.argument.formal": supported, "name.argument.formal.iteration": supported, - "name.field": supported, + "name.field.class": supported, disqualifyDelimiter: supported, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index e188ed751d..ecb3d952a1 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -19,7 +19,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "name.assignment.pattern": supported, "name.class": supported, "name.constructor": supported, - "name.field": supported, + "name.field.class": supported, "name.function": supported, "name.iteration.block": supported, "name.iteration.class": supported, @@ -41,7 +41,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": supported, "value.argument.formal.method.iteration": supported, "value.assignment": supported, - "value.field": supported, + "value.field.class": supported, "value.mapPair": supported, "value.mapPair.iteration": supported, "value.return": supported, @@ -59,7 +59,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.argument.formal": supported, "type.class": supported, - "type.field": supported, + "type.field.class": supported, "type.return": supported, "type.typeArgument": supported, "type.typeArgument.iteration": supported, diff --git a/packages/common/src/scopeSupportFacets/r.ts b/packages/common/src/scopeSupportFacets/r.ts index d39df1a3c4..d068d34bb8 100644 --- a/packages/common/src/scopeSupportFacets/r.ts +++ b/packages/common/src/scopeSupportFacets/r.ts @@ -58,7 +58,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "interior.try": unsupported, "key.attribute": unsupported, "name.class": unsupported, - "name.field": unsupported, + "name.field.class": unsupported, "name.foreach": unsupported, "name.function": unsupported, "name.method": unsupported, @@ -99,7 +99,7 @@ export const rScopeSupport: LanguageScopeSupportFacetMap = { "type.cast": notApplicable, "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, + "type.field.class": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.return": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 0b94c000a6..d07d319693 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -25,15 +25,39 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.constructor.singleLine": notApplicable, @@ -85,12 +109,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, @@ -114,10 +132,8 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -151,14 +167,11 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -170,7 +183,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -178,9 +190,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, startTag: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -196,9 +206,7 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, @@ -207,7 +215,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -219,7 +226,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -232,7 +238,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index ac1bdb3fc1..fff5e1db83 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -92,6 +92,14 @@ export const scopeSupportFacetInfos: Record< description: "A interface declaration", scopeType: "statement", }, + "statement.field.class": { + description: "A field declaration in a class", + scopeType: "statement", + }, + "statement.field.interface": { + description: "A field declaration in a interface", + scopeType: "statement", + }, "statement.iteration.document": { description: "Iteration scope for statements. The entire document.", scopeType: "statement", @@ -647,8 +655,12 @@ export const scopeSupportFacetInfos: Record< description: "Name of a namespace", scopeType: "name", }, - "name.field": { - description: "Name (LHS) of a field in a class / interface", + "name.field.class": { + description: "Name (LHS) of a field in a class", + scopeType: "name", + }, + "name.field.interface": { + description: "Name (LHS) of a field in a interface", scopeType: "name", }, "name.iteration.block": { @@ -777,8 +789,8 @@ export const scopeSupportFacetInfos: Record< description: "Implicit return value from a lambda", scopeType: "value", }, - "value.field": { - description: "Value (RHS) of a field in a class / interface", + "value.field.class": { + description: "Value (RHS) of a field in a class", scopeType: "value", }, "value.yield": { @@ -796,11 +808,6 @@ export const scopeSupportFacetInfos: Record< scopeType: "value", isIteration: true, }, - "value.iteration.interface": { - description: "Iteration scope for values: interface body", - scopeType: "value", - isIteration: true, - }, "value.iteration.document": { description: "Iteration scope for values: the entire document", scopeType: "value", @@ -899,8 +906,12 @@ export const scopeSupportFacetInfos: Record< description: "Type of return value in a function declaration", scopeType: "type", }, - "type.field": { - description: "Type of field in a class / interface", + "type.field.class": { + description: "Type of field in a class", + scopeType: "type", + }, + "type.field.interface": { + description: "Type of field in a interface", scopeType: "type", }, "type.foreach": { diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index 11a127d5c2..af55910dcd 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -30,6 +30,8 @@ export const scopeSupportFacets = [ "statement", "statement.class", "statement.interface", + "statement.field.class", + "statement.field.interface", "statement.iteration.document", "statement.iteration.class", "statement.iteration.interface", @@ -160,7 +162,8 @@ export const scopeSupportFacets = [ "name.class", "name.interface", "name.namespace", - "name.field", + "name.field.class", + "name.field.interface", "name.resource", "name.resource.iteration", "name.argument.actual", @@ -189,7 +192,7 @@ export const scopeSupportFacets = [ "value.foreach", "value.return", "value.return.lambda", - "value.field", + "value.field.class", "value.yield", "value.typeAlias", "value.resource", @@ -204,12 +207,12 @@ export const scopeSupportFacets = [ "value.argument.formal.constructor.iteration", "value.iteration.block", "value.iteration.class", - "value.iteration.interface", "value.iteration.document", "type.variable", "type.return", - "type.field", + "type.field.class", + "type.field.interface", "type.foreach", "type.enum", "type.alias", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 7f1164b4cc..2d13c80d56 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -17,7 +17,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": supported, "name.assignment": supported, - "name.field": supported, "name.variable": supported, "name.iteration.block": supported, "name.iteration.document": supported, @@ -26,7 +25,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "statement.iteration.document": supported, "value.assignment": supported, - "value.field": supported, "value.variable": supported, "value.iteration.block": supported, "value.iteration.document": supported, @@ -39,21 +37,47 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "textFragment.comment.line": supported, "textFragment.string.singleLine": supported, + // Talon files doesn't actually have classes, but we are incorrectly using this facet for the command + "name.field.class": supported, + "value.field.class": supported, + /* UNSUPPORTED */ fieldAccess: unsupported, /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, @@ -105,12 +129,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, "comment.block": notApplicable, @@ -134,10 +152,8 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -170,12 +186,10 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method": notApplicable, "name.argument.formal.method.iteration": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, - "name.iteration.class": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, "name.resource.iteration": notApplicable, @@ -185,7 +199,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -193,8 +206,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, startTag: notApplicable, - "statement.class": notApplicable, - "statement.iteration.class": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, "textFragment.comment.block": notApplicable, @@ -207,9 +218,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, @@ -218,7 +227,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "type.resource": notApplicable, "type.resource.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -239,7 +247,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.typeAlias": notApplicable, "value.variable.pattern": notApplicable, "value.yield": notApplicable, - "value.iteration.class": notApplicable, "string.multiLine": notApplicable, "textFragment.string.multiLine": notApplicable, selector: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index 721032b36f..b55b30d150 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -15,7 +15,7 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.constructor.iteration": supported, "type.alias": supported, "type.cast": supported, - "type.field": supported, + "type.field.class": supported, "type.interface": supported, "type.enum": supported, "type.return": supported, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index a3a104c563..cc29de5aa5 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -20,15 +20,39 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -85,12 +109,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, @@ -114,10 +132,8 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, @@ -150,14 +166,11 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -169,7 +182,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -177,9 +189,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.document": notApplicable, "section.iteration.parent": notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, switchStatementSubject: notApplicable, @@ -193,9 +203,7 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.return": notApplicable, "type.variable": notApplicable, @@ -204,7 +212,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -215,7 +222,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method": notApplicable, "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -228,7 +234,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 973dfe66d4..191b0ff76c 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -29,15 +29,39 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, - "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, - "value.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -95,12 +119,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, @@ -123,10 +141,8 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -157,14 +173,11 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -176,7 +189,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, notebookCell: notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, @@ -185,9 +197,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "section.iteration.parent": notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, switchStatementSubject: notApplicable, tags: notApplicable, @@ -201,9 +211,7 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field": notApplicable, "type.foreach": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, @@ -212,7 +220,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -224,7 +231,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field": notApplicable, "value.foreach": notApplicable, "value.resource": notApplicable, "value.resource.iteration": notApplicable, @@ -235,7 +241,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/queries/c.scm b/queries/c.scm index 74a4c91727..23c1b17e94 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -167,13 +167,13 @@ declarator: (_ !declarator ) @name -) @_.domain +) @statement @name.domain (field_declaration declarator: (_ declarator: (_) @name ) -) @_.domain +) @statement @name.domain (initializer_list) @list diff --git a/queries/csharp.scm b/queries/csharp.scm index 8d8aa9a6bc..fd692f2dd3 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -228,15 +228,8 @@ (interface_declaration body: (_ - "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf - "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf - ) -) - -(interface_declaration - body: (_ - "{" @statement.iteration.start.endOf - "}" @statement.iteration.end.startOf + "{" @statement.iteration.start.endOf @name.iteration.start.endOf @type.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf @type.iteration.end.startOf ) ) From c914700b54abc21c8e7cc7ab2d7d3c83fbfad431 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 22:19:45 +0200 Subject: [PATCH 3/9] update --- .../fixtures/scopes/cpp/statement.class.scope | 4 +- .../scopes/cpp/statement.class2.scope | 4 +- .../scopes/csharp/name.field.class.scope | 79 ++++++++++++------- .../scopes/csharp/type.field.class.scope | 47 ++++++++--- .../scopes/csharp/value.field.class.scope | 28 +++---- 5 files changed, 106 insertions(+), 56 deletions(-) diff --git a/data/fixtures/scopes/cpp/statement.class.scope b/data/fixtures/scopes/cpp/statement.class.scope index bec96ebba3..91e4c3fdb8 100644 --- a/data/fixtures/scopes/cpp/statement.class.scope +++ b/data/fixtures/scopes/cpp/statement.class.scope @@ -1,10 +1,10 @@ -class foo {}; +class Foo {}; --- [Content] = [Removal] = [Domain] = 0:0-0:13 >-------------< -0| class foo {}; +0| class Foo {}; [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/cpp/statement.class2.scope b/data/fixtures/scopes/cpp/statement.class2.scope index 0de54d45ce..dfe19a24fb 100644 --- a/data/fixtures/scopes/cpp/statement.class2.scope +++ b/data/fixtures/scopes/cpp/statement.class2.scope @@ -1,10 +1,10 @@ -enum class foo {}; +enum class Foo {}; --- [Content] = [Removal] = [Domain] = 0:0-0:18 >------------------< -0| enum class foo {}; +0| enum class Foo {}; [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/name.field.class.scope b/data/fixtures/scopes/csharp/name.field.class.scope index 1dea8fe9b3..4573c4536d 100644 --- a/data/fixtures/scopes/csharp/name.field.class.scope +++ b/data/fixtures/scopes/csharp/name.field.class.scope @@ -1,48 +1,73 @@ -class MyClass { - int value; +class Foo { + int bar; + int baz = 0; } --- -[#1 Content] = 0:6-0:13 - >-------< -0| class MyClass { +[#1 Content] = 0:6-0:9 + >---< +0| class Foo { -[#1 Removal] = 0:6-0:14 - >--------< -0| class MyClass { +[#1 Removal] = 0:6-0:10 + >----< +0| class Foo { [#1 Leading delimiter] = 0:5-0:6 >-< -0| class MyClass { +0| class Foo { -[#1 Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { +[#1 Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo { -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| int value; -2| } +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } -< [#1 Insertion delimiter] = " " -[#2 Content] = 1:8-1:13 - >-----< -1| int value; +[#2 Content] = 1:8-1:11 + >---< +1| int bar; -[#2 Removal] = 1:7-1:13 - >------< -1| int value; +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; [#2 Leading delimiter] = 1:7-1:8 >-< -1| int value; +1| int bar; -[#2 Domain] = 1:4-1:13 - >---------< -1| int value; +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; [#2 Insertion delimiter] = " " + + +[#3 Content] = 2:8-2:11 + >---< +2| int baz = 0; + +[#3 Removal] = 2:8-2:12 + >----< +2| int baz = 0; + +[#3 Leading delimiter] = 2:7-2:8 + >-< +2| int baz = 0; + +[#3 Trailing delimiter] = 2:11-2:12 + >-< +2| int baz = 0; + +[#3 Domain] = 2:4-2:15 + >-----------< +2| int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/type.field.class.scope b/data/fixtures/scopes/csharp/type.field.class.scope index 016967745a..d163e580a8 100644 --- a/data/fixtures/scopes/csharp/type.field.class.scope +++ b/data/fixtures/scopes/csharp/type.field.class.scope @@ -1,15 +1,17 @@ class Foo { - int value; + int bar; + int baz = 0; } --- [#1 Content] = [#1 Removal] = -[#1 Domain] = 0:0-2:1 +[#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| int value; -2| } +1| int bar; +2| int baz = 0; +3| } -< [#1 Insertion delimiter] = " " @@ -17,22 +19,45 @@ class Foo { [#2 Content] = 1:4-1:7 >---< -1| int value; +1| int bar; [#2 Removal] = 1:4-1:8 >----< -1| int value; +1| int bar; [#2 Leading delimiter] = 1:0-1:4 >----< -1| int value; +1| int bar; [#2 Trailing delimiter] = 1:7-1:8 >-< -1| int value; +1| int bar; -[#2 Domain] = 1:4-1:13 - >---------< -1| int value; +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; [#2 Insertion delimiter] = " " + + +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 0; + +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 0; + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; + +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 0; + +[#3 Domain] = 2:4-2:15 + >-----------< +2| int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/value.field.class.scope b/data/fixtures/scopes/csharp/value.field.class.scope index 80a7d73d2f..667f96450a 100644 --- a/data/fixtures/scopes/csharp/value.field.class.scope +++ b/data/fixtures/scopes/csharp/value.field.class.scope @@ -1,22 +1,22 @@ -class MyClass { - int value = 2; +class Foo { + int bar = 0; } --- -[Content] = 1:16-1:17 - >-< -1| int value = 2; +[Content] = 1:14-1:15 + >-< +1| int bar = 0; -[Removal] = 1:13-1:17 - >----< -1| int value = 2; +[Removal] = 1:11-1:15 + >----< +1| int bar = 0; -[Leading delimiter] = 1:13-1:16 - >---< -1| int value = 2; +[Leading delimiter] = 1:11-1:14 + >---< +1| int bar = 0; -[Domain] = 1:4-1:17 - >-------------< -1| int value = 2; +[Domain] = 1:4-1:15 + >-----------< +1| int bar = 0; [Insertion delimiter] = " " From add0556a1adc996098c31235861c2680584721af Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 22:33:48 +0200 Subject: [PATCH 4/9] not applicable --- .../common/src/scopeSupportFacets/html.ts | 2 +- .../common/src/scopeSupportFacets/json.ts | 3 ++ .../common/src/scopeSupportFacets/markdown.ts | 43 ++++++++++--------- packages/common/src/scopeSupportFacets/scm.ts | 2 +- .../common/src/scopeSupportFacets/talon.ts | 2 +- packages/common/src/scopeSupportFacets/xml.ts | 2 +- .../common/src/scopeSupportFacets/yaml.ts | 2 +- 7 files changed, 31 insertions(+), 25 deletions(-) diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 13f9c4593b..0452c44915 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -46,13 +46,13 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, "argument.actual.constructor.iteration": notApplicable, "argument.actual.constructor.singleLine": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index cc90fdcc86..32af13777e 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -47,11 +47,14 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { // Interface "statement.interface": notApplicable, + "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, "interior.interface": notApplicable, "name.interface": notApplicable, + "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, anonymousFunction: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 172484927d..95f275abe6 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -19,17 +19,39 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { /* NOT APPLICABLE */ + // Class + class: notApplicable, + "class.iteration.block": notApplicable, + "class.iteration.document": notApplicable, + className: notApplicable, + "className.iteration.block": notApplicable, + "className.iteration.document": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "type.iteration.class": notApplicable, + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + "interior.class": notApplicable, + "namedFunction.method.iteration.class": notApplicable, + "functionName.method.iteration.class": notApplicable, + // Interface "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, @@ -87,12 +109,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - class: notApplicable, - "class.iteration.block": notApplicable, - "class.iteration.document": notApplicable, - className: notApplicable, - "className.iteration.block": notApplicable, - "className.iteration.document": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, command: notApplicable, "comment.line": notApplicable, @@ -117,9 +133,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.block": notApplicable, "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, - "functionName.method.iteration.class": notApplicable, ifStatement: notApplicable, - "interior.class": notApplicable, "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, @@ -153,14 +167,11 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": notApplicable, "name.assignment": notApplicable, "name.assignment.pattern": notApplicable, - "name.class": notApplicable, "name.namespace": notApplicable, "name.constructor": notApplicable, - "name.field.class": notApplicable, "name.foreach": notApplicable, "name.function": notApplicable, "name.iteration.block": notApplicable, - "name.iteration.class": notApplicable, "name.iteration.document": notApplicable, "name.method": notApplicable, "name.resource": notApplicable, @@ -172,14 +183,11 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "namedFunction.iteration.block": notApplicable, "namedFunction.iteration.document": notApplicable, "namedFunction.method": notApplicable, - "namedFunction.method.iteration.class": notApplicable, pairDelimiter: notApplicable, regularExpression: notApplicable, startTag: notApplicable, statement: notApplicable, - "statement.class": notApplicable, "statement.iteration.block": notApplicable, - "statement.iteration.class": notApplicable, "statement.iteration.document": notApplicable, "string.multiLine": notApplicable, "string.singleLine": notApplicable, @@ -197,9 +205,7 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method": notApplicable, "type.argument.formal.method.iteration": notApplicable, "type.cast": notApplicable, - "type.class": notApplicable, "type.enum": notApplicable, - "type.field.class": notApplicable, "type.foreach": notApplicable, "type.variable": notApplicable, "type.return": notApplicable, @@ -208,7 +214,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument": notApplicable, "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, - "type.iteration.class": notApplicable, "type.iteration.document": notApplicable, "value.argument.actual": notApplicable, "value.argument.actual.iteration": notApplicable, @@ -220,7 +225,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.assignment": notApplicable, "value.attribute": notApplicable, - "value.field.class": notApplicable, "value.foreach": notApplicable, "value.mapPair": notApplicable, "value.mapPair.iteration": notApplicable, @@ -233,7 +237,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "value.variable.pattern": notApplicable, "value.yield": notApplicable, "value.iteration.block": notApplicable, - "value.iteration.class": notApplicable, "value.iteration.document": notApplicable, selector: notApplicable, unit: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index d07d319693..5b8b19c01f 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -51,13 +51,13 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.constructor.singleLine": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 2d13c80d56..4ab0022d00 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -71,13 +71,13 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index cc29de5aa5..3aef6098ef 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -46,13 +46,13 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index 191b0ff76c..bb71dbdd75 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -55,13 +55,13 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "statement.interface": notApplicable, "statement.field.interface": notApplicable, "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, "name.interface": notApplicable, "name.field.interface": notApplicable, "name.iteration.interface": notApplicable, "type.interface": notApplicable, "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, - "interior.interface": notApplicable, anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, From aa7f5fb99d27cad816362f611bb14510de9e14de Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 22:42:10 +0200 Subject: [PATCH 5/9] csharp --- .../scopes/csharp/name.field.interface.scope | 48 +++++++++++++++++ .../scopes/csharp/statement.field.class.scope | 53 +++++++++++++++++++ .../csharp/statement.field.interface.scope | 33 ++++++++++++ .../scopes/csharp/type.field.interface.scope | 38 +++++++++++++ .../common/src/scopeSupportFacets/csharp.ts | 4 ++ 5 files changed, 176 insertions(+) create mode 100644 data/fixtures/scopes/csharp/name.field.interface.scope create mode 100644 data/fixtures/scopes/csharp/statement.field.class.scope create mode 100644 data/fixtures/scopes/csharp/statement.field.interface.scope create mode 100644 data/fixtures/scopes/csharp/type.field.interface.scope diff --git a/data/fixtures/scopes/csharp/name.field.interface.scope b/data/fixtures/scopes/csharp/name.field.interface.scope new file mode 100644 index 0000000000..2bb7bdefc7 --- /dev/null +++ b/data/fixtures/scopes/csharp/name.field.interface.scope @@ -0,0 +1,48 @@ +interface IFoo { + int bar; +} +--- + +[#1 Content] = 0:10-0:14 + >----< +0| interface IFoo { + +[#1 Removal] = 0:10-0:15 + >-----< +0| interface IFoo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface IFoo { + +[#1 Trailing delimiter] = 0:14-0:15 + >-< +0| interface IFoo { + +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| int bar; + +[#2 Removal] = 1:7-1:11 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/statement.field.class.scope b/data/fixtures/scopes/csharp/statement.field.class.scope new file mode 100644 index 0000000000..d14e13f7f6 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.field.class.scope @@ -0,0 +1,53 @@ +class Foo { + int bar; + int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| int baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 0; + +[#3 Removal] = 2:0-3:0 + >---------------- +2| int baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/statement.field.interface.scope b/data/fixtures/scopes/csharp/statement.field.interface.scope new file mode 100644 index 0000000000..d3b4ba7f67 --- /dev/null +++ b/data/fixtures/scopes/csharp/statement.field.interface.scope @@ -0,0 +1,33 @@ +interface IFoo { + int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| int bar; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; + +[#2 Removal] = 1:0-2:0 + >------------ +1| int bar; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/csharp/type.field.interface.scope b/data/fixtures/scopes/csharp/type.field.interface.scope new file mode 100644 index 0000000000..2181ad2cec --- /dev/null +++ b/data/fixtures/scopes/csharp/type.field.interface.scope @@ -0,0 +1,38 @@ +interface IFoo { + int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| interface IFoo { +1| int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| int bar; + +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| int bar; + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; + +[#2 Domain] = 1:4-1:11 + >-------< +1| int bar; + +[#2 Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index 1c1d0e080d..d6f3b5db2e 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -69,6 +69,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "name.interface": supported, "name.constructor": supported, "name.field.class": supported, + "name.field.interface": supported, "name.foreach": supported, "name.function": supported, "name.method": supported, @@ -108,6 +109,7 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": supported, "type.foreach": supported, "type.field.class": supported, + "type.field.interface": supported, "type.enum": supported, "type.return": supported, "type.variable": supported, @@ -170,6 +172,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, "statement.interface": supported, + "statement.field.class": supported, + "statement.field.interface": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, "statement.iteration.interface": supported, From dbb65781a5a93a76ded5fd8efc104c5896b6b292 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 23:20:27 +0200 Subject: [PATCH 6/9] java --- .../fixtures/scopes/java/interior.class.scope | 26 +++---- .../scopes/java/interior.class2.scope | 25 ------- .../scopes/java/interior.interface.scope | 25 +++++++ data/fixtures/scopes/java/name.class.scope | 28 +++---- .../scopes/java/name.field.class.scope | 75 ++++++++++++------- .../scopes/java/name.field.interface.scope | 48 ++++++++++++ .../fixtures/scopes/java/name.interface.scope | 24 ++++++ ...2.scope => name.iteration.interface.scope} | 0 .../scopes/java/statement.class.scope | 8 +- .../scopes/java/statement.class2.scope | 10 +++ .../scopes/java/statement.field.class.scope | 53 +++++++++++++ .../java/statement.field.interface.scope | 33 ++++++++ .../scopes/java/statement.interface.scope | 10 +++ .../scopes/java/statement.interface2.scope | 10 +++ .../java/statement.iteration.interface.scope | 13 ++++ .../scopes/java/type.field.interface.scope | 38 ++++++++++ .../java/type.iteration.interface.scope | 13 ++++ .../common/src/scopeSupportFacets/java.ts | 10 +++ queries/java.scm | 45 +++++++---- 19 files changed, 397 insertions(+), 97 deletions(-) delete mode 100644 data/fixtures/scopes/java/interior.class2.scope create mode 100644 data/fixtures/scopes/java/interior.interface.scope create mode 100644 data/fixtures/scopes/java/name.field.interface.scope create mode 100644 data/fixtures/scopes/java/name.interface.scope rename data/fixtures/scopes/java/{name.iteration.class2.scope => name.iteration.interface.scope} (100%) create mode 100644 data/fixtures/scopes/java/statement.class2.scope create mode 100644 data/fixtures/scopes/java/statement.field.class.scope create mode 100644 data/fixtures/scopes/java/statement.field.interface.scope create mode 100644 data/fixtures/scopes/java/statement.interface.scope create mode 100644 data/fixtures/scopes/java/statement.interface2.scope create mode 100644 data/fixtures/scopes/java/statement.iteration.interface.scope create mode 100644 data/fixtures/scopes/java/type.field.interface.scope create mode 100644 data/fixtures/scopes/java/type.iteration.interface.scope diff --git a/data/fixtures/scopes/java/interior.class.scope b/data/fixtures/scopes/java/interior.class.scope index 5390112f29..48ed5df4de 100644 --- a/data/fixtures/scopes/java/interior.class.scope +++ b/data/fixtures/scopes/java/interior.class.scope @@ -1,25 +1,25 @@ -class Foo { } +public class Foo { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 - >-< -0| class Foo { } +[#1 Removal] = 0:18-0:19 + >-< +0| public class Foo { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } +[#1 Domain] = 0:0-0:20 + >--------------------< +0| public class Foo { } [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| class Foo { } +[#2 Removal] = 0:18-0:19 + >-< +0| public class Foo { } -[#2 Domain] = 0:10-0:13 - >---< -0| class Foo { } +[#2 Domain] = 0:17-0:20 + >---< +0| public class Foo { } [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.class2.scope b/data/fixtures/scopes/java/interior.class2.scope deleted file mode 100644 index 48ed5df4de..0000000000 --- a/data/fixtures/scopes/java/interior.class2.scope +++ /dev/null @@ -1,25 +0,0 @@ -public class Foo { } ---- - -[#1 Content] = -[#1 Removal] = 0:18-0:19 - >-< -0| public class Foo { } - -[#1 Domain] = 0:0-0:20 - >--------------------< -0| public class Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:18-0:19 - >-< -0| public class Foo { } - -[#2 Domain] = 0:17-0:20 - >---< -0| public class Foo { } - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior.interface.scope b/data/fixtures/scopes/java/interior.interface.scope new file mode 100644 index 0000000000..cf483fb76d --- /dev/null +++ b/data/fixtures/scopes/java/interior.interface.scope @@ -0,0 +1,25 @@ +public interface Foo { } +--- + +[#1 Content] = +[#1 Removal] = 0:22-0:23 + >-< +0| public interface Foo { } + +[#1 Domain] = 0:0-0:24 + >------------------------< +0| public interface Foo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:22-0:23 + >-< +0| public interface Foo { } + +[#2 Domain] = 0:21-0:24 + >---< +0| public interface Foo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.class.scope b/data/fixtures/scopes/java/name.class.scope index dfc56cf188..793da2dfad 100644 --- a/data/fixtures/scopes/java/name.class.scope +++ b/data/fixtures/scopes/java/name.class.scope @@ -1,24 +1,24 @@ -public class MyClass { } +public class Foo {} --- -[Content] = 0:13-0:20 - >-------< -0| public class MyClass { } +[Content] = 0:13-0:16 + >---< +0| public class Foo {} -[Removal] = 0:13-0:21 - >--------< -0| public class MyClass { } +[Removal] = 0:13-0:17 + >----< +0| public class Foo {} [Leading delimiter] = 0:12-0:13 >-< -0| public class MyClass { } +0| public class Foo {} -[Trailing delimiter] = 0:20-0:21 - >-< -0| public class MyClass { } +[Trailing delimiter] = 0:16-0:17 + >-< +0| public class Foo {} -[Domain] = 0:0-0:24 - >------------------------< -0| public class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| public class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.class.scope b/data/fixtures/scopes/java/name.field.class.scope index bd3fdd13ad..2c2c5942d5 100644 --- a/data/fixtures/scopes/java/name.field.class.scope +++ b/data/fixtures/scopes/java/name.field.class.scope @@ -1,48 +1,69 @@ -public class MyClass { - private int value; +public class Foo { + private int bar; + private int baz = 0; } --- -[#1 Content] = 0:13-0:20 - >-------< -0| public class MyClass { +[#1 Content] = 0:13-0:16 + >---< +0| public class Foo { -[#1 Removal] = 0:13-0:21 - >--------< -0| public class MyClass { +[#1 Removal] = 0:13-0:17 + >----< +0| public class Foo { [#1 Leading delimiter] = 0:12-0:13 >-< -0| public class MyClass { +0| public class Foo { -[#1 Trailing delimiter] = 0:20-0:21 - >-< -0| public class MyClass { +[#1 Trailing delimiter] = 0:16-0:17 + >-< +0| public class Foo { -[#1 Domain] = 0:0-2:1 - >---------------------- -0| public class MyClass { -1| private int value; -2| } +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| private int bar; +2| private int baz = 0; +3| } -< [#1 Insertion delimiter] = " " -[#2 Content] = 1:16-1:21 - >-----< -1| private int value; +[#2 Content] = 1:16-1:19 + >---< +1| private int bar; -[#2 Removal] = 1:15-1:21 - >------< -1| private int value; +[#2 Removal] = 1:15-1:19 + >----< +1| private int bar; [#2 Leading delimiter] = 1:15-1:16 >-< -1| private int value; +1| private int bar; -[#2 Domain] = 1:4-1:22 - >------------------< -1| private int value; +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; [#2 Insertion delimiter] = " " + + +[#3 Content] = 2:16-2:19 + >---< +2| private int baz = 0; + +[#3 Removal] = 2:16-2:22 + >------< +2| private int baz = 0; + +[#3 Trailing delimiter] = 2:19-2:22 + >---< +2| private int baz = 0; + +[#3 Domain] = 2:4-2:24 + >--------------------< +2| private int baz = 0; + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.field.interface.scope b/data/fixtures/scopes/java/name.field.interface.scope new file mode 100644 index 0000000000..5aa2e06bca --- /dev/null +++ b/data/fixtures/scopes/java/name.field.interface.scope @@ -0,0 +1,48 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = 0:17-0:20 + >---< +0| public interface Foo { + +[#1 Removal] = 0:17-0:21 + >----< +0| public interface Foo { + +[#1 Leading delimiter] = 0:16-0:17 + >-< +0| public interface Foo { + +[#1 Trailing delimiter] = 0:20-0:21 + >-< +0| public interface Foo { + +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:16-1:19 + >---< +1| private int bar; + +[#2 Removal] = 1:15-1:19 + >----< +1| private int bar; + +[#2 Leading delimiter] = 1:15-1:16 + >-< +1| private int bar; + +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.interface.scope b/data/fixtures/scopes/java/name.interface.scope new file mode 100644 index 0000000000..7f3680e3d4 --- /dev/null +++ b/data/fixtures/scopes/java/name.interface.scope @@ -0,0 +1,24 @@ +public interface Foo {} +--- + +[Content] = 0:17-0:20 + >---< +0| public interface Foo {} + +[Removal] = 0:17-0:21 + >----< +0| public interface Foo {} + +[Leading delimiter] = 0:16-0:17 + >-< +0| public interface Foo {} + +[Trailing delimiter] = 0:20-0:21 + >-< +0| public interface Foo {} + +[Domain] = 0:0-0:23 + >-----------------------< +0| public interface Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/name.iteration.class2.scope b/data/fixtures/scopes/java/name.iteration.interface.scope similarity index 100% rename from data/fixtures/scopes/java/name.iteration.class2.scope rename to data/fixtures/scopes/java/name.iteration.interface.scope diff --git a/data/fixtures/scopes/java/statement.class.scope b/data/fixtures/scopes/java/statement.class.scope index 5153070300..d2c5cc8cda 100644 --- a/data/fixtures/scopes/java/statement.class.scope +++ b/data/fixtures/scopes/java/statement.class.scope @@ -1,10 +1,10 @@ -public class MyClass { } +public class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:24 - >------------------------< -0| public class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| public class Foo {} [Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.class2.scope b/data/fixtures/scopes/java/statement.class2.scope new file mode 100644 index 0000000000..a6008d311f --- /dev/null +++ b/data/fixtures/scopes/java/statement.class2.scope @@ -0,0 +1,10 @@ +class Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.field.class.scope b/data/fixtures/scopes/java/statement.field.class.scope new file mode 100644 index 0000000000..6b11a71b2d --- /dev/null +++ b/data/fixtures/scopes/java/statement.field.class.scope @@ -0,0 +1,53 @@ +public class Foo { + private int bar; + private int baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >------------------ +0| public class Foo { +1| private int bar; +2| private int baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Removal] = 1:0-2:0 + >-------------------- +1| private int bar; +2| private int baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| private int bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:24 + >--------------------< +2| private int baz = 0; + +[#3 Removal] = 2:0-3:0 + >------------------------ +2| private int baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| private int baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.field.interface.scope b/data/fixtures/scopes/java/statement.field.interface.scope new file mode 100644 index 0000000000..6def0d0717 --- /dev/null +++ b/data/fixtures/scopes/java/statement.field.interface.scope @@ -0,0 +1,33 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Removal] = 1:0-2:0 + >-------------------- +1| private int bar; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| private int bar; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.interface.scope b/data/fixtures/scopes/java/statement.interface.scope new file mode 100644 index 0000000000..7bee312543 --- /dev/null +++ b/data/fixtures/scopes/java/statement.interface.scope @@ -0,0 +1,10 @@ +public interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:23 + >-----------------------< +0| public interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.interface2.scope b/data/fixtures/scopes/java/statement.interface2.scope new file mode 100644 index 0000000000..f114e8b3c6 --- /dev/null +++ b/data/fixtures/scopes/java/statement.interface2.scope @@ -0,0 +1,10 @@ +interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/java/statement.iteration.interface.scope b/data/fixtures/scopes/java/statement.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/statement.iteration.interface.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/java/type.field.interface.scope b/data/fixtures/scopes/java/type.field.interface.scope new file mode 100644 index 0000000000..3aad6f9030 --- /dev/null +++ b/data/fixtures/scopes/java/type.field.interface.scope @@ -0,0 +1,38 @@ +public interface Foo { + private int bar; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------------- +0| public interface Foo { +1| private int bar; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:12-1:15 + >---< +1| private int bar; + +[#2 Removal] = 1:12-1:16 + >----< +1| private int bar; + +[#2 Leading delimiter] = 1:11-1:12 + >-< +1| private int bar; + +[#2 Trailing delimiter] = 1:15-1:16 + >-< +1| private int bar; + +[#2 Domain] = 1:4-1:20 + >----------------< +1| private int bar; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/type.iteration.interface.scope b/data/fixtures/scopes/java/type.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/java/type.iteration.interface.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index 3e5d525a68..e9bb8dcdde 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -96,8 +96,12 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.interface": supported, + "statement.field.class": supported, + "statement.field.interface": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, + "statement.iteration.interface": supported, "statement.iteration.document": supported, "string.singleLine": supported, @@ -114,13 +118,16 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "name.argument.formal.method.iteration": supported, "name.assignment": supported, "name.class": supported, + "name.interface": supported, "name.constructor": supported, "name.field.class": supported, + "name.field.interface": supported, "name.foreach": supported, "name.method": supported, "name.variable": supported, "name.iteration.document": supported, "name.iteration.class": supported, + "name.iteration.interface": supported, "name.iteration.block": supported, "name.resource": supported, @@ -141,6 +148,7 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.argument.formal.method.iteration": supported, "type.foreach": supported, "type.field.class": supported, + "type.field.interface": supported, "type.return": supported, "type.variable": supported, "type.typeArgument": supported, @@ -152,9 +160,11 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { "type.interface": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "interior.class": supported, + "interior.interface": supported, "interior.constructor": supported, "interior.method": supported, "interior.if": supported, diff --git a/queries/java.scm b/queries/java.scm index 733a1b0cf8..28a4ea3fc6 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -31,6 +31,7 @@ (method_declaration) (constructor_declaration) (field_declaration) + (constant_declaration) ;; exceptions ;; ";", @@ -40,15 +41,23 @@ ;; (if_statement) ] @statement -[ - (class_declaration) - (interface_declaration) - (enum_declaration) -] @type +;;!! enum Foo {} +;;! ^^^^^^^^^^^ +(enum_declaration) @type +;;!! class Foo {} +;;! ^^^^^^^^^^^^ +;;! ^^^ (class_declaration name: (_) @name @className -) @class @_.domain +) @class @type @_.domain + +;;!! interface Foo {} +;;! ^^^^^^^^^^^^^^^^ +;;! ^^^ +(interface_declaration + name: (_) @name +) @type @_.domain ( (program) @class.iteration @className.iteration @statement.iteration @@ -410,7 +419,7 @@ value: (_) @value ) @branch @_.domain -;;!! int value = 1; +;;!! int value = 0; ;;! ^ ;;! xxxx ;;! -------------- @@ -421,13 +430,28 @@ ) ) @_.domain +;;!! int value = 0; +;;! ^^^ +;;! ^^^^^ +;;! ^ (field_declaration + type: (_) @type (variable_declarator name: (_) @name @value.leading.endOf value: (_)? @value @name.trailing.startOf ) ) @_.domain +;;!! int value; +;;! ^^^ +;;! ^^^^^ +(constant_declaration + type: (_) @type + (variable_declarator + name: (_) @name + ) +) @_.domain + ;;!! int foo, bar; ;;! ^^^ ^^^ ( @@ -499,13 +523,6 @@ (#not-type? @value block) ) @_.domain -;;!! Map foo; -;;! ^^^^^^^^^^^^^ -;;! ------------------ -(field_declaration - type: (_) @type -) @_.domain - ;;!! Map foo; ;;! ^^^ ^^^ (type_arguments From 119873e4a41b0647b4c0ee83192a3e983cdbcd0c Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 23:20:33 +0200 Subject: [PATCH 7/9] sort facets in scope test error --- .../cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts index 7e063938be..0c9a7fad62 100644 --- a/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts +++ b/packages/cursorless-vscode-e2e/src/suite/scopes.vscode.test.ts @@ -98,7 +98,7 @@ async function testLanguageSupport(languageId: string, testedFacets: string[]) { (testedFacet) => !supportedFacets.includes(testedFacet), ); if (unsupportedFacets.length > 0) { - const values = uniq(unsupportedFacets).join(", "); + const values = uniq(unsupportedFacets).sort().join(", "); assert.fail( `Facets [${values}] are tested but not listed in getLanguageScopeSupport`, ); @@ -109,7 +109,7 @@ async function testLanguageSupport(languageId: string, testedFacets: string[]) { (supportedFacet) => !testedFacets.includes(supportedFacet), ); if (untestedFacets.length > 0) { - const values = untestedFacets.join(", "); + const values = untestedFacets.sort().join(", "); assert.fail(`Missing test for scope support facets [${values}]`); } } From 5a99d5d3dfbea6ef78110b59303e23599d3c4094 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 2 Jul 2025 23:58:51 +0200 Subject: [PATCH 8/9] ts --- .../scopes/java/type.field.class.scope | 83 +++++++++---------- .../scopes/javascript.core/class.scope | 8 +- .../scopes/javascript.core/class2.scope | 8 +- .../scopes/javascript.core/class3.scope | 8 +- .../scopes/javascript.core/name.class.scope | 33 ++++---- .../javascript.core/name.field.class.scope | 45 +++++++--- .../statement.field.class.scope | 53 ++++++++++++ .../typescript.core/interior.interface.scope | 25 ++++++ .../name.field.interface.scope | 48 +++++++++++ .../typescript.core/name.interface.scope | 24 ++++++ .../name.iteration.interface.scope | 13 +++ .../statement.field.interface.scope | 33 ++++++++ .../typescript.core/statement.interface.scope | 10 +++ .../statement.iteration.interface.scope | 13 +++ .../type.field.interface.scope | 34 ++++++++ .../type.iteration.interface.scope | 13 +++ .../src/scopeSupportFacets/javascript.ts | 16 +++- .../src/scopeSupportFacets/typescript.ts | 10 +++ queries/javascript.scm | 8 +- 19 files changed, 391 insertions(+), 94 deletions(-) create mode 100644 data/fixtures/scopes/javascript.core/statement.field.class.scope create mode 100644 data/fixtures/scopes/typescript.core/interior.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/name.field.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/name.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/name.iteration.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/statement.field.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/statement.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/statement.iteration.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/type.field.interface.scope create mode 100644 data/fixtures/scopes/typescript.core/type.iteration.interface.scope diff --git a/data/fixtures/scopes/java/type.field.class.scope b/data/fixtures/scopes/java/type.field.class.scope index a8097eaca7..528fd810c8 100644 --- a/data/fixtures/scopes/java/type.field.class.scope +++ b/data/fixtures/scopes/java/type.field.class.scope @@ -1,70 +1,63 @@ -class MyClass { - Map foo; +class Foo { + int bar; + int baz = 0; } --- [#1 Content] = [#1 Removal] = -[#1 Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| Map foo; -2| } +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| int bar; +2| int baz = 0; +3| } -< [#1 Insertion delimiter] = " " -[#2 Content] = 1:4-1:17 - >-------------< -1| Map foo; +[#2 Content] = 1:4-1:7 + >---< +1| int bar; -[#2 Removal] = 1:4-1:18 - >--------------< -1| Map foo; +[#2 Removal] = 1:4-1:8 + >----< +1| int bar; [#2 Leading delimiter] = 1:0-1:4 >----< -1| Map foo; +1| int bar; -[#2 Trailing delimiter] = 1:17-1:18 - >-< -1| Map foo; +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| int bar; -[#2 Domain] = 1:4-1:22 - >------------------< -1| Map foo; +[#2 Domain] = 1:4-1:12 + >--------< +1| int bar; [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Domain] = 1:8-1:11 - >---< -1| Map foo; +[#3 Content] = 2:4-2:7 + >---< +2| int baz = 0; -[#3 Removal] = 1:8-1:13 - >-----< -1| Map foo; +[#3 Removal] = 2:4-2:8 + >----< +2| int baz = 0; -[#3 Trailing delimiter] = 1:11-1:13 - >--< -1| Map foo; - -[#3 Insertion delimiter] = ", " - - -[#4 Content] = -[#4 Domain] = 1:13-1:16 - >---< -1| Map foo; +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| int baz = 0; -[#4 Removal] = 1:11-1:16 - >-----< -1| Map foo; +[#3 Trailing delimiter] = 2:7-2:8 + >-< +2| int baz = 0; -[#4 Leading delimiter] = 1:11-1:13 - >--< -1| Map foo; +[#3 Domain] = 2:4-2:16 + >------------< +2| int baz = 0; -[#4 Insertion delimiter] = ", " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/class.scope b/data/fixtures/scopes/javascript.core/class.scope index e6a25b8f55..ffbda12f63 100644 --- a/data/fixtures/scopes/javascript.core/class.scope +++ b/data/fixtures/scopes/javascript.core/class.scope @@ -1,10 +1,10 @@ -class MyClass { } +class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:17 - >-----------------< -0| class MyClass { } +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/class2.scope b/data/fixtures/scopes/javascript.core/class2.scope index cb0026603b..47e52ec710 100644 --- a/data/fixtures/scopes/javascript.core/class2.scope +++ b/data/fixtures/scopes/javascript.core/class2.scope @@ -1,10 +1,10 @@ -export default class MyClass { } +export default class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:32 - >--------------------------------< -0| export default class MyClass { } +[Domain] = 0:0-0:27 + >---------------------------< +0| export default class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/class3.scope b/data/fixtures/scopes/javascript.core/class3.scope index aa5deaa1e1..6589c550c4 100644 --- a/data/fixtures/scopes/javascript.core/class3.scope +++ b/data/fixtures/scopes/javascript.core/class3.scope @@ -1,10 +1,10 @@ -export class MyClass { } +export class Foo {} --- [Content] = [Removal] = -[Domain] = 0:0-0:24 - >------------------------< -0| export class MyClass { } +[Domain] = 0:0-0:19 + >-------------------< +0| export class Foo {} [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/javascript.core/name.class.scope b/data/fixtures/scopes/javascript.core/name.class.scope index 428df96465..211086562c 100644 --- a/data/fixtures/scopes/javascript.core/name.class.scope +++ b/data/fixtures/scopes/javascript.core/name.class.scope @@ -1,29 +1,24 @@ -class MyClass { - -} +class Foo {} --- -[Content] = 0:6-0:13 - >-------< -0| class MyClass { +[Content] = 0:6-0:9 + >---< +0| class Foo {} -[Removal] = 0:6-0:14 - >--------< -0| class MyClass { +[Removal] = 0:6-0:10 + >----< +0| class Foo {} [Leading delimiter] = 0:5-0:6 >-< -0| class MyClass { +0| class Foo {} -[Trailing delimiter] = 0:13-0:14 - >-< -0| class MyClass { +[Trailing delimiter] = 0:9-0:10 + >-< +0| class Foo {} -[Domain] = 0:0-2:1 - >--------------- -0| class MyClass { -1| -2| } - -< +[Domain] = 0:0-0:12 + >------------< +0| class Foo {} [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/name.field.class.scope b/data/fixtures/scopes/javascript.core/name.field.class.scope index 51a87c5fff..081d51fe83 100644 --- a/data/fixtures/scopes/javascript.core/name.field.class.scope +++ b/data/fixtures/scopes/javascript.core/name.field.class.scope @@ -1,5 +1,6 @@ class Foo { - bar = 0; + bar; + baz = 0; } --- @@ -19,11 +20,12 @@ class Foo { >-< 0| class Foo { -[#1 Domain] = 0:0-2:1 +[#1 Domain] = 0:0-3:1 >----------- 0| class Foo { -1| bar = 0; -2| } +1| bar; +2| baz = 0; +3| } -< [#1 Insertion delimiter] = " " @@ -31,18 +33,37 @@ class Foo { [#2 Content] = 1:2-1:5 >---< -1| bar = 0; +1| bar; -[#2 Removal] = 1:2-1:8 +[#2 Removal] = 1:0-1:5 + >-----< +1| bar; + +[#2 Leading delimiter] = 1:0-1:2 + >--< +1| bar; + +[#2 Domain] = 1:2-1:6 + >----< +1| bar; + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:2-2:5 + >---< +2| baz = 0; + +[#3 Removal] = 2:2-2:8 >------< -1| bar = 0; +2| baz = 0; -[#2 Trailing delimiter] = 1:5-1:8 +[#3 Trailing delimiter] = 2:5-2:8 >---< -1| bar = 0; +2| baz = 0; -[#2 Domain] = 1:2-1:10 +[#3 Domain] = 2:2-2:10 >--------< -1| bar = 0; +2| baz = 0; -[#2 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/statement.field.class.scope b/data/fixtures/scopes/javascript.core/statement.field.class.scope new file mode 100644 index 0000000000..c60f838a11 --- /dev/null +++ b/data/fixtures/scopes/javascript.core/statement.field.class.scope @@ -0,0 +1,53 @@ +class Foo { + bar; + baz = 0; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-3:1 + >----------- +0| class Foo { +1| bar; +2| baz = 0; +3| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:2-1:6 + >----< +1| bar; + +[#2 Removal] = 1:0-2:0 + >------ +1| bar; +2| baz = 0; + < + +[#2 Leading delimiter] = 1:0-1:2 + >--< +1| bar; + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:2-2:10 + >--------< +2| baz = 0; + +[#3 Removal] = 2:0-3:0 + >---------- +2| baz = 0; +3| } + < + +[#3 Leading delimiter] = 2:0-2:2 + >--< +2| baz = 0; + +[#3 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/interior.interface.scope b/data/fixtures/scopes/typescript.core/interior.interface.scope new file mode 100644 index 0000000000..f79024c7de --- /dev/null +++ b/data/fixtures/scopes/typescript.core/interior.interface.scope @@ -0,0 +1,25 @@ +interface Foo { } +--- + +[#1 Content] = +[#1 Removal] = 0:15-0:16 + >-< +0| interface Foo { } + +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:15-0:16 + >-< +0| interface Foo { } + +[#2 Domain] = 0:14-0:17 + >---< +0| interface Foo { } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.field.interface.scope b/data/fixtures/scopes/typescript.core/name.field.interface.scope new file mode 100644 index 0000000000..e92982ddcc --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.field.interface.scope @@ -0,0 +1,48 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = 0:10-0:13 + >---< +0| interface Foo { + +[#1 Removal] = 0:10-0:14 + >----< +0| interface Foo { + +[#1 Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo { + +[#1 Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo { + +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar: number; + +[#2 Removal] = 1:0-1:7 + >-------< +1| bar: number; + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: number; + +[#2 Domain] = 1:4-1:15 + >-----------< +1| bar: number; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.interface.scope b/data/fixtures/scopes/typescript.core/name.interface.scope new file mode 100644 index 0000000000..52074b01f0 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.interface.scope @@ -0,0 +1,24 @@ +interface Foo {} +--- + +[Content] = 0:10-0:13 + >---< +0| interface Foo {} + +[Removal] = 0:10-0:14 + >----< +0| interface Foo {} + +[Leading delimiter] = 0:9-0:10 + >-< +0| interface Foo {} + +[Trailing delimiter] = 0:13-0:14 + >-< +0| interface Foo {} + +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/name.iteration.interface.scope b/data/fixtures/scopes/typescript.core/name.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/name.iteration.interface.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/typescript.core/statement.field.interface.scope b/data/fixtures/scopes/typescript.core/statement.field.interface.scope new file mode 100644 index 0000000000..a16dcae09b --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.field.interface.scope @@ -0,0 +1,33 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:16 + >------------< +1| bar: number; + +[#2 Removal] = 1:0-2:0 + >---------------- +1| bar: number; +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: number; + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/statement.interface.scope b/data/fixtures/scopes/typescript.core/statement.interface.scope new file mode 100644 index 0000000000..f114e8b3c6 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.interface.scope @@ -0,0 +1,10 @@ +interface Foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:16 + >----------------< +0| interface Foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/typescript.core/statement.iteration.interface.scope b/data/fixtures/scopes/typescript.core/statement.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/statement.iteration.interface.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/data/fixtures/scopes/typescript.core/type.field.interface.scope b/data/fixtures/scopes/typescript.core/type.field.interface.scope new file mode 100644 index 0000000000..b9341860f6 --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.field.interface.scope @@ -0,0 +1,34 @@ +interface Foo { + bar: number; +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >--------------- +0| interface Foo { +1| bar: number; +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:9-1:15 + >------< +1| bar: number; + +[#2 Removal] = 1:7-1:15 + >--------< +1| bar: number; + +[#2 Leading delimiter] = 1:7-1:9 + >--< +1| bar: number; + +[#2 Domain] = 1:4-1:16 + >------------< +1| bar: number; + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/type.iteration.interface.scope b/data/fixtures/scopes/typescript.core/type.iteration.interface.scope new file mode 100644 index 0000000000..96db32e4ed --- /dev/null +++ b/data/fixtures/scopes/typescript.core/type.iteration.interface.scope @@ -0,0 +1,13 @@ +interface Foo { } +--- + +[#1 Range] = +[#1 Domain] = 0:0-0:17 + >-----------------< +0| interface Foo { } + + +[#2 Range] = +[#2 Domain] = 0:15-0:16 + >-< +0| interface Foo { } diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index 2da5fa9945..dce30ca35d 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -24,6 +24,7 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.document": supported, "statement.iteration.class": supported, "statement.iteration.block": supported, @@ -254,9 +255,10 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { ...javascriptCoreScopeSupport, ...javascriptJsxScopeSupport, - // Types are defined here because we don't want typescript to import them and + // These are defined here because we don't want typescript to import them and // accidentally forget to add support for them. + // Type "type.argument.formal": notApplicable, "type.argument.formal.iteration": notApplicable, "type.argument.formal.method": notApplicable, @@ -266,6 +268,7 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.alias": notApplicable, "type.cast": notApplicable, "type.field.class": notApplicable, + "type.field.interface": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, "type.enum": notApplicable, @@ -275,7 +278,16 @@ export const javascriptScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": notApplicable, "type.iteration.block": notApplicable, "type.iteration.class": notApplicable, + "type.iteration.interface": notApplicable, "type.iteration.document": notApplicable, - "value.typeAlias": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/typescript.ts b/packages/common/src/scopeSupportFacets/typescript.ts index b55b30d150..0d7ad37ed7 100644 --- a/packages/common/src/scopeSupportFacets/typescript.ts +++ b/packages/common/src/scopeSupportFacets/typescript.ts @@ -16,6 +16,7 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.alias": supported, "type.cast": supported, "type.field.class": supported, + "type.field.interface": supported, "type.interface": supported, "type.enum": supported, "type.return": supported, @@ -24,10 +25,19 @@ export const typescriptScopeSupport: LanguageScopeSupportFacetMap = { "type.typeArgument.iteration": supported, "type.iteration.block": supported, "type.iteration.class": supported, + "type.iteration.interface": supported, "type.iteration.document": supported, "value.typeAlias": supported, + "interior.interface": supported, + "name.interface": supported, + "name.field.interface": supported, + "name.iteration.interface": supported, + "statement.interface": supported, + "statement.field.interface": supported, + "statement.iteration.interface": supported, + /* NOT APPLICABLE */ // Element and tags diff --git a/queries/javascript.scm b/queries/javascript.scm index 5bcc15ce60..979093a68c 100644 --- a/queries/javascript.scm +++ b/queries/javascript.scm @@ -26,9 +26,9 @@ ) (arrow_function) ] - ) @namedFunction.start @functionName.domain.start + ) @statement.start @namedFunction.start @functionName.domain.start . - ";"? @namedFunction.end @functionName.domain.end + ";"? @statement.end @namedFunction.end @functionName.domain.end ) (_ @@ -37,9 +37,9 @@ (field_definition property: (_) @name @value.leading.endOf value: (_)? @value @name.trailing.startOf - ) @_.domain.start + ) @statement.start @_.domain.start . - ";"? @_.domain.end + ";"? @statement.end @_.domain.end ) ;;!! foo(name) {} From bfc1a018a2d4007828cda9da1a4d21c6aa3cb164 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 3 Jul 2025 00:05:15 +0200 Subject: [PATCH 9/9] python --- data/fixtures/scopes/python/class.scope | 6 +-- data/fixtures/scopes/python/class2.scope | 4 +- .../scopes/python/statement.field.class.scope | 51 +++++++++++++++++++ .../common/src/scopeSupportFacets/python.ts | 12 +++++ 4 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 data/fixtures/scopes/python/statement.field.class.scope diff --git a/data/fixtures/scopes/python/class.scope b/data/fixtures/scopes/python/class.scope index 4463b9d47c..450a9fd782 100644 --- a/data/fixtures/scopes/python/class.scope +++ b/data/fixtures/scopes/python/class.scope @@ -1,12 +1,12 @@ -class MyClass: +class Foo: pass --- [Content] = [Removal] = [Domain] = 0:0-1:8 - >-------------- -0| class MyClass: + >---------- +0| class Foo: 1| pass --------< diff --git a/data/fixtures/scopes/python/class2.scope b/data/fixtures/scopes/python/class2.scope index ebf4a4762e..956e5e38d6 100644 --- a/data/fixtures/scopes/python/class2.scope +++ b/data/fixtures/scopes/python/class2.scope @@ -1,5 +1,5 @@ @value -class MyClass: +class Foo: pass --- @@ -8,7 +8,7 @@ class MyClass: [Domain] = 0:0-2:8 >------ 0| @value -1| class MyClass: +1| class Foo: 2| pass --------< diff --git a/data/fixtures/scopes/python/statement.field.class.scope b/data/fixtures/scopes/python/statement.field.class.scope new file mode 100644 index 0000000000..4889b6538a --- /dev/null +++ b/data/fixtures/scopes/python/statement.field.class.scope @@ -0,0 +1,51 @@ +class Foo: + bar: int + baz = 0 +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:11 + >---------- +0| class Foo: +1| bar: int +2| baz = 0 + -----------< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| bar: int + +[#2 Removal] = 1:0-2:0 + >------------ +1| bar: int +2| baz = 0 + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar: int + +[#2 Insertion delimiter] = "\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:11 + >-------< +2| baz = 0 + +[#3 Removal] = 1:12-2:11 + > +1| bar: int +2| baz = 0 + -----------< + +[#3 Leading delimiter] = 2:0-2:4 + >----< +2| baz = 0 + +[#3 Insertion delimiter] = "\n" diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index ecb3d952a1..c560d38cd5 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -185,6 +185,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { ifStatement: supported, statement: supported, "statement.class": supported, + "statement.field.class": supported, "statement.iteration.block": supported, "statement.iteration.class": supported, "statement.iteration.document": supported, @@ -244,6 +245,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "type.enum": notApplicable, "type.foreach": notApplicable, "type.interface": notApplicable, + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, "type.resource.iteration": notApplicable, "type.resource": notApplicable, "value.typeAlias": notApplicable, @@ -261,6 +264,15 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "comment.block": notApplicable, "textFragment.comment.block": notApplicable, + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "statement.iteration.interface": notApplicable, + "interior.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "interior.static": notApplicable, environment: notApplicable, regularExpression: notApplicable,