From 53ed7cb3f3979aeeadda0c55ccb87b47a1beb9e5 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 3 Jul 2025 09:30:26 +0200 Subject: [PATCH 1/2] Added command facets --- data/fixtures/scopes/talon/key.mapPair.scope | 14 ++++++ data/fixtures/scopes/talon/key.mapPair2.scope | 13 ++++++ data/fixtures/scopes/talon/key.mapPair3.scope | 39 ++++++++++++++++ data/fixtures/scopes/talon/name.command.scope | 13 ++++++ .../fixtures/scopes/talon/name.command2.scope | 21 +++++++++ .../fixtures/scopes/talon/name.command3.scope | 39 ++++++++++++++++ .../scopes/talon/name.field.class.scope | 13 ------ .../fixtures/scopes/talon/name.variable.scope | 34 +++++++------- .../scopes/talon/value.assignment.scope | 46 +++++++++---------- .../fixtures/scopes/talon/value.command.scope | 20 ++++++++ .../scopes/talon/value.field.class.scope | 20 -------- .../fixtures/scopes/talon/value.mapPair.scope | 21 +++++++++ .../scopes/talon/value.mapPair2.scope | 44 ++++++++++++++++++ .../scopes/talon/value.variable.scope | 46 +++++++++---------- packages/common/src/scopeSupportFacets/c.ts | 2 + .../common/src/scopeSupportFacets/csharp.ts | 2 + packages/common/src/scopeSupportFacets/css.ts | 8 +++- .../common/src/scopeSupportFacets/html.ts | 8 +++- .../common/src/scopeSupportFacets/java.ts | 2 + .../src/scopeSupportFacets/javascript.ts | 2 + .../common/src/scopeSupportFacets/json.ts | 8 +++- .../common/src/scopeSupportFacets/markdown.ts | 8 +++- .../common/src/scopeSupportFacets/python.ts | 2 + packages/common/src/scopeSupportFacets/scm.ts | 8 +++- .../scopeSupportFacetInfos.ts | 10 +++- .../scopeSupportFacets.types.ts | 2 + .../common/src/scopeSupportFacets/talon.ts | 15 +++--- packages/common/src/scopeSupportFacets/xml.ts | 8 +++- .../common/src/scopeSupportFacets/yaml.ts | 8 +++- 29 files changed, 358 insertions(+), 118 deletions(-) create mode 100644 data/fixtures/scopes/talon/key.mapPair.scope create mode 100644 data/fixtures/scopes/talon/key.mapPair2.scope create mode 100644 data/fixtures/scopes/talon/key.mapPair3.scope create mode 100644 data/fixtures/scopes/talon/name.command.scope create mode 100644 data/fixtures/scopes/talon/name.command2.scope create mode 100644 data/fixtures/scopes/talon/name.command3.scope delete mode 100644 data/fixtures/scopes/talon/name.field.class.scope create mode 100644 data/fixtures/scopes/talon/value.command.scope delete mode 100644 data/fixtures/scopes/talon/value.field.class.scope create mode 100644 data/fixtures/scopes/talon/value.mapPair.scope create mode 100644 data/fixtures/scopes/talon/value.mapPair2.scope diff --git a/data/fixtures/scopes/talon/key.mapPair.scope b/data/fixtures/scopes/talon/key.mapPair.scope new file mode 100644 index 0000000000..6e9d91f6cf --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair.scope @@ -0,0 +1,14 @@ +not mode: command +- +--- + +[Content] = +[Removal] = 0:0-0:8 + >--------< +0| not mode: command + +[Domain] = 0:0-0:17 + >-----------------< +0| not mode: command + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/key.mapPair2.scope b/data/fixtures/scopes/talon/key.mapPair2.scope new file mode 100644 index 0000000000..5837b42ede --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair2.scope @@ -0,0 +1,13 @@ +foo: "bar" +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo: "bar" + +[Domain] = 0:0-0:10 + >----------< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/key.mapPair3.scope b/data/fixtures/scopes/talon/key.mapPair3.scope new file mode 100644 index 0000000000..9a3ffb388b --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair3.scope @@ -0,0 +1,39 @@ +settings(): + foo = 0 +--- + +[#1 Content] = +[#1 Removal] = 0:0-0:10 + >----------< +0| settings(): + +[#1 Domain] = 0:0-1:11 + >----------- +0| settings(): +1| foo = 0 + -----------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| foo = 0 + +[#2 Removal] = 1:4-1:8 + >----< +1| foo = 0 + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| foo = 0 + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| foo = 0 + +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.command.scope b/data/fixtures/scopes/talon/name.command.scope new file mode 100644 index 0000000000..5837b42ede --- /dev/null +++ b/data/fixtures/scopes/talon/name.command.scope @@ -0,0 +1,13 @@ +foo: "bar" +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo: "bar" + +[Domain] = 0:0-0:10 + >----------< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.command2.scope b/data/fixtures/scopes/talon/name.command2.scope new file mode 100644 index 0000000000..05b7110387 --- /dev/null +++ b/data/fixtures/scopes/talon/name.command2.scope @@ -0,0 +1,21 @@ +not mode: command +- +--- + +[Content] = 0:4-0:8 + >----< +0| not mode: command + +[Removal] = 0:3-0:8 + >-----< +0| not mode: command + +[Leading delimiter] = 0:3-0:4 + >-< +0| not mode: command + +[Domain] = 0:0-0:17 + >-----------------< +0| not mode: command + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.command3.scope b/data/fixtures/scopes/talon/name.command3.scope new file mode 100644 index 0000000000..9a3ffb388b --- /dev/null +++ b/data/fixtures/scopes/talon/name.command3.scope @@ -0,0 +1,39 @@ +settings(): + foo = 0 +--- + +[#1 Content] = +[#1 Removal] = 0:0-0:10 + >----------< +0| settings(): + +[#1 Domain] = 0:0-1:11 + >----------- +0| settings(): +1| foo = 0 + -----------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| foo = 0 + +[#2 Removal] = 1:4-1:8 + >----< +1| foo = 0 + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| foo = 0 + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| foo = 0 + +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.field.class.scope b/data/fixtures/scopes/talon/name.field.class.scope deleted file mode 100644 index 10eb5c0a2e..0000000000 --- a/data/fixtures/scopes/talon/name.field.class.scope +++ /dev/null @@ -1,13 +0,0 @@ -aaa [bbb]: bbb or "" ---- - -[Content] = -[Removal] = 0:0-0:9 - >---------< -0| aaa [bbb]: bbb or "" - -[Domain] = 0:0-0:20 - >--------------------< -0| aaa [bbb]: bbb or "" - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/name.variable.scope b/data/fixtures/scopes/talon/name.variable.scope index 30d3997d69..3cddd75f61 100644 --- a/data/fixtures/scopes/talon/name.variable.scope +++ b/data/fixtures/scopes/talon/name.variable.scope @@ -1,5 +1,5 @@ command: - value = 123 + foo = 0 --- [#1 Content] = @@ -7,33 +7,33 @@ command: >-------< 0| command: -[#1 Domain] = 0:0-1:15 +[#1 Domain] = 0:0-1:11 >-------- 0| command: -1| value = 123 - ---------------< +1| foo = 0 + -----------< [#1 Insertion delimiter] = " " -[#2 Content] = 1:4-1:9 - >-----< -1| value = 123 +[#2 Content] = 1:4-1:7 + >---< +1| foo = 0 -[#2 Removal] = 1:4-1:10 - >------< -1| value = 123 +[#2 Removal] = 1:4-1:8 + >----< +1| foo = 0 [#2 Leading delimiter] = 1:0-1:4 >----< -1| value = 123 +1| foo = 0 -[#2 Trailing delimiter] = 1:9-1:10 - >-< -1| value = 123 +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| foo = 0 -[#2 Domain] = 1:4-1:15 - >-----------< -1| value = 123 +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.assignment.scope b/data/fixtures/scopes/talon/value.assignment.scope index 68672dbeda..5587216384 100644 --- a/data/fixtures/scopes/talon/value.assignment.scope +++ b/data/fixtures/scopes/talon/value.assignment.scope @@ -1,44 +1,44 @@ command: - value = 123 + foo = 0 --- -[#1 Content] = 1:4-1:15 - >-----------< -1| value = 123 +[#1 Content] = 1:4-1:11 + >-------< +1| foo = 0 -[#1 Removal] = 0:8-1:15 +[#1 Removal] = 0:8-1:11 > 0| command: -1| value = 123 - ---------------< +1| foo = 0 + -----------< [#1 Leading delimiter] = 1:0-1:4 >----< -1| value = 123 +1| foo = 0 -[#1 Domain] = 0:0-1:15 +[#1 Domain] = 0:0-1:11 >-------- 0| command: -1| value = 123 - ---------------< +1| foo = 0 + -----------< [#1 Insertion delimiter] = " " -[#2 Content] = 1:12-1:15 - >---< -1| value = 123 +[#2 Content] = 1:10-1:11 + >-< +1| foo = 0 -[#2 Removal] = 1:11-1:15 - >----< -1| value = 123 +[#2 Removal] = 1:9-1:11 + >--< +1| foo = 0 -[#2 Leading delimiter] = 1:11-1:12 - >-< -1| value = 123 +[#2 Leading delimiter] = 1:9-1:10 + >-< +1| foo = 0 -[#2 Domain] = 1:4-1:15 - >-----------< -1| value = 123 +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.command.scope b/data/fixtures/scopes/talon/value.command.scope new file mode 100644 index 0000000000..9c2ccb956e --- /dev/null +++ b/data/fixtures/scopes/talon/value.command.scope @@ -0,0 +1,20 @@ +foo: "bar" +--- + +[Content] = 0:5-0:10 + >-----< +0| foo: "bar" + +[Removal] = 0:4-0:10 + >------< +0| foo: "bar" + +[Leading delimiter] = 0:4-0:5 + >-< +0| foo: "bar" + +[Domain] = 0:0-0:10 + >----------< +0| foo: "bar" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.field.class.scope b/data/fixtures/scopes/talon/value.field.class.scope deleted file mode 100644 index ceb1f22c51..0000000000 --- a/data/fixtures/scopes/talon/value.field.class.scope +++ /dev/null @@ -1,20 +0,0 @@ -aaa [bbb]: bbb or "" ---- - -[Content] = 0:11-0:20 - >---------< -0| aaa [bbb]: bbb or "" - -[Removal] = 0:10-0:20 - >----------< -0| aaa [bbb]: bbb or "" - -[Leading delimiter] = 0:10-0:11 - >-< -0| aaa [bbb]: bbb or "" - -[Domain] = 0:0-0:20 - >--------------------< -0| aaa [bbb]: bbb or "" - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.mapPair.scope b/data/fixtures/scopes/talon/value.mapPair.scope new file mode 100644 index 0000000000..e263c7bbd9 --- /dev/null +++ b/data/fixtures/scopes/talon/value.mapPair.scope @@ -0,0 +1,21 @@ +not mode: command +- +--- + +[Content] = 0:10-0:17 + >-------< +0| not mode: command + +[Removal] = 0:9-0:17 + >--------< +0| not mode: command + +[Leading delimiter] = 0:9-0:10 + >-< +0| not mode: command + +[Domain] = 0:0-0:17 + >-----------------< +0| not mode: command + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.mapPair2.scope b/data/fixtures/scopes/talon/value.mapPair2.scope new file mode 100644 index 0000000000..0032aad70d --- /dev/null +++ b/data/fixtures/scopes/talon/value.mapPair2.scope @@ -0,0 +1,44 @@ +settings(): + foo = 0 +--- + +[#1 Content] = 1:4-1:11 + >-------< +1| foo = 0 + +[#1 Removal] = 0:11-1:11 + > +0| settings(): +1| foo = 0 + -----------< + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| foo = 0 + +[#1 Domain] = 0:0-1:11 + >----------- +0| settings(): +1| foo = 0 + -----------< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:10-1:11 + >-< +1| foo = 0 + +[#2 Removal] = 1:9-1:11 + >--< +1| foo = 0 + +[#2 Leading delimiter] = 1:9-1:10 + >-< +1| foo = 0 + +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/value.variable.scope b/data/fixtures/scopes/talon/value.variable.scope index 68672dbeda..5587216384 100644 --- a/data/fixtures/scopes/talon/value.variable.scope +++ b/data/fixtures/scopes/talon/value.variable.scope @@ -1,44 +1,44 @@ command: - value = 123 + foo = 0 --- -[#1 Content] = 1:4-1:15 - >-----------< -1| value = 123 +[#1 Content] = 1:4-1:11 + >-------< +1| foo = 0 -[#1 Removal] = 0:8-1:15 +[#1 Removal] = 0:8-1:11 > 0| command: -1| value = 123 - ---------------< +1| foo = 0 + -----------< [#1 Leading delimiter] = 1:0-1:4 >----< -1| value = 123 +1| foo = 0 -[#1 Domain] = 0:0-1:15 +[#1 Domain] = 0:0-1:11 >-------- 0| command: -1| value = 123 - ---------------< +1| foo = 0 + -----------< [#1 Insertion delimiter] = " " -[#2 Content] = 1:12-1:15 - >---< -1| value = 123 +[#2 Content] = 1:10-1:11 + >-< +1| foo = 0 -[#2 Removal] = 1:11-1:15 - >----< -1| value = 123 +[#2 Removal] = 1:9-1:11 + >--< +1| foo = 0 -[#2 Leading delimiter] = 1:11-1:12 - >-< -1| value = 123 +[#2 Leading delimiter] = 1:9-1:10 + >-< +1| foo = 0 -[#2 Domain] = 1:4-1:15 - >-----------< -1| value = 123 +[#2 Domain] = 1:4-1:11 + >-------< +1| foo = 0 [#2 Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/c.ts b/packages/common/src/scopeSupportFacets/c.ts index 577de97e92..caf4d447b1 100644 --- a/packages/common/src/scopeSupportFacets/c.ts +++ b/packages/common/src/scopeSupportFacets/c.ts @@ -168,6 +168,8 @@ export const cCoreScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, "interior.command": notApplicable, // Type alias diff --git a/packages/common/src/scopeSupportFacets/csharp.ts b/packages/common/src/scopeSupportFacets/csharp.ts index d6f3b5db2e..08db92dfab 100644 --- a/packages/common/src/scopeSupportFacets/csharp.ts +++ b/packages/common/src/scopeSupportFacets/csharp.ts @@ -255,6 +255,8 @@ export const csharpScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, "interior.command": notApplicable, // Notebook cell diff --git a/packages/common/src/scopeSupportFacets/css.ts b/packages/common/src/scopeSupportFacets/css.ts index 339918ad98..dd7b7c09ba 100644 --- a/packages/common/src/scopeSupportFacets/css.ts +++ b/packages/common/src/scopeSupportFacets/css.ts @@ -76,6 +76,12 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "type.iteration.interface": notApplicable, "interior.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.multiLine": notApplicable, "argument.actual.constructor.iteration": notApplicable, @@ -127,7 +133,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try.iteration": notApplicable, "branch.try": notApplicable, - command: notApplicable, "comment.line": notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, @@ -149,7 +154,6 @@ export const cssScopeSupport: LanguageScopeSupportFacetMap = { functionName: notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/html.ts b/packages/common/src/scopeSupportFacets/html.ts index 0452c44915..d35d76d17a 100644 --- a/packages/common/src/scopeSupportFacets/html.ts +++ b/packages/common/src/scopeSupportFacets/html.ts @@ -54,6 +54,12 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + "argument.actual.constructor.iteration": notApplicable, "argument.actual.constructor.singleLine": notApplicable, "argument.actual.constructor.multiLine": notApplicable, @@ -125,7 +131,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, "interior.method": notApplicable, @@ -218,7 +223,6 @@ export const htmlScopeSupport: LanguageScopeSupportFacetMap = { "value.iteration.block": notApplicable, "value.iteration.document": notApplicable, anonymousFunction: notApplicable, - command: notApplicable, disqualifyDelimiter: notApplicable, environment: notApplicable, fieldAccess: notApplicable, diff --git a/packages/common/src/scopeSupportFacets/java.ts b/packages/common/src/scopeSupportFacets/java.ts index e9bb8dcdde..97011eab80 100644 --- a/packages/common/src/scopeSupportFacets/java.ts +++ b/packages/common/src/scopeSupportFacets/java.ts @@ -255,6 +255,8 @@ export const javaScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, "interior.command": notApplicable, // Notebook cell diff --git a/packages/common/src/scopeSupportFacets/javascript.ts b/packages/common/src/scopeSupportFacets/javascript.ts index dce30ca35d..be1c0f176d 100644 --- a/packages/common/src/scopeSupportFacets/javascript.ts +++ b/packages/common/src/scopeSupportFacets/javascript.ts @@ -200,6 +200,8 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, "interior.command": notApplicable, // Notebook cell diff --git a/packages/common/src/scopeSupportFacets/json.ts b/packages/common/src/scopeSupportFacets/json.ts index 32af13777e..59b30bb1a5 100644 --- a/packages/common/src/scopeSupportFacets/json.ts +++ b/packages/common/src/scopeSupportFacets/json.ts @@ -57,6 +57,12 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, "argument.actual.multiLine": notApplicable, @@ -115,7 +121,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "branch.try.iteration": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, - command: notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, "condition.if": notApplicable, @@ -139,7 +144,6 @@ export const jsonScopeSupport: LanguageScopeSupportFacetMap = { "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/markdown.ts b/packages/common/src/scopeSupportFacets/markdown.ts index 95f275abe6..0858783269 100644 --- a/packages/common/src/scopeSupportFacets/markdown.ts +++ b/packages/common/src/scopeSupportFacets/markdown.ts @@ -53,6 +53,12 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, "argument.actual.multiLine": notApplicable, @@ -110,7 +116,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "branch.try": notApplicable, "branch.try.iteration": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, - command: notApplicable, "comment.line": notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, @@ -134,7 +139,6 @@ export const markdownScopeSupport: LanguageScopeSupportFacetMap = { "functionName.iteration.document": notApplicable, "functionName.method": notApplicable, ifStatement: notApplicable, - "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index c560d38cd5..1b5758fc32 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -219,6 +219,8 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { // Command command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, "interior.command": notApplicable, // Namespace diff --git a/packages/common/src/scopeSupportFacets/scm.ts b/packages/common/src/scopeSupportFacets/scm.ts index 5b8b19c01f..98981538b3 100644 --- a/packages/common/src/scopeSupportFacets/scm.ts +++ b/packages/common/src/scopeSupportFacets/scm.ts @@ -59,6 +59,12 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.constructor.singleLine": notApplicable, "argument.actual.constructor.multiLine": notApplicable, @@ -109,7 +115,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, @@ -134,7 +139,6 @@ export const scmScopeSupport: LanguageScopeSupportFacetMap = { "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index fff5e1db83..e2327e0108 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -618,6 +618,10 @@ export const scopeSupportFacetInfos: Record< description: "LHS of an assignment with pattern destructuring", scopeType: "name", }, + "name.command": { + description: "LHS of a command, eg Talon spoken command or bash", + scopeType: "name", + }, "name.variable": { description: "Name (LHS) of a variable declaration", scopeType: "name", @@ -754,6 +758,10 @@ export const scopeSupportFacetInfos: Record< description: "Value (RHS) of an assignment", scopeType: "value", }, + "value.command": { + description: "Value (RHS) of an command, eg Talon spoken command", + scopeType: "value", + }, "value.variable": { description: "Value (RHS) of a variable declaration", scopeType: "value", @@ -985,7 +993,7 @@ export const scopeSupportFacetInfos: Record< scopeType: { type: "interior" }, }, "interior.command": { - description: "The body of a Talon command", + description: "The body of a command, eg Talon spoken command", scopeType: { type: "interior" }, }, "interior.cell": { diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts index af55910dcd..6c8b3237e6 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts @@ -153,6 +153,7 @@ export const scopeSupportFacets = [ "name.assignment", "name.assignment.pattern", + "name.command", "name.variable", "name.variable.pattern", "name.foreach", @@ -184,6 +185,7 @@ export const scopeSupportFacets = [ "key.mapPair.iteration", "value.assignment", + "value.command", "value.variable", "value.variable.pattern", "value.mapPair", diff --git a/packages/common/src/scopeSupportFacets/talon.ts b/packages/common/src/scopeSupportFacets/talon.ts index 4ab0022d00..d2f94d6216 100644 --- a/packages/common/src/scopeSupportFacets/talon.ts +++ b/packages/common/src/scopeSupportFacets/talon.ts @@ -17,6 +17,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.command": supported, "name.assignment": supported, + "name.command": supported, "name.variable": supported, "name.iteration.block": supported, "name.iteration.document": supported, @@ -25,6 +26,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "statement.iteration.document": supported, "value.assignment": supported, + "value.command": supported, "value.variable": supported, "value.iteration.block": supported, "value.iteration.document": supported, @@ -37,9 +39,10 @@ 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, + "key.mapPair": supported, + "key.mapPair.iteration": supported, + "value.mapPair": supported, + "value.mapPair.iteration": supported, /* UNSUPPORTED */ @@ -55,6 +58,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "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, @@ -62,6 +66,7 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "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, @@ -173,8 +178,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "interior.namespace": notApplicable, "interior.static": notApplicable, "key.attribute": notApplicable, - "key.mapPair": notApplicable, - "key.mapPair.iteration": notApplicable, list: notApplicable, map: notApplicable, "name.argument.actual": notApplicable, @@ -238,8 +241,6 @@ export const talonScopeSupport: LanguageScopeSupportFacetMap = { "value.argument.formal.method.iteration": notApplicable, "value.attribute": notApplicable, "value.foreach": notApplicable, - "value.mapPair": notApplicable, - "value.mapPair.iteration": notApplicable, "value.resource": notApplicable, "value.resource.iteration": notApplicable, "value.return": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/xml.ts b/packages/common/src/scopeSupportFacets/xml.ts index 3aef6098ef..77ec8fe322 100644 --- a/packages/common/src/scopeSupportFacets/xml.ts +++ b/packages/common/src/scopeSupportFacets/xml.ts @@ -54,6 +54,12 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, "argument.actual.multiLine": notApplicable, @@ -111,7 +117,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "branch.try.iteration": notApplicable, "collectionItem.unenclosed": notApplicable, "collectionItem.unenclosed.iteration": notApplicable, - command: notApplicable, "comment.line": notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, @@ -134,7 +139,6 @@ export const xmlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, "interior.method": notApplicable, diff --git a/packages/common/src/scopeSupportFacets/yaml.ts b/packages/common/src/scopeSupportFacets/yaml.ts index bb71dbdd75..5d7d715d13 100644 --- a/packages/common/src/scopeSupportFacets/yaml.ts +++ b/packages/common/src/scopeSupportFacets/yaml.ts @@ -63,6 +63,12 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "type.field.interface": notApplicable, "type.iteration.interface": notApplicable, + // Command + command: notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + anonymousFunction: notApplicable, "argument.actual.singleLine": notApplicable, "argument.actual.multiLine": notApplicable, @@ -119,7 +125,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "branch.ternary.iteration": notApplicable, "branch.try": notApplicable, "branch.try.iteration": notApplicable, - command: notApplicable, "comment.block": notApplicable, "condition.doWhile": notApplicable, "condition.for": notApplicable, @@ -143,7 +148,6 @@ export const yamlScopeSupport: LanguageScopeSupportFacetMap = { "functionName.method": notApplicable, ifStatement: notApplicable, "interior.cell": notApplicable, - "interior.command": notApplicable, "interior.element": notApplicable, "interior.function": notApplicable, "interior.constructor": notApplicable, From 0adb98115ae9e6ced8522d05325eb7d55aa479ba Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Thu, 3 Jul 2025 09:49:33 +0200 Subject: [PATCH 2/2] Added missing tests --- .../scopes/talon/key.mapPair.iteration.scope | 20 +++++++++++++++++ .../scopes/talon/key.mapPair.iteration2.scope | 22 +++++++++++++++++++ .../scopes/talon/key.mapPair.iteration3.scope | 20 +++++++++++++++++ .../talon/value.mapPair.iteration.scope | 20 +++++++++++++++++ .../talon/value.mapPair.iteration2.scope | 22 +++++++++++++++++++ .../talon/value.mapPair.iteration3.scope | 20 +++++++++++++++++ 6 files changed, 124 insertions(+) create mode 100644 data/fixtures/scopes/talon/key.mapPair.iteration.scope create mode 100644 data/fixtures/scopes/talon/key.mapPair.iteration2.scope create mode 100644 data/fixtures/scopes/talon/key.mapPair.iteration3.scope create mode 100644 data/fixtures/scopes/talon/value.mapPair.iteration.scope create mode 100644 data/fixtures/scopes/talon/value.mapPair.iteration2.scope create mode 100644 data/fixtures/scopes/talon/value.mapPair.iteration3.scope diff --git a/data/fixtures/scopes/talon/key.mapPair.iteration.scope b/data/fixtures/scopes/talon/key.mapPair.iteration.scope new file mode 100644 index 0000000000..59613730c7 --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair.iteration.scope @@ -0,0 +1,20 @@ +not mode: command +tag: browser +- +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:12 + >----------------- +0| not mode: command +1| tag: browser + ------------< + + +[#2 Range] = +[#2 Domain] = 0:0-2:1 + >----------------- +0| not mode: command +1| tag: browser +2| - + -< diff --git a/data/fixtures/scopes/talon/key.mapPair.iteration2.scope b/data/fixtures/scopes/talon/key.mapPair.iteration2.scope new file mode 100644 index 0000000000..986889b64c --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair.iteration2.scope @@ -0,0 +1,22 @@ +foo: "bar" +baz: "bongo" +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:12 + >---------- +0| foo: "bar" +1| baz: "bongo" + ------------< + + +[#2 Range] = +[#2 Domain] = 0:5-0:10 + >-----< +0| foo: "bar" + + +[#3 Range] = +[#3 Domain] = 1:5-1:12 + >-------< +1| baz: "bongo" diff --git a/data/fixtures/scopes/talon/key.mapPair.iteration3.scope b/data/fixtures/scopes/talon/key.mapPair.iteration3.scope new file mode 100644 index 0000000000..0704368e7e --- /dev/null +++ b/data/fixtures/scopes/talon/key.mapPair.iteration3.scope @@ -0,0 +1,20 @@ +settings(): + foo = 0 + bar = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:11 + >----------- +0| settings(): +1| foo = 0 +2| bar = 0 + -----------< + + +[#2 Range] = +[#2 Domain] = 1:4-2:11 + >------- +1| foo = 0 +2| bar = 0 + -----------< diff --git a/data/fixtures/scopes/talon/value.mapPair.iteration.scope b/data/fixtures/scopes/talon/value.mapPair.iteration.scope new file mode 100644 index 0000000000..59613730c7 --- /dev/null +++ b/data/fixtures/scopes/talon/value.mapPair.iteration.scope @@ -0,0 +1,20 @@ +not mode: command +tag: browser +- +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:12 + >----------------- +0| not mode: command +1| tag: browser + ------------< + + +[#2 Range] = +[#2 Domain] = 0:0-2:1 + >----------------- +0| not mode: command +1| tag: browser +2| - + -< diff --git a/data/fixtures/scopes/talon/value.mapPair.iteration2.scope b/data/fixtures/scopes/talon/value.mapPair.iteration2.scope new file mode 100644 index 0000000000..986889b64c --- /dev/null +++ b/data/fixtures/scopes/talon/value.mapPair.iteration2.scope @@ -0,0 +1,22 @@ +foo: "bar" +baz: "bongo" +--- + +[#1 Range] = +[#1 Domain] = 0:0-1:12 + >---------- +0| foo: "bar" +1| baz: "bongo" + ------------< + + +[#2 Range] = +[#2 Domain] = 0:5-0:10 + >-----< +0| foo: "bar" + + +[#3 Range] = +[#3 Domain] = 1:5-1:12 + >-------< +1| baz: "bongo" diff --git a/data/fixtures/scopes/talon/value.mapPair.iteration3.scope b/data/fixtures/scopes/talon/value.mapPair.iteration3.scope new file mode 100644 index 0000000000..0704368e7e --- /dev/null +++ b/data/fixtures/scopes/talon/value.mapPair.iteration3.scope @@ -0,0 +1,20 @@ +settings(): + foo = 0 + bar = 0 +--- + +[#1 Range] = +[#1 Domain] = 0:0-2:11 + >----------- +0| settings(): +1| foo = 0 +2| bar = 0 + -----------< + + +[#2 Range] = +[#2 Domain] = 1:4-2:11 + >------- +1| foo = 0 +2| bar = 0 + -----------<