diff --git a/data/fixtures/recorded/languages/lua/changeInsideList.yml b/data/fixtures/recorded/languages/lua/changeInsideList.yml deleted file mode 100644 index 06802e045d..0000000000 --- a/data/fixtures/recorded/languages/lua/changeInsideList.yml +++ /dev/null @@ -1,26 +0,0 @@ -languageId: lua -command: - version: 6 - spokenForm: change inside list - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: list} - usePrePhraseSnapshot: true -initialState: - documentContents: | - foo = {"a", "b", "c"}, - selections: - - anchor: {line: 0, character: 9} - active: {line: 0, character: 9} - marks: {} -finalState: - documentContents: | - foo = {}, - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} diff --git a/data/fixtures/recorded/modifiers/changeInsideValue.yml b/data/fixtures/recorded/modifiers/changeInsideValue.yml deleted file mode 100644 index 1510d7bce4..0000000000 --- a/data/fixtures/recorded/modifiers/changeInsideValue.yml +++ /dev/null @@ -1,30 +0,0 @@ -languageId: typescript -command: - version: 7 - spokenForm: change inside value - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - {type: interiorOnly} - - type: containingScope - scopeType: {type: value} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - const aaa = { - bbb: "ccc ddd" - } - selections: - - anchor: {line: 1, character: 4} - active: {line: 1, character: 4} - marks: {} -finalState: - documentContents: |- - const aaa = { - bbb: "" - } - selections: - - anchor: {line: 1, character: 10} - active: {line: 1, character: 10} diff --git a/data/fixtures/recorded/modifiers/changeInside.yml b/data/fixtures/recorded/modifiers/interior/changeInside5.yml similarity index 86% rename from data/fixtures/recorded/modifiers/changeInside.yml rename to data/fixtures/recorded/modifiers/interior/changeInside5.yml index 32454197af..8b325a1692 100644 --- a/data/fixtures/recorded/modifiers/changeInside.yml +++ b/data/fixtures/recorded/modifiers/interior/changeInside5.yml @@ -14,8 +14,8 @@ initialState: def testing(): pass selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} marks: {} finalState: documentContents: |- diff --git a/data/fixtures/recorded/modifiers/interior/changeInsideState.yml b/data/fixtures/recorded/modifiers/interior/changeInsideState.yml new file mode 100644 index 0000000000..221c88f0d4 --- /dev/null +++ b/data/fixtures/recorded/modifiers/interior/changeInsideState.yml @@ -0,0 +1,44 @@ +languageId: javascript +command: + version: 7 + spokenForm: change inside state + action: + name: clearAndSetSelection + target: + type: primitive + modifiers: + - {type: interiorOnly} + - type: containingScope + scopeType: {type: statement} + usePrePhraseSnapshot: false +initialState: + documentContents: |- + if (true) { + a; + } + else if (false) { + b; + } else { + c; + } + selections: + - anchor: {line: 0, character: 0} + active: {line: 0, character: 0} + marks: {} +finalState: + documentContents: |- + if (true) { + + } + else if (false) { + + } else { + + } + selections: + - anchor: {line: 1, character: 4} + active: {line: 1, character: 4} + - anchor: {line: 4, character: 4} + active: {line: 4, character: 4} + - anchor: {line: 6, character: 4} + active: {line: 6, character: 4} diff --git a/data/fixtures/recorded/selectionTypes/changeEveryPaintInsideParen2.yml b/data/fixtures/recorded/selectionTypes/changeEveryPaintInside.yml similarity index 66% rename from data/fixtures/recorded/selectionTypes/changeEveryPaintInsideParen2.yml rename to data/fixtures/recorded/selectionTypes/changeEveryPaintInside.yml index decbb40e90..56617ee2e5 100644 --- a/data/fixtures/recorded/selectionTypes/changeEveryPaintInsideParen2.yml +++ b/data/fixtures/recorded/selectionTypes/changeEveryPaintInside.yml @@ -1,7 +1,7 @@ languageId: plaintext command: version: 6 - spokenForm: change every paint inside paren + spokenForm: change every paint inside action: name: clearAndSetSelection target: @@ -10,17 +10,12 @@ command: - type: everyScope scopeType: {type: nonWhitespaceSequence} - {type: interiorOnly} - mark: {type: decoratedSymbol, symbolColor: default, character: (} usePrePhraseSnapshot: true initialState: documentContents: foo(aa|aa-().c_d bb|bb-().'') { return 1; } selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: - default.(: - start: {line: 0, character: 3} - end: {line: 0, character: 4} + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} finalState: documentContents: " { return 1; }" selections: diff --git a/data/fixtures/recorded/selectionTypes/changeEveryShortPaintInsideParen.yml b/data/fixtures/recorded/selectionTypes/changeEveryShortPaintInside.yml similarity index 65% rename from data/fixtures/recorded/selectionTypes/changeEveryShortPaintInsideParen.yml rename to data/fixtures/recorded/selectionTypes/changeEveryShortPaintInside.yml index 96f413ee3e..d6a13f0ef8 100644 --- a/data/fixtures/recorded/selectionTypes/changeEveryShortPaintInsideParen.yml +++ b/data/fixtures/recorded/selectionTypes/changeEveryShortPaintInside.yml @@ -1,7 +1,7 @@ languageId: plaintext command: version: 6 - spokenForm: change every short paint inside paren + spokenForm: change every short paint inside action: name: clearAndSetSelection target: @@ -10,17 +10,12 @@ command: - type: everyScope scopeType: {type: boundedNonWhitespaceSequence} - {type: interiorOnly} - mark: {type: decoratedSymbol, symbolColor: default, character: (} usePrePhraseSnapshot: true initialState: documentContents: foo(aa|aa-().c_d bb|bb-().'') selections: - - anchor: {line: 0, character: 1} - active: {line: 0, character: 1} - marks: - default.(: - start: {line: 0, character: 3} - end: {line: 0, character: 4} + - anchor: {line: 0, character: 4} + active: {line: 0, character: 4} finalState: documentContents: foo( ) selections: diff --git a/data/fixtures/recorded/selectionTypes/clearCore.yml b/data/fixtures/recorded/selectionTypes/clearCore.yml index 9536406096..8b2d63a3ff 100644 --- a/data/fixtures/recorded/selectionTypes/clearCore.yml +++ b/data/fixtures/recorded/selectionTypes/clearCore.yml @@ -12,8 +12,8 @@ command: initialState: documentContents: ( ) selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} marks: {} finalState: documentContents: () diff --git a/data/fixtures/recorded/selectionTypes/clearCore2.yml b/data/fixtures/recorded/selectionTypes/clearCore2.yml index f7f85daf30..d808ff5589 100644 --- a/data/fixtures/recorded/selectionTypes/clearCore2.yml +++ b/data/fixtures/recorded/selectionTypes/clearCore2.yml @@ -12,8 +12,8 @@ command: initialState: documentContents: () selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} + - anchor: {line: 0, character: 1} + active: {line: 0, character: 1} marks: {} finalState: documentContents: () diff --git a/data/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml b/data/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml index c3605886aa..efd27891a4 100644 --- a/data/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml +++ b/data/fixtures/recorded/surroundingPair/parseTree/python/clearMatching10.yml @@ -14,8 +14,8 @@ initialState: "'jlkjl' 'fsd'" selections: - - anchor: {line: 1, character: 8} - active: {line: 1, character: 8} + - anchor: {line: 1, character: 7} + active: {line: 1, character: 7} marks: {} finalState: documentContents: |- diff --git a/data/fixtures/scopes/c/interior/interior.class.scope b/data/fixtures/scopes/c/interior/interior.class.scope index 8c41d4852e..28c7613e2f 100644 --- a/data/fixtures/scopes/c/interior/interior.class.scope +++ b/data/fixtures/scopes/c/interior/interior.class.scope @@ -1,25 +1,10 @@ struct Foo { }; --- -[#1 Content] = -[#1 Removal] = 0:12-0:13 +[Content] = +[Removal] = +[Domain] = 0:12-0:13 >-< 0| struct Foo { }; -[#1 Domain] = 0:0-0:15 - >---------------< -0| struct Foo { }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:12-0:13 - >-< -0| struct Foo { }; - -[#2 Domain] = 0:11-0:14 - >---< -0| struct Foo { }; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.class2.scope b/data/fixtures/scopes/c/interior/interior.class2.scope index 26260af569..cadd9fe405 100644 --- a/data/fixtures/scopes/c/interior/interior.class2.scope +++ b/data/fixtures/scopes/c/interior/interior.class2.scope @@ -1,25 +1,10 @@ union Foo { }; --- -[#1 Content] = -[#1 Removal] = 0:11-0:12 +[Content] = +[Removal] = +[Domain] = 0:11-0:12 >-< 0| union Foo { }; -[#1 Domain] = 0:0-0:14 - >--------------< -0| union Foo { }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| union Foo { }; - -[#2 Domain] = 0:10-0:13 - >---< -0| union Foo { }; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.class3.scope b/data/fixtures/scopes/c/interior/interior.class3.scope index eee3cb02c2..51f9da360c 100644 --- a/data/fixtures/scopes/c/interior/interior.class3.scope +++ b/data/fixtures/scopes/c/interior/interior.class3.scope @@ -1,25 +1,10 @@ typedef struct { } Foo; --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 0:16-0:17 >-< 0| typedef struct { } Foo; -[#1 Domain] = 0:0-0:23 - >-----------------------< -0| typedef struct { } Foo; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:16-0:17 - >-< -0| typedef struct { } Foo; - -[#2 Domain] = 0:15-0:18 - >---< -0| typedef struct { } Foo; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.class4.scope b/data/fixtures/scopes/c/interior/interior.class4.scope index 43c0d1f6de..d9fbefdaec 100644 --- a/data/fixtures/scopes/c/interior/interior.class4.scope +++ b/data/fixtures/scopes/c/interior/interior.class4.scope @@ -1,25 +1,10 @@ typedef union { } Foo; --- -[#1 Content] = -[#1 Removal] = 0:15-0:16 +[Content] = +[Removal] = +[Domain] = 0:15-0:16 >-< 0| typedef union { } Foo; -[#1 Domain] = 0:0-0:22 - >----------------------< -0| typedef union { } Foo; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:15-0:16 - >-< -0| typedef union { } Foo; - -[#2 Domain] = 0:14-0:17 - >---< -0| typedef union { } Foo; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.doWhile.scope b/data/fixtures/scopes/c/interior/interior.doWhile.scope index d1833e59d1..84fdbc5cc0 100644 --- a/data/fixtures/scopes/c/interior/interior.doWhile.scope +++ b/data/fixtures/scopes/c/interior/interior.doWhile.scope @@ -1,37 +1,10 @@ do { } while (true); --- -[#1 Content] = -[#1 Removal] = 0:4-0:5 +[Content] = +[Removal] = +[Domain] = 0:4-0:5 >-< 0| do { } while (true); -[#1 Domain] = 0:0-0:20 - >--------------------< -0| do { } while (true); - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:4-0:5 - >-< -0| do { } while (true); - -[#2 Domain] = 0:3-0:6 - >---< -0| do { } while (true); - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:18 - >----< -0| do { } while (true); - -[#3 Domain] = 0:13-0:19 - >------< -0| do { } while (true); - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.enum.scope b/data/fixtures/scopes/c/interior/interior.enum.scope index 235154efaf..da2d42970d 100644 --- a/data/fixtures/scopes/c/interior/interior.enum.scope +++ b/data/fixtures/scopes/c/interior/interior.enum.scope @@ -1,25 +1,10 @@ enum Foo { }; --- -[#1 Content] = -[#1 Removal] = 0:10-0:11 +[Content] = +[Removal] = +[Domain] = 0:10-0:11 >-< 0| enum Foo { }; -[#1 Domain] = 0:0-0:13 - >-------------< -0| enum Foo { }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:10-0:11 - >-< -0| enum Foo { }; - -[#2 Domain] = 0:9-0:12 - >---< -0| enum Foo { }; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.enum2.scope b/data/fixtures/scopes/c/interior/interior.enum2.scope index d939ad36f1..e3ae457086 100644 --- a/data/fixtures/scopes/c/interior/interior.enum2.scope +++ b/data/fixtures/scopes/c/interior/interior.enum2.scope @@ -1,25 +1,10 @@ typedef enum { } Foo; --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| typedef enum { } Foo; -[#1 Domain] = 0:0-0:21 - >---------------------< -0| typedef enum { } Foo; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:14-0:15 - >-< -0| typedef enum { } Foo; - -[#2 Domain] = 0:13-0:16 - >---< -0| typedef enum { } Foo; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.for.scope b/data/fixtures/scopes/c/interior/interior.for.scope index e1cf88df36..132becea8a 100644 --- a/data/fixtures/scopes/c/interior/interior.for.scope +++ b/data/fixtures/scopes/c/interior/interior.for.scope @@ -1,37 +1,10 @@ for (int i = 0; i < size; ++i) { } --- -[#1 Content] = -[#1 Removal] = 0:32-0:33 +[Content] = +[Removal] = +[Domain] = 0:32-0:33 >-< 0| for (int i = 0; i < size; ++i) { } -[#1 Domain] = 0:0-0:34 - >----------------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:29 - >------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Domain] = 0:4-0:30 - >--------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:32-0:33 - >-< -0| for (int i = 0; i < size; ++i) { } - -[#3 Domain] = 0:31-0:34 - >---< -0| for (int i = 0; i < size; ++i) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.function.scope b/data/fixtures/scopes/c/interior/interior.function.scope index 55b8aa5f08..8a0c0bc456 100644 --- a/data/fixtures/scopes/c/interior/interior.function.scope +++ b/data/fixtures/scopes/c/interior/interior.function.scope @@ -1,37 +1,10 @@ void foo() { } --- -[#1 Content] = -[#1 Removal] = 0:12-0:13 +[Content] = +[Removal] = +[Domain] = 0:12-0:13 >-< 0| void foo() { } -[#1 Domain] = 0:0-0:14 - >--------------< -0| void foo() { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:9-0:9 - >< -0| void foo() { } - -[#2 Domain] = 0:8-0:10 - >--< -0| void foo() { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:12-0:13 - >-< -0| void foo() { } - -[#3 Domain] = 0:11-0:14 - >---< -0| void foo() { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.function2.scope b/data/fixtures/scopes/c/interior/interior.function2.scope index 17dba94f16..1c598f582d 100644 --- a/data/fixtures/scopes/c/interior/interior.function2.scope +++ b/data/fixtures/scopes/c/interior/interior.function2.scope @@ -1,37 +1,10 @@ void Foo::bar() { } --- -[#1 Content] = -[#1 Removal] = 0:17-0:18 +[Content] = +[Removal] = +[Domain] = 0:17-0:18 >-< 0| void Foo::bar() { } -[#1 Domain] = 0:0-0:19 - >-------------------< -0| void Foo::bar() { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:14-0:14 - >< -0| void Foo::bar() { } - -[#2 Domain] = 0:13-0:15 - >--< -0| void Foo::bar() { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:17-0:18 - >-< -0| void Foo::bar() { } - -[#3 Domain] = 0:16-0:19 - >---< -0| void Foo::bar() { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.if.scope b/data/fixtures/scopes/c/interior/interior.if.scope index 52ac91931a..407453929f 100644 --- a/data/fixtures/scopes/c/interior/interior.if.scope +++ b/data/fixtures/scopes/c/interior/interior.if.scope @@ -4,96 +4,27 @@ else { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 +[#1 Removal] = +[#1 Domain] = 0:11-0:12 >-< 0| if (true) { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| if (true) { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:4-0:8 - >----< -0| if (true) { } - -[#2 Domain] = 0:3-0:9 - >------< -0| if (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:11-0:12 - >-< -0| if (true) { } - -[#3 Domain] = 0:10-0:13 - >---< -0| if (true) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:17-1:18 +[#2 Removal] = +[#2 Domain] = 1:17-1:18 >-< 1| else if (false) { } -[#4 Domain] = 1:0-1:19 - >-------------------< -1| else if (false) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:9-1:14 - >-----< -1| else if (false) { } - -[#5 Domain] = 1:8-1:15 - >-------< -1| else if (false) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 1:17-1:18 - >-< -1| else if (false) { } - -[#6 Domain] = 1:16-1:19 - >---< -1| else if (false) { } - -[#6 Insertion delimiter] = " " - - -[#7 Content] = -[#7 Removal] = 2:6-2:7 - >-< -2| else { } - -[#7 Domain] = 2:0-2:8 - >--------< -2| else { } - -[#7 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#8 Content] = -[#8 Removal] = 2:6-2:7 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:6-2:7 >-< 2| else { } -[#8 Domain] = 2:5-2:8 - >---< -2| else { } - -[#8 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.switch.scope b/data/fixtures/scopes/c/interior/interior.switch.scope index fce2f668fa..92f10c6415 100644 --- a/data/fixtures/scopes/c/interior/interior.switch.scope +++ b/data/fixtures/scopes/c/interior/interior.switch.scope @@ -1,37 +1,10 @@ switch (foo) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| switch (foo) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| switch (foo) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { } - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| switch (foo) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| switch (foo) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.switchCase.scope b/data/fixtures/scopes/c/interior/interior.switchCase.scope index 79eec9b526..1034635c48 100644 --- a/data/fixtures/scopes/c/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/c/interior/interior.switchCase.scope @@ -36,8 +36,8 @@ switch (foo) { 9| } < -[#1 Domain] = 0:0-9:1 - >-------------- +[#1 Domain] = 0:14-9:0 + > 0| switch (foo) { 1| case 0: 2| bar; @@ -48,134 +48,69 @@ switch (foo) { 7| default: 8| break; 9| } - -< + < [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 1:4-8:14 - >------- -1| case 0: +[#2 Content] = 2:8-3:14 + >---- 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; --------------< -[#3 Removal] = 0:14-9:0 - > -0| switch (foo) { -1| case 0: -2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - < - -[#3 Domain] = 0:13-9:1 - >- -0| switch (foo) { +[#2 Removal] = 1:11-3:14 + > 1| case 0: 2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - -< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 2:8-3:14 - >---- -2| bar; 3| break; --------------< -[#4 Domain] = 1:4-3:14 - >------- +[#2 Domain] = 1:11-3:14 + > 1| case 0: 2| bar; 3| break; --------------< -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#5 Content] = 5:8-5:14 +[#3 Content] = 5:8-5:14 >------< 5| break; -[#5 Removal] = 4:13-6:4 +[#3 Removal] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#5 Domain] = 4:4-6:5 - >--------- -4| case 1: { -5| break; -6| } - -----< - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 5:8-5:14 - >------< -5| break; - -[#6 Removal] = 4:13-6:4 +[#3 Domain] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#6 Domain] = 4:12-6:5 - >- -4| case 1: { -5| break; -6| } - -----< - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 8:8-8:14 +[#4 Content] = 8:8-8:14 >------< 8| break; -[#7 Domain] = 7:4-8:14 - >-------- +[#4 Removal] = 7:12-8:14 + > +7| default: +8| break; + --------------< + +[#4 Domain] = 7:12-8:14 + > 7| default: 8| break; --------------< -[#7 Insertion delimiter] = " " +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/c/interior/interior.while.scope b/data/fixtures/scopes/c/interior/interior.while.scope index 3e16181107..1afbe23128 100644 --- a/data/fixtures/scopes/c/interior/interior.while.scope +++ b/data/fixtures/scopes/c/interior/interior.while.scope @@ -1,37 +1,10 @@ while (true) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| while (true) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| while (true) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:11 - >----< -0| while (true) { } - -[#2 Domain] = 0:6-0:12 - >------< -0| while (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| while (true) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| while (true) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.class.scope b/data/fixtures/scopes/cpp/interior/interior.class.scope index 5390112f29..13ef2f4d94 100644 --- a/data/fixtures/scopes/cpp/interior/interior.class.scope +++ b/data/fixtures/scopes/cpp/interior/interior.class.scope @@ -1,25 +1,10 @@ class Foo { } --- -[#1 Content] = -[#1 Removal] = 0:11-0:12 +[Content] = +[Removal] = +[Domain] = 0:11-0:12 >-< 0| class Foo { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| class Foo { } - -[#2 Domain] = 0:10-0:13 - >---< -0| class Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.constructor.scope b/data/fixtures/scopes/cpp/interior/interior.constructor.scope index ff8bba477b..d64baa9016 100644 --- a/data/fixtures/scopes/cpp/interior/interior.constructor.scope +++ b/data/fixtures/scopes/cpp/interior/interior.constructor.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| Foo() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:13 - >---------< -1| Foo() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| Foo() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| Foo() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:11-1:12 - >-< -1| Foo() { } - -[#3 Domain] = 1:4-1:13 - >---------< -1| Foo() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:8-1:8 - >< -1| Foo() { } - -[#4 Domain] = 1:7-1:9 - >--< -1| Foo() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:11-1:12 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:11-1:12 >-< 1| Foo() { } -[#5 Domain] = 1:10-1:13 - >---< -1| Foo() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.enum.scope b/data/fixtures/scopes/cpp/interior/interior.enum.scope index efbe2da153..5db9f44d0c 100644 --- a/data/fixtures/scopes/cpp/interior/interior.enum.scope +++ b/data/fixtures/scopes/cpp/interior/interior.enum.scope @@ -1,25 +1,10 @@ enum class Foo { }; --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 0:16-0:17 >-< 0| enum class Foo { }; -[#1 Domain] = 0:0-0:19 - >-------------------< -0| enum class Foo { }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:16-0:17 - >-< -0| enum class Foo { }; - -[#2 Domain] = 0:15-0:18 - >---< -0| enum class Foo { }; - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.foreach.scope b/data/fixtures/scopes/cpp/interior/interior.foreach.scope index 4d90296637..be709fe126 100644 --- a/data/fixtures/scopes/cpp/interior/interior.foreach.scope +++ b/data/fixtures/scopes/cpp/interior/interior.foreach.scope @@ -1,37 +1,10 @@ for (int v : values) { } --- -[#1 Content] = -[#1 Removal] = 0:22-0:23 +[Content] = +[Removal] = +[Domain] = 0:22-0:23 >-< 0| for (int v : values) { } -[#1 Domain] = 0:0-0:24 - >------------------------< -0| for (int v : values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:19 - >--------------< -0| for (int v : values) { } - -[#2 Domain] = 0:4-0:20 - >----------------< -0| for (int v : values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:22-0:23 - >-< -0| for (int v : values) { } - -[#3 Domain] = 0:21-0:24 - >---< -0| for (int v : values) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.lambda.scope b/data/fixtures/scopes/cpp/interior/interior.lambda.scope index 4334e4c314..9de845ff6b 100644 --- a/data/fixtures/scopes/cpp/interior/interior.lambda.scope +++ b/data/fixtures/scopes/cpp/interior/interior.lambda.scope @@ -1,49 +1,10 @@ []() { }; --- -[#1 Content] = -[#1 Removal] = 0:1-0:1 - >< -0| []() { }; - -[#1 Domain] = 0:0-0:2 - >--< -0| []() { }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:6-0:7 +[Content] = +[Removal] = +[Domain] = 0:6-0:7 >-< 0| []() { }; -[#2 Domain] = 0:0-0:8 - >--------< -0| []() { }; - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:3-0:3 - >< -0| []() { }; - -[#3 Domain] = 0:2-0:4 - >--< -0| []() { }; - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 0:6-0:7 - >-< -0| []() { }; - -[#4 Domain] = 0:5-0:8 - >---< -0| []() { }; - -[#4 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.method.scope b/data/fixtures/scopes/cpp/interior/interior.method.scope index f6ec2af746..bd398f6473 100644 --- a/data/fixtures/scopes/cpp/interior/interior.method.scope +++ b/data/fixtures/scopes/cpp/interior/interior.method.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| void bar() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:18 - >--------------< -1| void bar() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| void bar() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| void bar() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:16-1:17 - >-< -1| void bar() { } - -[#3 Domain] = 1:4-1:18 - >--------------< -1| void bar() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:13-1:13 - >< -1| void bar() { } - -[#4 Domain] = 1:12-1:14 - >--< -1| void bar() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:16-1:17 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:16-1:17 >-< 1| void bar() { } -[#5 Domain] = 1:15-1:18 - >---< -1| void bar() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.namespace.scope b/data/fixtures/scopes/cpp/interior/interior.namespace.scope index 1f9153248c..5c87f527c6 100644 --- a/data/fixtures/scopes/cpp/interior/interior.namespace.scope +++ b/data/fixtures/scopes/cpp/interior/interior.namespace.scope @@ -1,25 +1,10 @@ namespace Foo { } --- -[#1 Content] = -[#1 Removal] = 0:15-0:16 +[Content] = +[Removal] = +[Domain] = 0:15-0:16 >-< 0| namespace Foo { } -[#1 Domain] = 0:0-0:17 - >-----------------< -0| namespace Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:15-0:16 - >-< -0| namespace Foo { } - -[#2 Domain] = 0:14-0:17 - >---< -0| namespace Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/cpp/interior/interior.try.scope b/data/fixtures/scopes/cpp/interior/interior.try.scope index b64cb122de..179938a3ec 100644 --- a/data/fixtures/scopes/cpp/interior/interior.try.scope +++ b/data/fixtures/scopes/cpp/interior/interior.try.scope @@ -3,60 +3,18 @@ catch (const std::exception& e) { } --- [#1 Content] = -[#1 Removal] = 0:5-0:6 +[#1 Removal] = +[#1 Domain] = 0:5-0:6 >-< 0| try { } -[#1 Domain] = 0:0-0:7 - >-------< -0| try { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:5-0:6 - >-< -0| try { } - -[#2 Domain] = 0:4-0:7 - >---< -0| try { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:33-1:34 - >-< -1| catch (const std::exception& e) { } - -[#3 Domain] = 1:0-1:35 - >-----------------------------------< -1| catch (const std::exception& e) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:7-1:30 - >-----------------------< -1| catch (const std::exception& e) { } - -[#4 Domain] = 1:6-1:31 - >-------------------------< -1| catch (const std::exception& e) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:33-1:34 +[#2 Removal] = +[#2 Domain] = 1:33-1:34 >-< 1| catch (const std::exception& e) { } -[#5 Domain] = 1:32-1:35 - >---< -1| catch (const std::exception& e) { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.class.scope b/data/fixtures/scopes/csharp/interior/interior.class.scope index 5390112f29..13ef2f4d94 100644 --- a/data/fixtures/scopes/csharp/interior/interior.class.scope +++ b/data/fixtures/scopes/csharp/interior/interior.class.scope @@ -1,25 +1,10 @@ class Foo { } --- -[#1 Content] = -[#1 Removal] = 0:11-0:12 +[Content] = +[Removal] = +[Domain] = 0:11-0:12 >-< 0| class Foo { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| class Foo { } - -[#2 Domain] = 0:10-0:13 - >---< -0| class Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.constructor.scope b/data/fixtures/scopes/csharp/interior/interior.constructor.scope index 23adf22cbe..babc97caa5 100644 --- a/data/fixtures/scopes/csharp/interior/interior.constructor.scope +++ b/data/fixtures/scopes/csharp/interior/interior.constructor.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| public Foo() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:20 - >----------------< -1| public Foo() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| public Foo() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| public Foo() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:18-1:19 - >-< -1| public Foo() { } - -[#3 Domain] = 1:4-1:20 - >----------------< -1| public Foo() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:15-1:15 - >< -1| public Foo() { } - -[#4 Domain] = 1:14-1:16 - >--< -1| public Foo() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:18-1:19 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:18-1:19 >-< 1| public Foo() { } -[#5 Domain] = 1:17-1:20 - >---< -1| public Foo() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.doWhile.scope b/data/fixtures/scopes/csharp/interior/interior.doWhile.scope index d1833e59d1..84fdbc5cc0 100644 --- a/data/fixtures/scopes/csharp/interior/interior.doWhile.scope +++ b/data/fixtures/scopes/csharp/interior/interior.doWhile.scope @@ -1,37 +1,10 @@ do { } while (true); --- -[#1 Content] = -[#1 Removal] = 0:4-0:5 +[Content] = +[Removal] = +[Domain] = 0:4-0:5 >-< 0| do { } while (true); -[#1 Domain] = 0:0-0:20 - >--------------------< -0| do { } while (true); - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:4-0:5 - >-< -0| do { } while (true); - -[#2 Domain] = 0:3-0:6 - >---< -0| do { } while (true); - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:18 - >----< -0| do { } while (true); - -[#3 Domain] = 0:13-0:19 - >------< -0| do { } while (true); - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.enum.scope b/data/fixtures/scopes/csharp/interior/interior.enum.scope index a5274985e7..d96875b078 100644 --- a/data/fixtures/scopes/csharp/interior/interior.enum.scope +++ b/data/fixtures/scopes/csharp/interior/interior.enum.scope @@ -1,25 +1,10 @@ enum Foo { } --- -[#1 Content] = -[#1 Removal] = 0:10-0:11 +[Content] = +[Removal] = +[Domain] = 0:10-0:11 >-< 0| enum Foo { } -[#1 Domain] = 0:0-0:12 - >------------< -0| enum Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:10-0:11 - >-< -0| enum Foo { } - -[#2 Domain] = 0:9-0:12 - >---< -0| enum Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.for.scope b/data/fixtures/scopes/csharp/interior/interior.for.scope index e1cf88df36..132becea8a 100644 --- a/data/fixtures/scopes/csharp/interior/interior.for.scope +++ b/data/fixtures/scopes/csharp/interior/interior.for.scope @@ -1,37 +1,10 @@ for (int i = 0; i < size; ++i) { } --- -[#1 Content] = -[#1 Removal] = 0:32-0:33 +[Content] = +[Removal] = +[Domain] = 0:32-0:33 >-< 0| for (int i = 0; i < size; ++i) { } -[#1 Domain] = 0:0-0:34 - >----------------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:29 - >------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Domain] = 0:4-0:30 - >--------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:32-0:33 - >-< -0| for (int i = 0; i < size; ++i) { } - -[#3 Domain] = 0:31-0:34 - >---< -0| for (int i = 0; i < size; ++i) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.foreach.scope b/data/fixtures/scopes/csharp/interior/interior.foreach.scope index 13e6cbc8e7..529461c23f 100644 --- a/data/fixtures/scopes/csharp/interior/interior.foreach.scope +++ b/data/fixtures/scopes/csharp/interior/interior.foreach.scope @@ -1,37 +1,10 @@ foreach (int v in values) { } --- -[#1 Content] = -[#1 Removal] = 0:27-0:28 +[Content] = +[Removal] = +[Domain] = 0:27-0:28 >-< 0| foreach (int v in values) { } -[#1 Domain] = 0:0-0:29 - >-----------------------------< -0| foreach (int v in values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:9-0:24 - >---------------< -0| foreach (int v in values) { } - -[#2 Domain] = 0:8-0:25 - >-----------------< -0| foreach (int v in values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:27-0:28 - >-< -0| foreach (int v in values) { } - -[#3 Domain] = 0:26-0:29 - >---< -0| foreach (int v in values) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.function.scope b/data/fixtures/scopes/csharp/interior/interior.function.scope index 1c8b29392b..383258e2c1 100644 --- a/data/fixtures/scopes/csharp/interior/interior.function.scope +++ b/data/fixtures/scopes/csharp/interior/interior.function.scope @@ -1,37 +1,10 @@ void Foo() { } --- -[#1 Content] = -[#1 Removal] = 0:12-0:13 +[Content] = +[Removal] = +[Domain] = 0:12-0:13 >-< 0| void Foo() { } -[#1 Domain] = 0:0-0:14 - >--------------< -0| void Foo() { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:9-0:9 - >< -0| void Foo() { } - -[#2 Domain] = 0:8-0:10 - >--< -0| void Foo() { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:12-0:13 - >-< -0| void Foo() { } - -[#3 Domain] = 0:11-0:14 - >---< -0| void Foo() { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.if.scope b/data/fixtures/scopes/csharp/interior/interior.if.scope index 52ac91931a..407453929f 100644 --- a/data/fixtures/scopes/csharp/interior/interior.if.scope +++ b/data/fixtures/scopes/csharp/interior/interior.if.scope @@ -4,96 +4,27 @@ else { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 +[#1 Removal] = +[#1 Domain] = 0:11-0:12 >-< 0| if (true) { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| if (true) { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:4-0:8 - >----< -0| if (true) { } - -[#2 Domain] = 0:3-0:9 - >------< -0| if (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:11-0:12 - >-< -0| if (true) { } - -[#3 Domain] = 0:10-0:13 - >---< -0| if (true) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:17-1:18 +[#2 Removal] = +[#2 Domain] = 1:17-1:18 >-< 1| else if (false) { } -[#4 Domain] = 1:0-1:19 - >-------------------< -1| else if (false) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:9-1:14 - >-----< -1| else if (false) { } - -[#5 Domain] = 1:8-1:15 - >-------< -1| else if (false) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 1:17-1:18 - >-< -1| else if (false) { } - -[#6 Domain] = 1:16-1:19 - >---< -1| else if (false) { } - -[#6 Insertion delimiter] = " " - - -[#7 Content] = -[#7 Removal] = 2:6-2:7 - >-< -2| else { } - -[#7 Domain] = 2:0-2:8 - >--------< -2| else { } - -[#7 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#8 Content] = -[#8 Removal] = 2:6-2:7 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:6-2:7 >-< 2| else { } -[#8 Domain] = 2:5-2:8 - >---< -2| else { } - -[#8 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.interface.scope b/data/fixtures/scopes/csharp/interior/interior.interface.scope index e213945b2e..87e8ec8e37 100644 --- a/data/fixtures/scopes/csharp/interior/interior.interface.scope +++ b/data/fixtures/scopes/csharp/interior/interior.interface.scope @@ -1,25 +1,10 @@ interface IFoo { } --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 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] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.lambda.scope b/data/fixtures/scopes/csharp/interior/interior.lambda.scope index 1d94e214a0..355508bec5 100644 --- a/data/fixtures/scopes/csharp/interior/interior.lambda.scope +++ b/data/fixtures/scopes/csharp/interior/interior.lambda.scope @@ -1,43 +1,16 @@ () => { foo; }; --- -[#1 Content] = -[#1 Removal] = 0:1-0:1 - >< -0| () => { foo; }; - -[#1 Domain] = 0:0-0:2 - >--< -0| () => { foo; }; - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 0:8-0:12 +[Content] = 0:8-0:12 >----< 0| () => { foo; }; -[#2 Removal] = 0:7-0:13 +[Removal] = 0:7-0:13 >------< 0| () => { foo; }; -[#2 Domain] = 0:0-0:14 - >--------------< -0| () => { foo; }; - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 0:8-0:12 - >----< -0| () => { foo; }; - -[#3 Removal] = 0:7-0:13 +[Domain] = 0:7-0:13 >------< 0| () => { foo; }; -[#3 Domain] = 0:6-0:14 - >--------< -0| () => { foo; }; - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.method.scope b/data/fixtures/scopes/csharp/interior/interior.method.scope index 87ab480019..dae6bb4ef6 100644 --- a/data/fixtures/scopes/csharp/interior/interior.method.scope +++ b/data/fixtures/scopes/csharp/interior/interior.method.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| public void Bar() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:25 - >---------------------< -1| public void Bar() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| public void Bar() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| public void Bar() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:23-1:24 - >-< -1| public void Bar() { } - -[#3 Domain] = 1:4-1:25 - >---------------------< -1| public void Bar() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:20-1:20 - >< -1| public void Bar() { } - -[#4 Domain] = 1:19-1:21 - >--< -1| public void Bar() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:23-1:24 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:23-1:24 >-< 1| public void Bar() { } -[#5 Domain] = 1:22-1:25 - >---< -1| public void Bar() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.switch.scope b/data/fixtures/scopes/csharp/interior/interior.switch.scope index fce2f668fa..92f10c6415 100644 --- a/data/fixtures/scopes/csharp/interior/interior.switch.scope +++ b/data/fixtures/scopes/csharp/interior/interior.switch.scope @@ -1,37 +1,10 @@ switch (foo) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| switch (foo) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| switch (foo) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { } - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| switch (foo) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| switch (foo) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.switchCase.scope b/data/fixtures/scopes/csharp/interior/interior.switchCase.scope index 79eec9b526..1034635c48 100644 --- a/data/fixtures/scopes/csharp/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/csharp/interior/interior.switchCase.scope @@ -36,8 +36,8 @@ switch (foo) { 9| } < -[#1 Domain] = 0:0-9:1 - >-------------- +[#1 Domain] = 0:14-9:0 + > 0| switch (foo) { 1| case 0: 2| bar; @@ -48,134 +48,69 @@ switch (foo) { 7| default: 8| break; 9| } - -< + < [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 1:4-8:14 - >------- -1| case 0: +[#2 Content] = 2:8-3:14 + >---- 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; --------------< -[#3 Removal] = 0:14-9:0 - > -0| switch (foo) { -1| case 0: -2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - < - -[#3 Domain] = 0:13-9:1 - >- -0| switch (foo) { +[#2 Removal] = 1:11-3:14 + > 1| case 0: 2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - -< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 2:8-3:14 - >---- -2| bar; 3| break; --------------< -[#4 Domain] = 1:4-3:14 - >------- +[#2 Domain] = 1:11-3:14 + > 1| case 0: 2| bar; 3| break; --------------< -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#5 Content] = 5:8-5:14 +[#3 Content] = 5:8-5:14 >------< 5| break; -[#5 Removal] = 4:13-6:4 +[#3 Removal] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#5 Domain] = 4:4-6:5 - >--------- -4| case 1: { -5| break; -6| } - -----< - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 5:8-5:14 - >------< -5| break; - -[#6 Removal] = 4:13-6:4 +[#3 Domain] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#6 Domain] = 4:12-6:5 - >- -4| case 1: { -5| break; -6| } - -----< - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 8:8-8:14 +[#4 Content] = 8:8-8:14 >------< 8| break; -[#7 Domain] = 7:4-8:14 - >-------- +[#4 Removal] = 7:12-8:14 + > +7| default: +8| break; + --------------< + +[#4 Domain] = 7:12-8:14 + > 7| default: 8| break; --------------< -[#7 Insertion delimiter] = " " +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.try.scope b/data/fixtures/scopes/csharp/interior/interior.try.scope index ae38809df4..90d785795c 100644 --- a/data/fixtures/scopes/csharp/interior/interior.try.scope +++ b/data/fixtures/scopes/csharp/interior/interior.try.scope @@ -4,84 +4,27 @@ finally { } --- [#1 Content] = -[#1 Removal] = 0:5-0:6 +[#1 Removal] = +[#1 Domain] = 0:5-0:6 >-< 0| try { } -[#1 Domain] = 0:0-0:7 - >-------< -0| try { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:5-0:6 - >-< -0| try { } - -[#2 Domain] = 0:4-0:7 - >---< -0| try { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:20-1:21 +[#2 Removal] = +[#2 Domain] = 1:20-1:21 >-< 1| catch(Exception e) { } -[#3 Domain] = 1:0-1:22 - >----------------------< -1| catch(Exception e) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:6-1:17 - >-----------< -1| catch(Exception e) { } - -[#4 Domain] = 1:5-1:18 - >-------------< -1| catch(Exception e) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:20-1:21 - >-< -1| catch(Exception e) { } - -[#5 Domain] = 1:19-1:22 - >---< -1| catch(Exception e) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 2:9-2:10 - >-< -2| finally { } - -[#6 Domain] = 2:0-2:11 - >-----------< -2| finally { } - -[#6 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 2:9-2:10 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:9-2:10 >-< 2| finally { } -[#7 Domain] = 2:8-2:11 - >---< -2| finally { } - -[#7 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/csharp/interior/interior.while.scope b/data/fixtures/scopes/csharp/interior/interior.while.scope index 3e16181107..1afbe23128 100644 --- a/data/fixtures/scopes/csharp/interior/interior.while.scope +++ b/data/fixtures/scopes/csharp/interior/interior.while.scope @@ -1,37 +1,10 @@ while (true) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| while (true) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| while (true) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:11 - >----< -0| while (true) { } - -[#2 Domain] = 0:6-0:12 - >------< -0| while (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| while (true) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| while (true) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/html/interior.element.scope b/data/fixtures/scopes/html/interior.element.scope index 74c625a413..9f9283d847 100644 --- a/data/fixtures/scopes/html/interior.element.scope +++ b/data/fixtures/scopes/html/interior.element.scope @@ -1,37 +1,10 @@
--- -[#1 Content] = -[#1 Removal] = 0:1-0:4 - >---< -0|
- -[#1 Domain] = 0:0-0:5 - >-----< -0|
- -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:6 +[Content] = +[Removal] = +[Domain] = 0:5-0:6 >-< 0|
-[#2 Domain] = 0:0-0:12 - >------------< -0|
- -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:8-0:11 - >---< -0|
- -[#3 Domain] = 0:6-0:12 - >------< -0|
- -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.class.scope b/data/fixtures/scopes/java/interior/interior.class.scope index 48ed5df4de..eb86a1744f 100644 --- a/data/fixtures/scopes/java/interior/interior.class.scope +++ b/data/fixtures/scopes/java/interior/interior.class.scope @@ -1,25 +1,10 @@ public class Foo { } --- -[#1 Content] = -[#1 Removal] = 0:18-0:19 +[Content] = +[Removal] = +[Domain] = 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] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.constructor.scope b/data/fixtures/scopes/java/interior/interior.constructor.scope index d14e67d342..bcbf1899fe 100644 --- a/data/fixtures/scopes/java/interior/interior.constructor.scope +++ b/data/fixtures/scopes/java/interior/interior.constructor.scope @@ -14,68 +14,20 @@ public class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >------------------ -0| public class Foo { -1| public Foo() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:20 - >----------------< -1| public Foo() { } - -[#2 Removal] = 0:18-2:0 +[#1 Domain] = 0:18-2:0 > 0| public class Foo { 1| public Foo() { } 2| } < -[#2 Domain] = 0:17-2:1 - >- -0| public class Foo { -1| public Foo() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:18-1:19 - >-< -1| public Foo() { } - -[#3 Domain] = 1:4-1:20 - >----------------< -1| public Foo() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:15-1:15 - >< -1| public Foo() { } - -[#4 Domain] = 1:14-1:16 - >--< -1| public Foo() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:18-1:19 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:18-1:19 >-< 1| public Foo() { } -[#5 Domain] = 1:17-1:20 - >---< -1| public Foo() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.doWhile.scope b/data/fixtures/scopes/java/interior/interior.doWhile.scope index d1833e59d1..84fdbc5cc0 100644 --- a/data/fixtures/scopes/java/interior/interior.doWhile.scope +++ b/data/fixtures/scopes/java/interior/interior.doWhile.scope @@ -1,37 +1,10 @@ do { } while (true); --- -[#1 Content] = -[#1 Removal] = 0:4-0:5 +[Content] = +[Removal] = +[Domain] = 0:4-0:5 >-< 0| do { } while (true); -[#1 Domain] = 0:0-0:20 - >--------------------< -0| do { } while (true); - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:4-0:5 - >-< -0| do { } while (true); - -[#2 Domain] = 0:3-0:6 - >---< -0| do { } while (true); - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:18 - >----< -0| do { } while (true); - -[#3 Domain] = 0:13-0:19 - >------< -0| do { } while (true); - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.enum.scope b/data/fixtures/scopes/java/interior/interior.enum.scope index 3f2fdbd802..6818ae7bf5 100644 --- a/data/fixtures/scopes/java/interior/interior.enum.scope +++ b/data/fixtures/scopes/java/interior/interior.enum.scope @@ -1,25 +1,10 @@ public enum Foo { } --- -[#1 Content] = -[#1 Removal] = 0:17-0:18 +[Content] = +[Removal] = +[Domain] = 0:17-0:18 >-< 0| public enum Foo { } -[#1 Domain] = 0:0-0:19 - >-------------------< -0| public enum Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:17-0:18 - >-< -0| public enum Foo { } - -[#2 Domain] = 0:16-0:19 - >---< -0| public enum Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.for.scope b/data/fixtures/scopes/java/interior/interior.for.scope index e1cf88df36..132becea8a 100644 --- a/data/fixtures/scopes/java/interior/interior.for.scope +++ b/data/fixtures/scopes/java/interior/interior.for.scope @@ -1,37 +1,10 @@ for (int i = 0; i < size; ++i) { } --- -[#1 Content] = -[#1 Removal] = 0:32-0:33 +[Content] = +[Removal] = +[Domain] = 0:32-0:33 >-< 0| for (int i = 0; i < size; ++i) { } -[#1 Domain] = 0:0-0:34 - >----------------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:29 - >------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Domain] = 0:4-0:30 - >--------------------------< -0| for (int i = 0; i < size; ++i) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:32-0:33 - >-< -0| for (int i = 0; i < size; ++i) { } - -[#3 Domain] = 0:31-0:34 - >---< -0| for (int i = 0; i < size; ++i) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.foreach.scope b/data/fixtures/scopes/java/interior/interior.foreach.scope index 4d90296637..be709fe126 100644 --- a/data/fixtures/scopes/java/interior/interior.foreach.scope +++ b/data/fixtures/scopes/java/interior/interior.foreach.scope @@ -1,37 +1,10 @@ for (int v : values) { } --- -[#1 Content] = -[#1 Removal] = 0:22-0:23 +[Content] = +[Removal] = +[Domain] = 0:22-0:23 >-< 0| for (int v : values) { } -[#1 Domain] = 0:0-0:24 - >------------------------< -0| for (int v : values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:19 - >--------------< -0| for (int v : values) { } - -[#2 Domain] = 0:4-0:20 - >----------------< -0| for (int v : values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:22-0:23 - >-< -0| for (int v : values) { } - -[#3 Domain] = 0:21-0:24 - >---< -0| for (int v : values) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.if.scope b/data/fixtures/scopes/java/interior/interior.if.scope index 52ac91931a..407453929f 100644 --- a/data/fixtures/scopes/java/interior/interior.if.scope +++ b/data/fixtures/scopes/java/interior/interior.if.scope @@ -4,96 +4,27 @@ else { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 +[#1 Removal] = +[#1 Domain] = 0:11-0:12 >-< 0| if (true) { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| if (true) { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:4-0:8 - >----< -0| if (true) { } - -[#2 Domain] = 0:3-0:9 - >------< -0| if (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:11-0:12 - >-< -0| if (true) { } - -[#3 Domain] = 0:10-0:13 - >---< -0| if (true) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:17-1:18 +[#2 Removal] = +[#2 Domain] = 1:17-1:18 >-< 1| else if (false) { } -[#4 Domain] = 1:0-1:19 - >-------------------< -1| else if (false) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:9-1:14 - >-----< -1| else if (false) { } - -[#5 Domain] = 1:8-1:15 - >-------< -1| else if (false) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 1:17-1:18 - >-< -1| else if (false) { } - -[#6 Domain] = 1:16-1:19 - >---< -1| else if (false) { } - -[#6 Insertion delimiter] = " " - - -[#7 Content] = -[#7 Removal] = 2:6-2:7 - >-< -2| else { } - -[#7 Domain] = 2:0-2:8 - >--------< -2| else { } - -[#7 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#8 Content] = -[#8 Removal] = 2:6-2:7 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:6-2:7 >-< 2| else { } -[#8 Domain] = 2:5-2:8 - >---< -2| else { } - -[#8 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.interface.scope b/data/fixtures/scopes/java/interior/interior.interface.scope index cf483fb76d..ee0b6c177f 100644 --- a/data/fixtures/scopes/java/interior/interior.interface.scope +++ b/data/fixtures/scopes/java/interior/interior.interface.scope @@ -1,25 +1,10 @@ public interface Foo { } --- -[#1 Content] = -[#1 Removal] = 0:22-0:23 +[Content] = +[Removal] = +[Domain] = 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] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.lambda.scope b/data/fixtures/scopes/java/interior/interior.lambda.scope index 3066da5e6b..e3d16ca4a1 100644 --- a/data/fixtures/scopes/java/interior/interior.lambda.scope +++ b/data/fixtures/scopes/java/interior/interior.lambda.scope @@ -1,37 +1,10 @@ () -> { } --- -[#1 Content] = -[#1 Removal] = 0:1-0:1 - >< -0| () -> { } - -[#1 Domain] = 0:0-0:2 - >--< -0| () -> { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:8 +[Content] = +[Removal] = +[Domain] = 0:7-0:8 >-< 0| () -> { } -[#2 Domain] = 0:0-0:9 - >---------< -0| () -> { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:7-0:8 - >-< -0| () -> { } - -[#3 Domain] = 0:6-0:9 - >---< -0| () -> { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.method.scope b/data/fixtures/scopes/java/interior/interior.method.scope index 646639ab38..bc30c69903 100644 --- a/data/fixtures/scopes/java/interior/interior.method.scope +++ b/data/fixtures/scopes/java/interior/interior.method.scope @@ -14,68 +14,20 @@ public class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >------------------ -0| public class Foo { -1| public void bar() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:25 - >---------------------< -1| public void bar() { } - -[#2 Removal] = 0:18-2:0 +[#1 Domain] = 0:18-2:0 > 0| public class Foo { 1| public void bar() { } 2| } < -[#2 Domain] = 0:17-2:1 - >- -0| public class Foo { -1| public void bar() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:23-1:24 - >-< -1| public void bar() { } - -[#3 Domain] = 1:4-1:25 - >---------------------< -1| public void bar() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:20-1:20 - >< -1| public void bar() { } - -[#4 Domain] = 1:19-1:21 - >--< -1| public void bar() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:23-1:24 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:23-1:24 >-< 1| public void bar() { } -[#5 Domain] = 1:22-1:25 - >---< -1| public void bar() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.resource.scope b/data/fixtures/scopes/java/interior/interior.resource.scope index e487b6ad51..cb4cf86b96 100644 --- a/data/fixtures/scopes/java/interior/interior.resource.scope +++ b/data/fixtures/scopes/java/interior/interior.resource.scope @@ -1,49 +1,10 @@ try (Foo bar = create()) { } --- -[#1 Content] = -[#1 Removal] = 0:26-0:27 +[Content] = +[Removal] = +[Domain] = 0:26-0:27 >-< 0| try (Foo bar = create()) { } -[#1 Domain] = 0:0-0:28 - >----------------------------< -0| try (Foo bar = create()) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:23 - >------------------< -0| try (Foo bar = create()) { } - -[#2 Domain] = 0:4-0:24 - >--------------------< -0| try (Foo bar = create()) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:22-0:22 - >< -0| try (Foo bar = create()) { } - -[#3 Domain] = 0:21-0:23 - >--< -0| try (Foo bar = create()) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 0:26-0:27 - >-< -0| try (Foo bar = create()) { } - -[#4 Domain] = 0:25-0:28 - >---< -0| try (Foo bar = create()) { } - -[#4 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.static.scope b/data/fixtures/scopes/java/interior/interior.static.scope index ec08e00aa5..7faf9b8a6c 100644 --- a/data/fixtures/scopes/java/interior/interior.static.scope +++ b/data/fixtures/scopes/java/interior/interior.static.scope @@ -14,56 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| static { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:14 - >----------< -1| static { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| static { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| static { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:12-1:13 - >-< -1| static { } - -[#3 Domain] = 1:4-1:14 - >----------< -1| static { } - -[#3 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#4 Content] = -[#4 Removal] = 1:12-1:13 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:12-1:13 >-< 1| static { } -[#4 Domain] = 1:11-1:14 - >---< -1| static { } - -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.switch.scope b/data/fixtures/scopes/java/interior/interior.switch.scope index e2ad168b18..516c60576b 100644 --- a/data/fixtures/scopes/java/interior/interior.switch.scope +++ b/data/fixtures/scopes/java/interior/interior.switch.scope @@ -1,37 +1,10 @@ switch (value) { } --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 0:16-0:17 >-< 0| switch (value) { } -[#1 Domain] = 0:0-0:18 - >------------------< -0| switch (value) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:13 - >-----< -0| switch (value) { } - -[#2 Domain] = 0:7-0:14 - >-------< -0| switch (value) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:16-0:17 - >-< -0| switch (value) { } - -[#3 Domain] = 0:15-0:18 - >---< -0| switch (value) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.switchCase.scope b/data/fixtures/scopes/java/interior/interior.switchCase.scope index 58797959fa..7e04299152 100644 --- a/data/fixtures/scopes/java/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/java/interior/interior.switchCase.scope @@ -36,8 +36,8 @@ switch (value) { 9| } < -[#1 Domain] = 0:0-9:1 - >---------------- +[#1 Domain] = 0:16-9:0 + > 0| switch (value) { 1| case 0: 2| foo; @@ -48,134 +48,69 @@ switch (value) { 7| default: 8| break; 9| } - -< + < [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 0:8-0:13 - >-----< -0| switch (value) { - -[#2 Domain] = 0:7-0:14 - >-------< -0| switch (value) { - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 1:4-8:14 - >------- -1| case 0: +[#2 Content] = 2:8-3:14 + >---- 2| foo; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; --------------< -[#3 Removal] = 0:16-9:0 - > -0| switch (value) { -1| case 0: -2| foo; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - < - -[#3 Domain] = 0:15-9:1 - >- -0| switch (value) { +[#2 Removal] = 1:11-3:14 + > 1| case 0: 2| foo; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - -< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 2:8-3:14 - >---- -2| foo; 3| break; --------------< -[#4 Domain] = 1:4-3:14 - >------- +[#2 Domain] = 1:11-3:14 + > 1| case 0: 2| foo; 3| break; --------------< -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#5 Content] = 5:8-5:14 +[#3 Content] = 5:8-5:14 >------< 5| break; -[#5 Removal] = 4:13-6:4 +[#3 Removal] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#5 Domain] = 4:4-6:5 - >--------- -4| case 1: { -5| break; -6| } - -----< - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 5:8-5:14 - >------< -5| break; - -[#6 Removal] = 4:13-6:4 +[#3 Domain] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#6 Domain] = 4:12-6:5 - >- -4| case 1: { -5| break; -6| } - -----< - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 8:8-8:14 +[#4 Content] = 8:8-8:14 >------< 8| break; -[#7 Domain] = 7:4-8:14 - >-------- +[#4 Removal] = 7:12-8:14 + > +7| default: +8| break; + --------------< + +[#4 Domain] = 7:12-8:14 + > 7| default: 8| break; --------------< -[#7 Insertion delimiter] = " " +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.switchCase2.scope b/data/fixtures/scopes/java/interior/interior.switchCase2.scope index a0e22c3b8b..14e1e2fc6d 100644 --- a/data/fixtures/scopes/java/interior/interior.switchCase2.scope +++ b/data/fixtures/scopes/java/interior/interior.switchCase2.scope @@ -27,42 +27,7 @@ switch (foo) { 6| } < -[#1 Domain] = 0:0-6:1 - >-------------- -0| switch (foo) { -1| case 0 -> 1; -2| case 1 -> { -3| yield 2; -4| }; -5| default -> 3; -6| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 1:4-5:17 - >------------ -1| case 0 -> 1; -2| case 1 -> { -3| yield 2; -4| }; -5| default -> 3; - -----------------< - -[#3 Removal] = 0:14-6:0 +[#1 Domain] = 0:14-6:0 > 0| switch (foo) { 1| case 0 -> 1; @@ -73,81 +38,55 @@ switch (foo) { 6| } < -[#3 Domain] = 0:13-6:1 - >- -0| switch (foo) { -1| case 0 -> 1; -2| case 1 -> { -3| yield 2; -4| }; -5| default -> 3; -6| } - -< - -[#3 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#4 Content] = -[#4 Removal] = 1:14-1:16 +[#2 Content] = 1:14-1:16 >--< 1| case 0 -> 1; -[#4 Domain] = 1:4-1:16 - >------------< +[#2 Removal] = 1:13-1:16 + >---< 1| case 0 -> 1; -[#4 Insertion delimiter] = " " +[#2 Domain] = 1:13-1:16 + >---< +1| case 0 -> 1; + +[#2 Insertion delimiter] = " " -[#5 Content] = 3:8-3:16 +[#3 Content] = 3:8-3:16 >--------< 3| yield 2; -[#5 Removal] = 2:15-4:4 +[#3 Removal] = 2:15-4:4 > 2| case 1 -> { 3| yield 2; 4| }; ----< -[#5 Domain] = 2:4-4:5 - >----------- -2| case 1 -> { -3| yield 2; -4| }; - -----< - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 3:8-3:16 - >--------< -3| yield 2; - -[#6 Removal] = 2:15-4:4 +[#3 Domain] = 2:15-4:4 > 2| case 1 -> { 3| yield 2; 4| }; ----< -[#6 Domain] = 2:14-4:5 - >- -2| case 1 -> { -3| yield 2; -4| }; - -----< - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 5:15-5:17 +[#4 Content] = 5:15-5:17 >--< 5| default -> 3; -[#7 Domain] = 5:4-5:17 - >-------------< +[#4 Removal] = 5:14-5:17 + >---< 5| default -> 3; -[#7 Insertion delimiter] = " " +[#4 Domain] = 5:14-5:17 + >---< +5| default -> 3; + +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.try.scope b/data/fixtures/scopes/java/interior/interior.try.scope index 87dc4ae08a..d8b8697ede 100644 --- a/data/fixtures/scopes/java/interior/interior.try.scope +++ b/data/fixtures/scopes/java/interior/interior.try.scope @@ -4,84 +4,27 @@ finally { } --- [#1 Content] = -[#1 Removal] = 0:5-0:6 +[#1 Removal] = +[#1 Domain] = 0:5-0:6 >-< 0| try { } -[#1 Domain] = 0:0-0:7 - >-------< -0| try { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:5-0:6 - >-< -0| try { } - -[#2 Domain] = 0:4-0:7 - >---< -0| try { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:21-1:22 +[#2 Removal] = +[#2 Domain] = 1:21-1:22 >-< 1| catch(Exception ex) { } -[#3 Domain] = 1:0-1:23 - >-----------------------< -1| catch(Exception ex) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:6-1:18 - >------------< -1| catch(Exception ex) { } - -[#4 Domain] = 1:5-1:19 - >--------------< -1| catch(Exception ex) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:21-1:22 - >-< -1| catch(Exception ex) { } - -[#5 Domain] = 1:20-1:23 - >---< -1| catch(Exception ex) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 2:9-2:10 - >-< -2| finally { } - -[#6 Domain] = 2:0-2:11 - >-----------< -2| finally { } - -[#6 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 2:9-2:10 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:9-2:10 >-< 2| finally { } -[#7 Domain] = 2:8-2:11 - >---< -2| finally { } - -[#7 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/java/interior/interior.while.scope b/data/fixtures/scopes/java/interior/interior.while.scope index 3e16181107..1afbe23128 100644 --- a/data/fixtures/scopes/java/interior/interior.while.scope +++ b/data/fixtures/scopes/java/interior/interior.while.scope @@ -1,37 +1,10 @@ while (true) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| while (true) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| while (true) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:11 - >----< -0| while (true) { } - -[#2 Domain] = 0:6-0:12 - >------< -0| while (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| while (true) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| while (true) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.class.scope b/data/fixtures/scopes/javascript.core/interior/interior.class.scope index 5390112f29..13ef2f4d94 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.class.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.class.scope @@ -1,25 +1,10 @@ class Foo { } --- -[#1 Content] = -[#1 Removal] = 0:11-0:12 +[Content] = +[Removal] = +[Domain] = 0:11-0:12 >-< 0| class Foo { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| class Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:11-0:12 - >-< -0| class Foo { } - -[#2 Domain] = 0:10-0:13 - >---< -0| class Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.constructor.scope b/data/fixtures/scopes/javascript.core/interior/interior.constructor.scope index 7e12a56c03..31fb4f8777 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.constructor.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.constructor.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| constructor() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:21 - >-----------------< -1| constructor() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| constructor() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| constructor() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:19-1:20 - >-< -1| constructor() { } - -[#3 Domain] = 1:4-1:21 - >-----------------< -1| constructor() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:16-1:16 - >< -1| constructor() { } - -[#4 Domain] = 1:15-1:17 - >--< -1| constructor() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:19-1:20 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:19-1:20 >-< 1| constructor() { } -[#5 Domain] = 1:18-1:21 - >---< -1| constructor() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.doWhile.scope b/data/fixtures/scopes/javascript.core/interior/interior.doWhile.scope index d1833e59d1..84fdbc5cc0 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.doWhile.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.doWhile.scope @@ -1,37 +1,10 @@ do { } while (true); --- -[#1 Content] = -[#1 Removal] = 0:4-0:5 +[Content] = +[Removal] = +[Domain] = 0:4-0:5 >-< 0| do { } while (true); -[#1 Domain] = 0:0-0:20 - >--------------------< -0| do { } while (true); - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:4-0:5 - >-< -0| do { } while (true); - -[#2 Domain] = 0:3-0:6 - >---< -0| do { } while (true); - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:18 - >----< -0| do { } while (true); - -[#3 Domain] = 0:13-0:19 - >------< -0| do { } while (true); - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.for.scope b/data/fixtures/scopes/javascript.core/interior/interior.for.scope index e9ae933299..cdeeaeedef 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.for.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.for.scope @@ -1,37 +1,10 @@ for (let i = 0; i < size; ++i) { } --- -[#1 Content] = -[#1 Removal] = 0:32-0:33 +[Content] = +[Removal] = +[Domain] = 0:32-0:33 >-< 0| for (let i = 0; i < size; ++i) { } -[#1 Domain] = 0:0-0:34 - >----------------------------------< -0| for (let i = 0; i < size; ++i) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:29 - >------------------------< -0| for (let i = 0; i < size; ++i) { } - -[#2 Domain] = 0:4-0:30 - >--------------------------< -0| for (let i = 0; i < size; ++i) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:32-0:33 - >-< -0| for (let i = 0; i < size; ++i) { } - -[#3 Domain] = 0:31-0:34 - >---< -0| for (let i = 0; i < size; ++i) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.foreach.scope b/data/fixtures/scopes/javascript.core/interior/interior.foreach.scope index c440342398..a734e56176 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.foreach.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.foreach.scope @@ -1,37 +1,10 @@ for (const v of values) { } --- -[#1 Content] = -[#1 Removal] = 0:25-0:26 +[Content] = +[Removal] = +[Domain] = 0:25-0:26 >-< 0| for (const v of values) { } -[#1 Domain] = 0:0-0:27 - >---------------------------< -0| for (const v of values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:22 - >-----------------< -0| for (const v of values) { } - -[#2 Domain] = 0:4-0:23 - >-------------------< -0| for (const v of values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:25-0:26 - >-< -0| for (const v of values) { } - -[#3 Domain] = 0:24-0:27 - >---< -0| for (const v of values) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.foreach2.scope b/data/fixtures/scopes/javascript.core/interior/interior.foreach2.scope index 83dc8c49b5..314ceaed82 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.foreach2.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.foreach2.scope @@ -1,37 +1,10 @@ for (const k in values) { } --- -[#1 Content] = -[#1 Removal] = 0:25-0:26 +[Content] = +[Removal] = +[Domain] = 0:25-0:26 >-< 0| for (const k in values) { } -[#1 Domain] = 0:0-0:27 - >---------------------------< -0| for (const k in values) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:22 - >-----------------< -0| for (const k in values) { } - -[#2 Domain] = 0:4-0:23 - >-------------------< -0| for (const k in values) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:25-0:26 - >-< -0| for (const k in values) { } - -[#3 Domain] = 0:24-0:27 - >---< -0| for (const k in values) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.function.scope b/data/fixtures/scopes/javascript.core/interior/interior.function.scope index 1a87486f13..52fbd14290 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.function.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.function.scope @@ -1,37 +1,10 @@ function foo() { } --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 0:16-0:17 >-< 0| function foo() { } -[#1 Domain] = 0:0-0:18 - >------------------< -0| function foo() { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:13-0:13 - >< -0| function foo() { } - -[#2 Domain] = 0:12-0:14 - >--< -0| function foo() { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:16-0:17 - >-< -0| function foo() { } - -[#3 Domain] = 0:15-0:18 - >---< -0| function foo() { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.if.scope b/data/fixtures/scopes/javascript.core/interior/interior.if.scope index 52ac91931a..407453929f 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.if.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.if.scope @@ -4,96 +4,27 @@ else { } --- [#1 Content] = -[#1 Removal] = 0:11-0:12 +[#1 Removal] = +[#1 Domain] = 0:11-0:12 >-< 0| if (true) { } -[#1 Domain] = 0:0-0:13 - >-------------< -0| if (true) { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:4-0:8 - >----< -0| if (true) { } - -[#2 Domain] = 0:3-0:9 - >------< -0| if (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:11-0:12 - >-< -0| if (true) { } - -[#3 Domain] = 0:10-0:13 - >---< -0| if (true) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:17-1:18 +[#2 Removal] = +[#2 Domain] = 1:17-1:18 >-< 1| else if (false) { } -[#4 Domain] = 1:0-1:19 - >-------------------< -1| else if (false) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:9-1:14 - >-----< -1| else if (false) { } - -[#5 Domain] = 1:8-1:15 - >-------< -1| else if (false) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 1:17-1:18 - >-< -1| else if (false) { } - -[#6 Domain] = 1:16-1:19 - >---< -1| else if (false) { } - -[#6 Insertion delimiter] = " " - - -[#7 Content] = -[#7 Removal] = 2:6-2:7 - >-< -2| else { } - -[#7 Domain] = 2:0-2:8 - >--------< -2| else { } - -[#7 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#8 Content] = -[#8 Removal] = 2:6-2:7 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:6-2:7 >-< 2| else { } -[#8 Domain] = 2:5-2:8 - >---< -2| else { } - -[#8 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.lambda.scope b/data/fixtures/scopes/javascript.core/interior/interior.lambda.scope index 3e128b3d86..4503fae070 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.lambda.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.lambda.scope @@ -1,37 +1,10 @@ () => { } --- -[#1 Content] = -[#1 Removal] = 0:1-0:1 - >< -0| () => { } - -[#1 Domain] = 0:0-0:2 - >--< -0| () => { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:8 +[Content] = +[Removal] = +[Domain] = 0:7-0:8 >-< 0| () => { } -[#2 Domain] = 0:0-0:9 - >---------< -0| () => { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:7-0:8 - >-< -0| () => { } - -[#3 Domain] = 0:6-0:9 - >---< -0| () => { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.method.scope b/data/fixtures/scopes/javascript.core/interior/interior.method.scope index b83489b042..e953514d23 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.method.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.method.scope @@ -14,68 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| bar() { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:13 - >---------< -1| bar() { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| bar() { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| bar() { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:11-1:12 - >-< -1| bar() { } - -[#3 Domain] = 1:4-1:13 - >---------< -1| bar() { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:8-1:8 - >< -1| bar() { } - -[#4 Domain] = 1:7-1:9 - >--< -1| bar() { } - -[#4 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#5 Content] = -[#5 Removal] = 1:11-1:12 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:11-1:12 >-< 1| bar() { } -[#5 Domain] = 1:10-1:13 - >---< -1| bar() { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.static.scope b/data/fixtures/scopes/javascript.core/interior/interior.static.scope index ec08e00aa5..7faf9b8a6c 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.static.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.static.scope @@ -14,56 +14,20 @@ class Foo { 2| } < -[#1 Domain] = 0:0-2:1 - >----------- -0| class Foo { -1| static { } -2| } - -< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = 1:4-1:14 - >----------< -1| static { } - -[#2 Removal] = 0:11-2:0 +[#1 Domain] = 0:11-2:0 > 0| class Foo { 1| static { } 2| } < -[#2 Domain] = 0:10-2:1 - >- -0| class Foo { -1| static { } -2| } - -< - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:12-1:13 - >-< -1| static { } - -[#3 Domain] = 1:4-1:14 - >----------< -1| static { } - -[#3 Insertion delimiter] = " " +[#1 Insertion delimiter] = " " -[#4 Content] = -[#4 Removal] = 1:12-1:13 +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:12-1:13 >-< 1| static { } -[#4 Domain] = 1:11-1:14 - >---< -1| static { } - -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.switch.scope b/data/fixtures/scopes/javascript.core/interior/interior.switch.scope index e2ad168b18..516c60576b 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.switch.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.switch.scope @@ -1,37 +1,10 @@ switch (value) { } --- -[#1 Content] = -[#1 Removal] = 0:16-0:17 +[Content] = +[Removal] = +[Domain] = 0:16-0:17 >-< 0| switch (value) { } -[#1 Domain] = 0:0-0:18 - >------------------< -0| switch (value) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:13 - >-----< -0| switch (value) { } - -[#2 Domain] = 0:7-0:14 - >-------< -0| switch (value) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:16-0:17 - >-< -0| switch (value) { } - -[#3 Domain] = 0:15-0:18 - >---< -0| switch (value) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope b/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope index 79eec9b526..1034635c48 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.switchCase.scope @@ -36,8 +36,8 @@ switch (foo) { 9| } < -[#1 Domain] = 0:0-9:1 - >-------------- +[#1 Domain] = 0:14-9:0 + > 0| switch (foo) { 1| case 0: 2| bar; @@ -48,134 +48,69 @@ switch (foo) { 7| default: 8| break; 9| } - -< + < [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 0:8-0:11 - >---< -0| switch (foo) { - -[#2 Domain] = 0:7-0:12 - >-----< -0| switch (foo) { - -[#2 Insertion delimiter] = " " - - -[#3 Content] = 1:4-8:14 - >------- -1| case 0: +[#2 Content] = 2:8-3:14 + >---- 2| bar; 3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; --------------< -[#3 Removal] = 0:14-9:0 - > -0| switch (foo) { -1| case 0: -2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - < - -[#3 Domain] = 0:13-9:1 - >- -0| switch (foo) { +[#2 Removal] = 1:11-3:14 + > 1| case 0: 2| bar; -3| break; -4| case 1: { -5| break; -6| } -7| default: -8| break; -9| } - -< - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 2:8-3:14 - >---- -2| bar; 3| break; --------------< -[#4 Domain] = 1:4-3:14 - >------- +[#2 Domain] = 1:11-3:14 + > 1| case 0: 2| bar; 3| break; --------------< -[#4 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#5 Content] = 5:8-5:14 +[#3 Content] = 5:8-5:14 >------< 5| break; -[#5 Removal] = 4:13-6:4 +[#3 Removal] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#5 Domain] = 4:4-6:5 - >--------- -4| case 1: { -5| break; -6| } - -----< - -[#5 Insertion delimiter] = " " - - -[#6 Content] = 5:8-5:14 - >------< -5| break; - -[#6 Removal] = 4:13-6:4 +[#3 Domain] = 4:13-6:4 > 4| case 1: { 5| break; 6| } ----< -[#6 Domain] = 4:12-6:5 - >- -4| case 1: { -5| break; -6| } - -----< - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 8:8-8:14 +[#4 Content] = 8:8-8:14 >------< 8| break; -[#7 Domain] = 7:4-8:14 - >-------- +[#4 Removal] = 7:12-8:14 + > +7| default: +8| break; + --------------< + +[#4 Domain] = 7:12-8:14 + > 7| default: 8| break; --------------< -[#7 Insertion delimiter] = " " +[#4 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.try.scope b/data/fixtures/scopes/javascript.core/interior/interior.try.scope index 3b5323b649..343d029799 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.try.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.try.scope @@ -4,84 +4,27 @@ finally { } --- [#1 Content] = -[#1 Removal] = 0:5-0:6 +[#1 Removal] = +[#1 Domain] = 0:5-0:6 >-< 0| try { } -[#1 Domain] = 0:0-0:7 - >-------< -0| try { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:5-0:6 - >-< -0| try { } - -[#2 Domain] = 0:4-0:7 - >---< -0| try { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:10-1:11 +[#2 Removal] = +[#2 Domain] = 1:10-1:11 >-< 1| catch(e) { } -[#3 Domain] = 1:0-1:12 - >------------< -1| catch(e) { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:6-1:7 - >-< -1| catch(e) { } - -[#4 Domain] = 1:5-1:8 - >---< -1| catch(e) { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 1:10-1:11 - >-< -1| catch(e) { } - -[#5 Domain] = 1:9-1:12 - >---< -1| catch(e) { } - -[#5 Insertion delimiter] = " " - - -[#6 Content] = -[#6 Removal] = 2:9-2:10 - >-< -2| finally { } - -[#6 Domain] = 2:0-2:11 - >-----------< -2| finally { } - -[#6 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#7 Content] = -[#7 Removal] = 2:9-2:10 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:9-2:10 >-< 2| finally { } -[#7 Domain] = 2:8-2:11 - >---< -2| finally { } - -[#7 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.core/interior/interior.while.scope b/data/fixtures/scopes/javascript.core/interior/interior.while.scope index 3e16181107..1afbe23128 100644 --- a/data/fixtures/scopes/javascript.core/interior/interior.while.scope +++ b/data/fixtures/scopes/javascript.core/interior/interior.while.scope @@ -1,37 +1,10 @@ while (true) { } --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| while (true) { } -[#1 Domain] = 0:0-0:16 - >----------------< -0| while (true) { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:11 - >----< -0| while (true) { } - -[#2 Domain] = 0:6-0:12 - >------< -0| while (true) { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:14-0:15 - >-< -0| while (true) { } - -[#3 Domain] = 0:13-0:16 - >---< -0| while (true) { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/javascript.jsx/interior.element.scope b/data/fixtures/scopes/javascript.jsx/interior.element.scope index 74c625a413..9f9283d847 100644 --- a/data/fixtures/scopes/javascript.jsx/interior.element.scope +++ b/data/fixtures/scopes/javascript.jsx/interior.element.scope @@ -1,37 +1,10 @@
--- -[#1 Content] = -[#1 Removal] = 0:1-0:4 - >---< -0|
- -[#1 Domain] = 0:0-0:5 - >-----< -0|
- -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:5-0:6 +[Content] = +[Removal] = +[Domain] = 0:5-0:6 >-< 0|
-[#2 Domain] = 0:0-0:12 - >------------< -0|
- -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:8-0:11 - >---< -0|
- -[#3 Domain] = 0:6-0:12 - >------< -0|
- -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/latex/interior.element.scope b/data/fixtures/scopes/latex/interior.element.scope index a3235c56a0..34b602d342 100644 --- a/data/fixtures/scopes/latex/interior.element.scope +++ b/data/fixtures/scopes/latex/interior.element.scope @@ -3,46 +3,22 @@ \end{quote} --- -[#1 Content] = 1:4-1:9 +[Content] = 1:4-1:9 >-----< 1| Hello -[#1 Removal] = 0:13-2:0 +[Removal] = 0:13-2:0 > 0| \begin{quote} 1| Hello 2| \end{quote} < -[#1 Domain] = 0:0-2:11 - >------------- +[Domain] = 0:13-2:0 + > 0| \begin{quote} 1| Hello 2| \end{quote} - -----------< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:7-0:12 - >-----< -0| \begin{quote} - -[#2 Domain] = 0:6-0:13 - >-------< -0| \begin{quote} - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 2:5-2:10 - >-----< -2| \end{quote} - -[#3 Domain] = 2:4-2:11 - >-------< -2| \end{quote} + < -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior.function.scope b/data/fixtures/scopes/lua/interior.function.scope index ee6c7f7217..1b252dfed5 100644 --- a/data/fixtures/scopes/lua/interior.function.scope +++ b/data/fixtures/scopes/lua/interior.function.scope @@ -1,25 +1,10 @@ function foo() end --- -[#1 Content] = -[#1 Removal] = 0:14-0:15 +[Content] = +[Removal] = +[Domain] = 0:14-0:15 >-< 0| function foo() end -[#1 Domain] = 0:0-0:18 - >------------------< -0| function foo() end - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:13-0:13 - >< -0| function foo() end - -[#2 Domain] = 0:12-0:14 - >--< -0| function foo() end - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior.if.scope b/data/fixtures/scopes/lua/interior.if.scope index 044b13f70b..9e06cf6864 100644 --- a/data/fixtures/scopes/lua/interior.if.scope +++ b/data/fixtures/scopes/lua/interior.if.scope @@ -7,43 +7,64 @@ else end --- -[#1 Content] = -[#1 Removal] = 1:4-1:9 +[#1 Content] = 1:4-1:9 >-----< 1| a = 1 -[#1 Domain] = 0:0-1:9 - >------------ +[#1 Removal] = 0:12-2:0 + > 0| if true then 1| a = 1 - ---------< +2| elseif false then + < + +[#1 Domain] = 0:12-2:0 + > +0| if true then +1| a = 1 +2| elseif false then + < [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 3:4-3:9 +[#2 Content] = 3:4-3:9 >-----< 3| a = 2 -[#2 Domain] = 2:0-3:9 - >----------------- +[#2 Removal] = 2:17-4:0 + > 2| elseif false then 3| a = 2 - ---------< +4| else + < + +[#2 Domain] = 2:17-4:0 + > +2| elseif false then +3| a = 2 +4| else + < [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 5:4-5:9 +[#3 Content] = 5:4-5:9 >-----< 5| a = 3 -[#3 Domain] = 4:0-5:9 - >---- +[#3 Removal] = 4:4-6:0 + > +4| else +5| a = 3 +6| end + < + +[#3 Domain] = 4:4-6:0 + > 4| else 5| a = 3 - ---------< +6| end + < [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/markdown/interior.cell.scope b/data/fixtures/scopes/markdown/interior.cell.scope index ea6c76e382..f8f2670a14 100644 --- a/data/fixtures/scopes/markdown/interior.cell.scope +++ b/data/fixtures/scopes/markdown/interior.cell.scope @@ -1,26 +1,25 @@ ```ts let foo; ``` + --- -[Content] = 0:3-1:8 - >-- -0| ```ts +[Content] = 1:0-1:8 + >--------< 1| let foo; - --------< -[Removal] = 0:3-2:0 - >-- +[Removal] = 0:5-2:0 + > 0| ```ts 1| let foo; 2| ``` < -[Domain] = 0:0-2:3 - >----- +[Domain] = 0:5-2:0 + > 0| ```ts 1| let foo; 2| ``` - ---< + < [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/markdown/interior.cell2.scope b/data/fixtures/scopes/markdown/interior.cell2.scope index 1366885ab2..3538f475d2 100644 --- a/data/fixtures/scopes/markdown/interior.cell2.scope +++ b/data/fixtures/scopes/markdown/interior.cell2.scope @@ -1,6 +1,7 @@ ``` Hello world ``` + --- [Content] = 1:0-1:11 @@ -14,11 +15,11 @@ Hello world 2| ``` < -[Domain] = 0:0-2:3 - >--- +[Domain] = 0:3-2:0 + > 0| ``` 1| Hello world 2| ``` - ---< + < [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/plaintext/interior.surroundingPair.scope b/data/fixtures/scopes/plaintext/interior.surroundingPair.scope index 24f970f757..f2a71db63a 100644 --- a/data/fixtures/scopes/plaintext/interior.surroundingPair.scope +++ b/data/fixtures/scopes/plaintext/interior.surroundingPair.scope @@ -9,8 +9,8 @@ >------< 0| ( text ) -[Domain] = 0:0-0:8 - >--------< +[Domain] = 0:1-0:7 + >------< 0| ( text ) [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.class.scope b/data/fixtures/scopes/python/interior/interior.class.scope index 719407b3ab..d820932931 100644 --- a/data/fixtures/scopes/python/interior/interior.class.scope +++ b/data/fixtures/scopes/python/interior/interior.class.scope @@ -1,13 +1,16 @@ class Foo: pass --- -[Content] = -[Removal] = 0:11-0:15 +[Content] = 0:11-0:15 >----< 0| class Foo: pass -[Domain] = 0:0-0:15 - >---------------< +[Removal] = 0:10-0:15 + >-----< +0| class Foo: pass + +[Domain] = 0:10-0:15 + >-----< 0| class Foo: pass [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.constructor.scope b/data/fixtures/scopes/python/interior/interior.constructor.scope index 641c966a22..49188f85fe 100644 --- a/data/fixtures/scopes/python/interior/interior.constructor.scope +++ b/data/fixtures/scopes/python/interior/interior.constructor.scope @@ -2,13 +2,18 @@ class Foo: def __init__(self): pass --- -[#1 Content] = -[#1 Removal] = 1:4-1:28 +[#1 Content] = 1:4-1:28 >------------------------< 1| def __init__(self): pass -[#1 Domain] = 0:0-1:28 - >---------- +[#1 Removal] = 0:10-1:28 + > +0| class Foo: +1| def __init__(self): pass + ----------------------------< + +[#1 Domain] = 0:10-1:28 + > 0| class Foo: 1| def __init__(self): pass ----------------------------< @@ -16,25 +21,16 @@ class Foo: [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:24-1:28 +[#2 Content] = 1:24-1:28 >----< 1| def __init__(self): pass -[#2 Domain] = 1:4-1:28 - >------------------------< +[#2 Removal] = 1:23-1:28 + >-----< 1| def __init__(self): pass -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:17-1:21 - >----< +[#2 Domain] = 1:23-1:28 + >-----< 1| def __init__(self): pass -[#3 Domain] = 1:16-1:22 - >------< -1| def __init__(self): pass - -[#3 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.foreach.scope b/data/fixtures/scopes/python/interior/interior.foreach.scope index 165854f8b2..b9441c8323 100644 --- a/data/fixtures/scopes/python/interior/interior.foreach.scope +++ b/data/fixtures/scopes/python/interior/interior.foreach.scope @@ -1,13 +1,16 @@ for v in values: pass --- -[Content] = -[Removal] = 0:17-0:21 +[Content] = 0:17-0:21 >----< 0| for v in values: pass -[Domain] = 0:0-0:21 - >---------------------< +[Removal] = 0:16-0:21 + >-----< +0| for v in values: pass + +[Domain] = 0:16-0:21 + >-----< 0| for v in values: pass [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.function.scope b/data/fixtures/scopes/python/interior/interior.function.scope index 179ab55204..441e198d50 100644 --- a/data/fixtures/scopes/python/interior/interior.function.scope +++ b/data/fixtures/scopes/python/interior/interior.function.scope @@ -1,25 +1,16 @@ def foo(): pass --- -[#1 Content] = -[#1 Removal] = 0:11-0:15 +[Content] = 0:11-0:15 >----< 0| def foo(): pass -[#1 Domain] = 0:0-0:15 - >---------------< +[Removal] = 0:10-0:15 + >-----< 0| def foo(): pass -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:8-0:8 - >< -0| def foo(): pass - -[#2 Domain] = 0:7-0:9 - >--< +[Domain] = 0:10-0:15 + >-----< 0| def foo(): pass -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.function2.scope b/data/fixtures/scopes/python/interior/interior.function2.scope deleted file mode 100644 index bd6ce81c00..0000000000 --- a/data/fixtures/scopes/python/interior/interior.function2.scope +++ /dev/null @@ -1,28 +0,0 @@ -@bar -def foo(): pass ---- - -[#1 Content] = -[#1 Removal] = 1:11-1:15 - >----< -1| def foo(): pass - -[#1 Domain] = 0:0-1:15 - >---- -0| @bar -1| def foo(): pass - ---------------< - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 1:8-1:8 - >< -1| def foo(): pass - -[#2 Domain] = 1:7-1:9 - >--< -1| def foo(): pass - -[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.if.scope b/data/fixtures/scopes/python/interior/interior.if.scope index 023fe55488..77f83ef80a 100644 --- a/data/fixtures/scopes/python/interior/interior.if.scope +++ b/data/fixtures/scopes/python/interior/interior.if.scope @@ -3,37 +3,46 @@ elif False: pass else: pass --- -[#1 Content] = -[#1 Removal] = 0:9-0:13 +[#1 Content] = 0:9-0:13 >----< 0| if True: pass -[#1 Domain] = 0:0-0:13 - >-------------< +[#1 Removal] = 0:8-0:13 + >-----< +0| if True: pass + +[#1 Domain] = 0:8-0:13 + >-----< 0| if True: pass [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:12-1:16 +[#2 Content] = 1:12-1:16 >----< 1| elif False: pass -[#2 Domain] = 1:0-1:16 - >----------------< +[#2 Removal] = 1:11-1:16 + >-----< +1| elif False: pass + +[#2 Domain] = 1:11-1:16 + >-----< 1| elif False: pass [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 2:6-2:10 +[#3 Content] = 2:6-2:10 >----< 2| else: pass -[#3 Domain] = 2:0-2:10 - >----------< +[#3 Removal] = 2:5-2:10 + >-----< +2| else: pass + +[#3 Domain] = 2:5-2:10 + >-----< 2| else: pass [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.method.scope b/data/fixtures/scopes/python/interior/interior.method.scope index df796b77d5..80757cc915 100644 --- a/data/fixtures/scopes/python/interior/interior.method.scope +++ b/data/fixtures/scopes/python/interior/interior.method.scope @@ -2,13 +2,18 @@ class Foo: def bar(): pass --- -[#1 Content] = -[#1 Removal] = 1:4-1:19 +[#1 Content] = 1:4-1:19 >---------------< 1| def bar(): pass -[#1 Domain] = 0:0-1:19 - >---------- +[#1 Removal] = 0:10-1:19 + > +0| class Foo: +1| def bar(): pass + -------------------< + +[#1 Domain] = 0:10-1:19 + > 0| class Foo: 1| def bar(): pass -------------------< @@ -16,25 +21,16 @@ class Foo: [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:15-1:19 +[#2 Content] = 1:15-1:19 >----< 1| def bar(): pass -[#2 Domain] = 1:4-1:19 - >---------------< +[#2 Removal] = 1:14-1:19 + >-----< 1| def bar(): pass -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:12-1:12 - >< +[#2 Domain] = 1:14-1:19 + >-----< 1| def bar(): pass -[#3 Domain] = 1:11-1:13 - >--< -1| def bar(): pass - -[#3 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.resource.scope b/data/fixtures/scopes/python/interior/interior.resource.scope index ee195de6d4..0cfa7f42a7 100644 --- a/data/fixtures/scopes/python/interior/interior.resource.scope +++ b/data/fixtures/scopes/python/interior/interior.resource.scope @@ -1,13 +1,16 @@ with file: pass --- -[Content] = -[Removal] = 0:11-0:15 +[Content] = 0:11-0:15 >----< 0| with file: pass -[Domain] = 0:0-0:15 - >---------------< +[Removal] = 0:10-0:15 + >-----< +0| with file: pass + +[Domain] = 0:10-0:15 + >-----< 0| with file: pass [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.switch.scope b/data/fixtures/scopes/python/interior/interior.switch.scope index 9e54a4a1db..53c37096dd 100644 --- a/data/fixtures/scopes/python/interior/interior.switch.scope +++ b/data/fixtures/scopes/python/interior/interior.switch.scope @@ -12,8 +12,8 @@ match value: 1| case 0: pass ----------------< -[#1 Domain] = 0:0-1:16 - >------------ +[#1 Domain] = 0:12-1:16 + > 0| match value: 1| case 0: pass ----------------< @@ -21,13 +21,16 @@ match value: [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:12-1:16 +[#2 Content] = 1:12-1:16 >----< 1| case 0: pass -[#2 Domain] = 1:4-1:16 - >------------< +[#2 Removal] = 1:11-1:16 + >-----< +1| case 0: pass + +[#2 Domain] = 1:11-1:16 + >-----< 1| case 0: pass [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.switchCase.scope b/data/fixtures/scopes/python/interior/interior.switchCase.scope index 551e1fab23..5c13a3b2f5 100644 --- a/data/fixtures/scopes/python/interior/interior.switchCase.scope +++ b/data/fixtures/scopes/python/interior/interior.switchCase.scope @@ -25,8 +25,8 @@ match foo: 5| pass ------------< -[#1 Domain] = 0:0-5:12 - >---------- +[#1 Domain] = 0:10-5:12 + > 0| match foo: 1| case 0: 2| bar @@ -38,15 +38,21 @@ match foo: [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 2:8-3:12 +[#2 Content] = 2:8-3:12 >--- 2| bar 3| pass ------------< -[#2 Domain] = 1:4-3:12 - >------- +[#2 Removal] = 1:11-3:12 + > +1| case 0: +2| bar +3| pass + ------------< + +[#2 Domain] = 1:11-3:12 + > 1| case 0: 2| bar 3| pass @@ -55,13 +61,18 @@ match foo: [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 5:8-5:12 +[#3 Content] = 5:8-5:12 >----< 5| pass -[#3 Domain] = 4:4-5:12 - >------- +[#3 Removal] = 4:11-5:12 + > +4| case _: +5| pass + ------------< + +[#3 Domain] = 4:11-5:12 + > 4| case _: 5| pass ------------< diff --git a/data/fixtures/scopes/python/interior/interior.try.scope b/data/fixtures/scopes/python/interior/interior.try.scope index 28611b4b9d..34c051ece1 100644 --- a/data/fixtures/scopes/python/interior/interior.try.scope +++ b/data/fixtures/scopes/python/interior/interior.try.scope @@ -3,37 +3,46 @@ except: pass finally: pass --- -[#1 Content] = -[#1 Removal] = 0:5-0:9 +[#1 Content] = 0:5-0:9 >----< 0| try: pass -[#1 Domain] = 0:0-0:9 - >---------< +[#1 Removal] = 0:4-0:9 + >-----< +0| try: pass + +[#1 Domain] = 0:4-0:9 + >-----< 0| try: pass [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:8-1:12 +[#2 Content] = 1:8-1:12 >----< 1| except: pass -[#2 Domain] = 1:0-1:12 - >------------< +[#2 Removal] = 1:7-1:12 + >-----< +1| except: pass + +[#2 Domain] = 1:7-1:12 + >-----< 1| except: pass [#2 Insertion delimiter] = " " -[#3 Content] = -[#3 Removal] = 2:9-2:13 +[#3 Content] = 2:9-2:13 >----< 2| finally: pass -[#3 Domain] = 2:0-2:13 - >-------------< +[#3 Removal] = 2:8-2:13 + >-----< +2| finally: pass + +[#3 Domain] = 2:8-2:13 + >-----< 2| finally: pass [#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.try2.scope b/data/fixtures/scopes/python/interior/interior.try2.scope index 58a5c379e2..2bfcf4d829 100644 --- a/data/fixtures/scopes/python/interior/interior.try2.scope +++ b/data/fixtures/scopes/python/interior/interior.try2.scope @@ -2,25 +2,31 @@ try: pass except*: pass --- -[#1 Content] = -[#1 Removal] = 0:5-0:9 +[#1 Content] = 0:5-0:9 >----< 0| try: pass -[#1 Domain] = 0:0-0:9 - >---------< +[#1 Removal] = 0:4-0:9 + >-----< +0| try: pass + +[#1 Domain] = 0:4-0:9 + >-----< 0| try: pass [#1 Insertion delimiter] = " " -[#2 Content] = -[#2 Removal] = 1:9-1:13 +[#2 Content] = 1:9-1:13 >----< 1| except*: pass -[#2 Domain] = 1:0-1:13 - >-------------< +[#2 Removal] = 1:8-1:13 + >-----< +1| except*: pass + +[#2 Domain] = 1:8-1:13 + >-----< 1| except*: pass [#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/python/interior/interior.while.scope b/data/fixtures/scopes/python/interior/interior.while.scope index caaaf393e8..ee0cb61af3 100644 --- a/data/fixtures/scopes/python/interior/interior.while.scope +++ b/data/fixtures/scopes/python/interior/interior.while.scope @@ -1,13 +1,16 @@ while True: pass --- -[Content] = -[Removal] = 0:12-0:16 +[Content] = 0:12-0:16 >----< 0| while True: pass -[Domain] = 0:0-0:16 - >----------------< +[Removal] = 0:11-0:16 + >-----< +0| while True: pass + +[Domain] = 0:11-0:16 + >-----< 0| while True: pass [Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scss/interior.function.scope b/data/fixtures/scopes/scss/interior.function.scope index 550f4806fc..4f01b19c75 100644 --- a/data/fixtures/scopes/scss/interior.function.scope +++ b/data/fixtures/scopes/scss/interior.function.scope @@ -1,37 +1,10 @@ @function foo() { } --- -[#1 Content] = -[#1 Removal] = 0:17-0:18 +[Content] = +[Removal] = +[Domain] = 0:17-0:18 >-< 0| @function foo() { } -[#1 Domain] = 0:0-0:19 - >-------------------< -0| @function foo() { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:14-0:14 - >< -0| @function foo() { } - -[#2 Domain] = 0:13-0:15 - >--< -0| @function foo() { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:17-0:18 - >-< -0| @function foo() { } - -[#3 Domain] = 0:16-0:19 - >---< -0| @function foo() { } - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/scss/interior.if.scope b/data/fixtures/scopes/scss/interior.if.scope index 3c64701f8f..913d07828d 100644 --- a/data/fixtures/scopes/scss/interior.if.scope +++ b/data/fixtures/scopes/scss/interior.if.scope @@ -4,72 +4,27 @@ --- [#1 Content] = -[#1 Removal] = 0:10-0:11 +[#1 Removal] = +[#1 Domain] = 0:10-0:11 >-< 0| @if true { } -[#1 Domain] = 0:0-0:12 - >------------< -0| @if true { } - [#1 Insertion delimiter] = " " [#2 Content] = -[#2 Removal] = 0:10-0:11 - >-< -0| @if true { } - -[#2 Domain] = 0:9-0:12 - >---< -0| @if true { } - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 1:16-1:17 +[#2 Removal] = +[#2 Domain] = 1:16-1:17 >-< 1| @else if false { } -[#3 Domain] = 1:0-1:18 - >------------------< -1| @else if false { } - -[#3 Insertion delimiter] = " " - - -[#4 Content] = -[#4 Removal] = 1:16-1:17 - >-< -1| @else if false { } - -[#4 Domain] = 1:15-1:18 - >---< -1| @else if false { } - -[#4 Insertion delimiter] = " " - - -[#5 Content] = -[#5 Removal] = 2:7-2:8 - >-< -2| @else { } - -[#5 Domain] = 2:0-2:9 - >---------< -2| @else { } - -[#5 Insertion delimiter] = " " +[#2 Insertion delimiter] = " " -[#6 Content] = -[#6 Removal] = 2:7-2:8 +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:7-2:8 >-< 2| @else { } -[#6 Domain] = 2:6-2:9 - >---< -2| @else { } - -[#6 Insertion delimiter] = " " +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/talon/interior.command.scope b/data/fixtures/scopes/talon/interior.command.scope index 1f3a9d4c54..35f2bcc898 100644 --- a/data/fixtures/scopes/talon/interior.command.scope +++ b/data/fixtures/scopes/talon/interior.command.scope @@ -2,13 +2,18 @@ foo: bar = 0 --- -[Content] = -[Removal] = 1:4-1:11 +[Content] = 1:4-1:11 >-------< 1| bar = 0 -[Domain] = 0:0-1:11 - >---- +[Removal] = 0:4-1:11 + > +0| foo: +1| bar = 0 + -----------< + +[Domain] = 0:4-1:11 + > 0| foo: 1| bar = 0 -----------< diff --git a/data/fixtures/scopes/typescript.core/interior.enum.scope b/data/fixtures/scopes/typescript.core/interior.enum.scope index a5274985e7..d96875b078 100644 --- a/data/fixtures/scopes/typescript.core/interior.enum.scope +++ b/data/fixtures/scopes/typescript.core/interior.enum.scope @@ -1,25 +1,10 @@ enum Foo { } --- -[#1 Content] = -[#1 Removal] = 0:10-0:11 +[Content] = +[Removal] = +[Domain] = 0:10-0:11 >-< 0| enum Foo { } -[#1 Domain] = 0:0-0:12 - >------------< -0| enum Foo { } - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:10-0:11 - >-< -0| enum Foo { } - -[#2 Domain] = 0:9-0:12 - >---< -0| enum Foo { } - -[#2 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/typescript.core/interior.interface.scope b/data/fixtures/scopes/typescript.core/interior.interface.scope index f79024c7de..b9968a2fff 100644 --- a/data/fixtures/scopes/typescript.core/interior.interface.scope +++ b/data/fixtures/scopes/typescript.core/interior.interface.scope @@ -1,25 +1,10 @@ interface Foo { } --- -[#1 Content] = -[#1 Removal] = 0:15-0:16 +[Content] = +[Removal] = +[Domain] = 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] = " " +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/xml/interior.element.scope b/data/fixtures/scopes/xml/interior.element.scope index 4a43b91a60..418caa62d7 100644 --- a/data/fixtures/scopes/xml/interior.element.scope +++ b/data/fixtures/scopes/xml/interior.element.scope @@ -1,37 +1,10 @@ --- -[#1 Content] = -[#1 Removal] = 0:1-0:5 - >----< -0| - -[#1 Domain] = 0:0-0:6 - >------< -0| - -[#1 Insertion delimiter] = " " - - -[#2 Content] = -[#2 Removal] = 0:6-0:7 +[Content] = +[Removal] = +[Domain] = 0:6-0:7 >-< 0| -[#2 Domain] = 0:0-0:14 - >--------------< -0| - -[#2 Insertion delimiter] = " " - - -[#3 Content] = -[#3 Removal] = 0:9-0:13 - >----< -0| - -[#3 Domain] = 0:7-0:14 - >-------< -0| - -[#3 Insertion delimiter] = " " +[Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index c79ccfa6b2..7418dff4b3 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -186,7 +186,13 @@ - `interior.namespace` the body of a namespace statement - `interior.resource` the body of a 'with' / 'use' / 'using' statement - `interior.static` the body of a static statement + +### surroundingPairInterior + - `interior.surroundingPair` The interior scope of a surrounding pair + +### interior + - `interior.switch` The body of a switch statement - `interior.switchCase` The body of a switch case branch - `interior.try` The body of a try/catch/finally branch diff --git a/packages/common/src/scopeSupportFacets/PlaintextScopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/PlaintextScopeSupportFacetInfos.ts index 03d410fff9..e67bc32670 100644 --- a/packages/common/src/scopeSupportFacets/PlaintextScopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/PlaintextScopeSupportFacetInfos.ts @@ -92,7 +92,8 @@ export const plaintextScopeSupportFacetInfos: Record< "interior.surroundingPair": { description: "The interior scope of a surrounding pair", scopeType: { - type: "interior", + type: "surroundingPairInterior", + delimiter: "any", }, }, "collectionItem.textual": { diff --git a/packages/common/src/types/command/PartialTargetDescriptor.types.ts b/packages/common/src/types/command/PartialTargetDescriptor.types.ts index a56e14bbc4..41afdd2556 100644 --- a/packages/common/src/types/command/PartialTargetDescriptor.types.ts +++ b/packages/common/src/types/command/PartialTargetDescriptor.types.ts @@ -208,6 +208,7 @@ export const simpleScopeTypeTypes = [ "textFragment", "disqualifyDelimiter", "pairDelimiter", + "interior", ] as const; export function isSimpleScopeType( @@ -220,6 +221,7 @@ export type SimpleScopeTypeType = (typeof simpleScopeTypeTypes)[number]; export const pseudoScopes = new Set([ "instance", + "interior", "className", "functionName", ]); @@ -236,16 +238,6 @@ export interface CustomRegexScopeType { flags?: string; } -export interface InteriorScopeType { - type: "interior"; - - // The user has specified a scope type. eg "inside element". - explicitScopeType?: boolean; - - // Gets passed to surrounding pair scope handler - requireStrongContainment?: boolean; -} - export type SurroundingPairDirection = "left" | "right"; export interface SurroundingPairScopeType { @@ -289,7 +281,6 @@ export type ScopeType = | SurroundingPairScopeType | SurroundingPairInteriorScopeType | CustomRegexScopeType - | InteriorScopeType | OneOfScopeType | GlyphScopeType; diff --git a/packages/cursorless-engine/src/actions/Rewrap.ts b/packages/cursorless-engine/src/actions/Rewrap.ts index 3b9030654f..0fad5350e3 100644 --- a/packages/cursorless-engine/src/actions/Rewrap.ts +++ b/packages/cursorless-engine/src/actions/Rewrap.ts @@ -1,7 +1,7 @@ import { FlashStyle } from "@cursorless/common"; import type { RangeUpdater } from "../core/updateSelections/RangeUpdater"; import { performEditsAndUpdateSelections } from "../core/updateSelections/updateSelections"; -import { getContainingSurroundingPairIfNoBoundaryStage } from "../processTargets/modifiers/InteriorStage"; +import { getContainingSurroundingPairIfNoBoundaryStage } from "../processTargets/modifiers/BoundaryStage"; import type { ModifierStageFactory } from "../processTargets/ModifierStageFactory"; import { ide } from "../singletons/ide.singleton"; import type { Target } from "../typings/target.types"; diff --git a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts index 5ad4c56a5a..12a9558133 100644 --- a/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts +++ b/packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts @@ -3,6 +3,7 @@ import type { StoredTargetMap } from "../core/StoredTargets"; import type { LanguageDefinitions } from "../languages/LanguageDefinitions"; import type { ModifierStageFactory } from "./ModifierStageFactory"; import type { ModifierStage } from "./PipelineStages.types"; +import { ExcludeInteriorStage } from "./modifiers/BoundaryStage"; import { ClassFunctionNameStage } from "./modifiers/ClassFunctionNameStage"; import { ModifyIfUntypedStage } from "./modifiers/ConditionalModifierStages"; import { ContainingScopeStage } from "./modifiers/ContainingScopeStage"; @@ -14,10 +15,7 @@ import { } from "./modifiers/FilterStages"; import { HeadStage, TailStage } from "./modifiers/HeadTailStage"; import { InstanceStage } from "./modifiers/InstanceStage"; -import { - ExcludeInteriorStage, - InteriorOnlyStage, -} from "./modifiers/InteriorStage"; +import { InteriorOnlyStage } from "./modifiers/InteriorStage"; import { LeadingStage, TrailingStage } from "./modifiers/LeadingTrailingStages"; import { OrdinalScopeStage } from "./modifiers/OrdinalScopeStage"; import { EndOfStage, StartOfStage } from "./modifiers/PositionStage"; diff --git a/packages/cursorless-engine/src/processTargets/modifiers/BoundaryStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/BoundaryStage.ts new file mode 100644 index 0000000000..e29bb975b5 --- /dev/null +++ b/packages/cursorless-engine/src/processTargets/modifiers/BoundaryStage.ts @@ -0,0 +1,39 @@ +import { type ExcludeInteriorModifier } from "@cursorless/common"; +import type { Target } from "../../typings/target.types"; +import type { ModifierStageFactory } from "../ModifierStageFactory"; +import type { + ModifierStage, + ModifierStateOptions, +} from "../PipelineStages.types"; +import { ModifyIfConditionStage } from "./ConditionalModifierStages"; + +export class ExcludeInteriorStage implements ModifierStage { + private containingSurroundingPairIfNoBoundaryStage: ModifierStage; + + constructor( + private modifierStageFactory: ModifierStageFactory, + private modifier: ExcludeInteriorModifier, + ) { + this.containingSurroundingPairIfNoBoundaryStage = + getContainingSurroundingPairIfNoBoundaryStage(this.modifierStageFactory); + } + + run(target: Target, options: ModifierStateOptions): Target[] { + return this.containingSurroundingPairIfNoBoundaryStage + .run(target, options) + .flatMap((target) => target.getBoundary()!); + } +} + +export function getContainingSurroundingPairIfNoBoundaryStage( + modifierStageFactory: ModifierStageFactory, +): ModifierStage { + return new ModifyIfConditionStage( + modifierStageFactory, + { + type: "containingScope", + scopeType: { type: "surroundingPair", delimiter: "any" }, + }, + (target) => target.getBoundary() == null, + ); +} diff --git a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts index 964314cee8..f5a09216cf 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/HeadTailStage.ts @@ -2,7 +2,6 @@ import { NoContainingScopeError, type HeadModifier, type Modifier, - type ScopeType, type TailModifier, } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; @@ -16,6 +15,7 @@ import { processModifierStages, } from "../TargetPipelineRunner"; import { HeadTailTarget, PlainTarget } from "../targets"; +import { createContainingInteriorStage } from "./InteriorStage"; class HeadTailStage implements ModifierStage { constructor( @@ -99,10 +99,10 @@ class BoundedLineStage implements ModifierStage { options: ModifierStateOptions, ): Target | undefined { try { - return this.getContaining(target, options, { - type: "interior", - requireStrongContainment: true, - }); + return createContainingInteriorStage(this.modifierStageFactory).run( + target, + options, + )[0]; } catch (error) { if (error instanceof NoContainingScopeError) { return undefined; @@ -114,19 +114,9 @@ class BoundedLineStage implements ModifierStage { private getContainingLine( target: Target, options: ModifierStateOptions, - ): Target { - return this.getContaining(target, options, { - type: "line", - }); - } - - private getContaining( - target: Target, - options: ModifierStateOptions, - scopeType: ScopeType, ): Target { return this.modifierStageFactory - .create({ type: "containingScope", scopeType }) + .create({ type: "containingScope", scopeType: { type: "line" } }) .run(target, options)[0]; } } diff --git a/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts b/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts index 59ce7bd31b..6d6b400608 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/InteriorStage.ts @@ -1,6 +1,6 @@ -import type { - ExcludeInteriorModifier, - InteriorOnlyModifier, +import { + NoContainingScopeError, + type InteriorOnlyModifier, } from "@cursorless/common"; import type { Target } from "../../typings/target.types"; import type { ModifierStageFactory } from "../ModifierStageFactory"; @@ -8,7 +8,6 @@ import type { ModifierStage, ModifierStateOptions, } from "../PipelineStages.types"; -import { ModifyIfConditionStage } from "./ConditionalModifierStages"; export class InteriorOnlyStage implements ModifierStage { constructor( @@ -19,49 +18,63 @@ export class InteriorOnlyStage implements ModifierStage { run(target: Target, options: ModifierStateOptions): Target[] { const interior = target.getInterior(); + // eg "inside pair" if (interior != null) { return interior; } - const containingModifier = this.modifierHandlerFactory.create({ - type: "containingScope", - scopeType: { - type: "interior", - explicitScopeType: target.hasExplicitScopeType, - }, - }); - - return containingModifier.run(target, options); - } -} - -export class ExcludeInteriorStage implements ModifierStage { - private containingSurroundingPairIfNoBoundaryStage: ModifierStage; + // eg "inside funk" + // When you say "inside funk", in an ideal world, the function target would + // have a defined interior property that we could just use directly. + // However, it is painful to define interiors for every single scope in + // every single language, particularly scopes like "if", which could have + // multiple interiors and tends to be defined in a tricky nested way in the + // parse tree. Instead, we just define interior as a scope, and then call + // every interior on the input target here. This will work as expected in + // most cases, as long as the nearest interior is what we expect, which it + // usually is. + if (target.hasExplicitScopeType) { + const everyModifier = this.modifierHandlerFactory.create({ + type: "everyScope", + scopeType: { + type: "interior", + }, + }); - constructor( - private modifierStageFactory: ModifierStageFactory, - private modifier: ExcludeInteriorModifier, - ) { - this.containingSurroundingPairIfNoBoundaryStage = - getContainingSurroundingPairIfNoBoundaryStage(this.modifierStageFactory); - } + return everyModifier.run(target, options); + } - run(target: Target, options: ModifierStateOptions): Target[] { - return this.containingSurroundingPairIfNoBoundaryStage - .run(target, options) - .flatMap((target) => target.getBoundary()!); + // eg "inside air" + try { + return createContainingInteriorStage(this.modifierHandlerFactory).run( + target, + options, + ); + } catch (e) { + if (e instanceof NoContainingScopeError) { + throw new NoContainingScopeError("interior"); + } + throw e; + } } } -export function getContainingSurroundingPairIfNoBoundaryStage( - modifierStageFactory: ModifierStageFactory, +export function createContainingInteriorStage( + modifierHandlerFactory: ModifierStageFactory, ): ModifierStage { - return new ModifyIfConditionStage( - modifierStageFactory, - { - type: "containingScope", - scopeType: { type: "surroundingPair", delimiter: "any" }, + return modifierHandlerFactory.create({ + type: "containingScope", + scopeType: { + type: "oneOf", + scopeTypes: [ + { + type: "interior", + }, + { + type: "surroundingPairInterior", + delimiter: "any", + }, + ], }, - (target) => target.getBoundary() == null, - ); + }); } diff --git a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/InteriorScopeHandler.ts b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/InteriorScopeHandler.ts index 65896065f8..c0baf6efc7 100644 --- a/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/InteriorScopeHandler.ts +++ b/packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/InteriorScopeHandler.ts @@ -1,24 +1,20 @@ import type { Direction, - InteriorScopeType, Position, ScopeType, TextEditor, } from "@cursorless/common"; -import { NoContainingScopeError, Range } from "@cursorless/common"; +import { NoContainingScopeError } from "@cursorless/common"; import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions"; import type { Target } from "../../../../typings/target.types"; import { InteriorTarget } from "../../../targets"; import { BaseScopeHandler } from "../BaseScopeHandler"; -import { FallbackScopeHandler } from "../FallbackScopeHandler"; import type { TargetScope } from "../scope.types"; import type { ComplexScopeType, - ScopeHandler, ScopeIteratorRequirements, } from "../scopeHandler.types"; import type { ScopeHandlerFactory } from "../ScopeHandlerFactory"; -import { SortedScopeHandler } from "../SortedScopeHandler"; export class InteriorScopeHandler extends BaseScopeHandler { protected isHierarchical = true; @@ -26,7 +22,7 @@ export class InteriorScopeHandler extends BaseScopeHandler { constructor( private scopeHandlerFactory: ScopeHandlerFactory, private languageDefinitions: LanguageDefinitions, - public readonly scopeType: InteriorScopeType, + public readonly scopeType: ScopeType, private languageId: string, ) { super(); @@ -44,8 +40,9 @@ export class InteriorScopeHandler extends BaseScopeHandler { direction: Direction, hints: ScopeIteratorRequirements, ): Iterable { - const targetDomain = new Range(position, hints.distalPosition); - const scopeHandler = this.getScopeHandler(); + const scopeHandler = this.languageDefinitions + .get(this.languageId) + ?.getScopeHandler(this.scopeType); if (scopeHandler == null) { return; @@ -59,82 +56,25 @@ export class InteriorScopeHandler extends BaseScopeHandler { ); for (const scope of scopes) { - if (this.shouldYield(targetDomain, scope)) { - yield createInteriorScope(scope); - } - } - } - - private getScopeHandler(): ScopeHandler | undefined { - const languageScopeHandler = this.languageDefinitions - .get(this.languageId) - ?.getScopeHandler(this.scopeType); - - const pairScopeHandler = this.scopeHandlerFactory.create( - { - type: "surroundingPair", - delimiter: "any", - requireStrongContainment: this.scopeType.requireStrongContainment, - }, - this.languageId, - ); - - // If the scope type is explicit (ie, the user has specified a scope - // type), then we want to prioritize language scopes. For example, - // if the user says "inside element" inside a `
` tag, the angle - // brackets of the tag are also a surrounding pair which should have - // lower priority. - if (this.scopeType.explicitScopeType) { - if (languageScopeHandler == null) { - return pairScopeHandler; - } - return FallbackScopeHandler.createFromScopeHandlers([ - languageScopeHandler, - pairScopeHandler, - ]); - } - - if (languageScopeHandler == null) { - return pairScopeHandler; + yield createScope(scope); } - - return SortedScopeHandler.createFromScopeHandlers( - this.scopeHandlerFactory, - this.languageId, - [pairScopeHandler, languageScopeHandler], - ); - } - - private shouldYield(targetDomain: Range, scope: TargetScope): boolean { - // For an explicit scope type we only yield scopes that are contained within - // the target domain. For example, if the user said "inside token", we don't - // want to yield scopes that are larger than the token. - return ( - !this.scopeType.explicitScopeType || targetDomain.contains(scope.domain) - ); } } -function createInteriorScope(scope: TargetScope): TargetScope { +function createScope(scope: TargetScope): TargetScope { return { editor: scope.editor, domain: scope.domain, getTargets(isReversed) { - return scope.getTargets(isReversed).flatMap(createInteriorTargets); + return scope.getTargets(isReversed).map(createInteriorTarget); }, }; } -function createInteriorTargets(target: Target): Target[] { - const interior = target.getInterior(); - if (interior != null) { - return interior; - } - return [ - new InteriorTarget({ - editor: target.editor, - isReversed: target.isReversed, - fullInteriorRange: target.contentRange, - }), - ]; +function createInteriorTarget(target: Target): InteriorTarget { + return new InteriorTarget({ + editor: target.editor, + isReversed: target.isReversed, + fullInteriorRange: target.contentRange, + }); } diff --git a/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts b/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts index cb412b84ff..a1f24e658b 100644 --- a/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts +++ b/packages/cursorless-engine/src/processTargets/targets/SurroundingPairTarget.ts @@ -41,9 +41,11 @@ export class SurroundingPairTarget extends BaseTarget diff --git a/queries/c.scm b/queries/c.scm index 71e3d54b3e..627104e13d 100644 --- a/queries/c.scm +++ b/queries/c.scm @@ -46,6 +46,15 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) + ;;!! struct Foo { }; ;;! ^ ;;!! union Foo { }; @@ -84,10 +93,6 @@ (_ (_ name: (_) @name - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @_.domain.start @class.start @type.start . ";"? @_.domain.end @class.end @type.end @@ -108,12 +113,7 @@ ;;!! typedef union {} foo; ;;!! typedef enum {} foo; (type_definition - type: (_ - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) - ) @_dummy + type: (_) @_dummy declarator: (type_identifier) @name (#type? @_dummy struct_specifier union_specifier enum_specifier) ) @_.domain @class @type @@ -166,15 +166,6 @@ ) ) @namedFunction @name.domain -;;!! void foo() { } -;;! ^ -(function_definition - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @_.domain - ;;!! int aaa; ;;! ^^^ (field_declaration @@ -312,12 +303,9 @@ ;;! ^^^^^^^^ ( (if_statement - "if" @branch.start @branch.removal.start @interior.domain.start + "if" @branch.start @branch.removal.start condition: (_) @condition - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @branch.removal.end @interior.domain.end + consequence: (_) @branch.end @branch.removal.end alternative: (else_clause (if_statement)? @branch.removal.end.startOf )? @branch.removal.end.startOf @@ -329,13 +317,10 @@ ;;!! else if () {} ;;! ^^^^^^^^^^^^^ (else_clause - "else" @branch.start @condition.domain.start @interior.domain.start + "else" @branch.start @condition.domain.start (if_statement condition: (_) @condition - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @condition.domain.end @interior.domain.end + consequence: (_) @branch.end @condition.domain.end (#child-range! @condition 0 -1 true true) ) ) @@ -344,11 +329,8 @@ ;;! ^^^^^^^ (if_statement (else_clause - (compound_statement - "{" @interior.start.endOf - "}" @interior.end.startOf - ) - ) @branch @interior.domain + (compound_statement) + ) @branch ) ;;!! for (int i = 0; i < size; ++i) {} @@ -356,10 +338,6 @@ ;;! ^^^^^^^^ (for_statement condition: (_) @condition - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @branch @_.domain ;;!! while (true) {} @@ -367,10 +345,6 @@ ;;! ^^^^ (while_statement condition: (_) @condition - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) (#child-range! @condition 0 -1 true true) ) @branch @_.domain @@ -378,10 +352,6 @@ ;;! ^^^^^^^^^^^^^^^^^^^ ;;! ^^^^ (do_statement - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) condition: (_) @condition (#child-range! @condition 0 -1 true true) ) @branch @_.domain @@ -394,42 +364,29 @@ ")" @value.end.startOf ) body: (_ - "{" @branch.iteration.start.endOf @condition.iteration.start.endOf @interior.start.endOf - "}" @branch.iteration.end.startOf @condition.iteration.end.startOf @interior.end.startOf + "{" @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @branch.iteration.end.startOf @condition.iteration.end.startOf ) ) @_.domain @branch.iteration.domain @condition.iteration.domain ;;!! case 0: break; ;;! ^^^^^^^^^^^^^^ +(case_statement) @branch + +;;!! case 0: break; ;;! ^ (case_statement value: (_) @condition - . - (_) @interior.start - (_)? @interior.end - . - (#not-type? @interior.start "compound_statement") -) @branch @_.domain +) @condition.domain -;;!! default: break; -;;! ^^^^^^^^^^^^^^; +;;!! case 0: break; +;;! ^^^^^^^ (case_statement - !value + ":" @interior.start.endOf . - (_) @interior.start - (_)? @interior.end - . - (#not-type? @interior.start "compound_statement") -) @branch @_.domain - -;;!! case 0: { } -;;! ^ -(case_statement - (compound_statement - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @branch @_.domain + (_) @_dummy + (#not-type? @_dummy compound_statement) +) @interior.end.endOf ;;!! true ? 0 : 1 ;;! ^^^^ diff --git a/queries/cpp.scm b/queries/cpp.scm index 2b1bf3f7c1..86fea784a1 100644 --- a/queries/cpp.scm +++ b/queries/cpp.scm @@ -19,10 +19,6 @@ (_ (class_specifier name: (_) @name - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @_.domain.start @class.start @type.start . ";"? @_.domain.end @class.end @type.end @@ -40,10 +36,6 @@ ;;!! namespace NS { } (namespace_definition name: (_) @name - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @_.domain (field_declaration_list @@ -60,12 +52,7 @@ ;;!! []() {} ;;! ^^^^^^^ -(lambda_expression - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @anonymousFunction @interior.domain +(lambda_expression) @anonymousFunction ;;!! [[attribute]] ;;! ^^^^^^^^^ @@ -96,20 +83,12 @@ ;;!! try {} ;;! ^^^^^^ (try_statement - "try" @branch.start @interior.domain.start - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @interior.domain.end + "try" @branch.start + body: (_) @branch.end ) @branch.iteration ;;!! catch (const std::exception e) {} -(catch_clause - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @branch @interior.domain +(catch_clause) @branch ;;!! new Foo() ;;! ^^^^^^^^^ @@ -146,10 +125,6 @@ (for_range_loop declarator: (_) @name right: (_) @value - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @_.domain (trailing_return_type diff --git a/queries/csharp.scm b/queries/csharp.scm index 20dea66899..d6f6d87978 100644 --- a/queries/csharp.scm +++ b/queries/csharp.scm @@ -72,14 +72,13 @@ "}" @statement.iteration.end.startOf ) -( - (_ - (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) - ) @_.domain - (#not-type? @_.domain try_statement if_statement) +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . ) ;;!! if () {} else {} @@ -101,47 +100,28 @@ (#not-parent-type? @condition.domain if_statement) ) -( - (if_statement - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @interior.domain.end.endOf - ) @interior.domain.start.startOf - (#not-parent-type? @interior.domain.start.startOf if_statement) -) - ;;!! else if () {} ;;! ^^^^^^^^^^^^^ (if_statement - "else" @branch.start.startOf @interior.domain.start.startOf @condition.domain.start.startOf + "else" @branch.start.startOf @condition.domain.start.startOf (if_statement condition: (_) @condition - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end.endOf @interior.domain.end.endOf @condition.domain.end.endOf + consequence: (_) @branch.end.endOf @condition.domain.end.endOf ) ) ;;!! else {} ;;! ^^^^^^^ (if_statement - "else" @branch.start @interior.domain.start.startOf - alternative: (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @interior.domain.end.endOf + "else" @branch.start + alternative: (block) @branch.end ) ;;!! try () {} ;;! ^^^^^^^^^ (try_statement - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end.endOf @interior.domain.end.endOf -) @branch.start.startOf @interior.domain.start.startOf + body: (_) @branch.end.endOf +) @branch.start.startOf ;;!! catch () {} ;;! ^^^^^^^^^^^ @@ -149,12 +129,7 @@ ;;!! finally {} ;;! ^^^^^^^^^^ -(finally_clause - (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @branch @interior.domain +(finally_clause) @branch ;;!! try () {} catch () {} finally {} ;;! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -189,10 +164,6 @@ ;;! ^^^^^^^^^^^^ (class_declaration name: (identifier) @name - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) ) @class @type @_.domain (class_declaration @@ -211,12 +182,7 @@ ;;!! interface IFoo {} ;;! ^^^^^^^^^^^^^^^^^ -(interface_declaration - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @type @interior.domain +(interface_declaration) @type (interface_declaration body: (_ @@ -303,44 +269,31 @@ "new" @functionCallee.start type: (_) @functionCallee.end ) -] @_.domain - -;;!! switch(value) { } -;;! ^ -(switch_statement - (switch_body - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @_.domain +] @functionCallee.domain (switch_statement (tuple_expression) @value -) @_.domain +) @value.domain (switch_statement value: (_) @value -) @_.domain +) @value.domain (_ condition: (_) @condition (#not-parent-type? @condition if_statement) -) @_.domain +) @condition.domain (while_statement . (_) @condition -) @_.domain +) @condition.domain (do_statement - (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) "while" . (_) @condition -) @_.domain +) @condition.domain ;;!! case 0: break; ;;! ^^^^^^^^^^^^^^ @@ -353,30 +306,19 @@ . (_) @condition ) -) @_.domain +) @condition.domain ;;!! default: break; -;;! ^^^^^^ +;;! ^^^^^^^ (switch_section [ (case_switch_label) (default_switch_label) - ] + ] @interior.start.endOf . - (_) @interior.start - (_)? @interior.end - . - (#not-type? @interior.start "block") -) @_.domain - -;;!! case 0: { } -;;! ^ -(switch_section - (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @_.domain + (_) @_dummy + (#not-type? @_dummy block) +) @interior.end.endOf (switch_statement body: (switch_body @@ -480,10 +422,10 @@ ;;!! enum Foo {} (enum_declaration body: (_ - "{" @interior.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf - "}" @interior.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf + "{" @name.iteration.start.endOf @value.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf ) -) @type @interior.domain +) @type ;;!! bar = 0 ;;! ^ diff --git a/queries/go.scm b/queries/go.scm index 7cb7da5335..1a57ed82a8 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -31,6 +31,15 @@ (var_declaration) ] @statement +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) + ( (interpreted_string_literal) @string @textFragment (#child-range! @textFragment 0 -1 true true) @@ -200,35 +209,16 @@ ;; func foo() (function_declaration name: (_) @name - body: (block - . - "{" @interior.start.endOf - "}" @interior.end.startOf - . - )? -) @namedFunction @_.domain +) @namedFunction @name.domain ;; method declaration ;; func (X) foo() {} (method_declaration name: (_) @name - body: (block - . - "{" @interior.start.endOf - "}" @interior.end.startOf - . - ) -) @namedFunction @_.domain +) @namedFunction @name.domain ;; func literal -(func_literal - body: (block - . - "{" @interior.start.endOf - "}" @interior.end.startOf - . - ) -) @anonymousFunction @namedFunction @interior.domain +(func_literal) @anonymousFunction @namedFunction ;; switch-based branch diff --git a/queries/html.scm b/queries/html.scm index 3559b325dc..d9bb38df44 100644 --- a/queries/html.scm +++ b/queries/html.scm @@ -70,7 +70,7 @@ (_ (start_tag) @interior.start.endOf (end_tag) @interior.end.startOf -) @xmlElement @interior.domain +) @xmlElement ;;!! text ;;! ^^^^^ ^^^^^^ diff --git a/queries/java.scm b/queries/java.scm index 5630223dd7..1a898680dc 100644 --- a/queries/java.scm +++ b/queries/java.scm @@ -5,7 +5,6 @@ [ (annotation_type_declaration) (class_declaration) - (enum_declaration) (import_declaration) (interface_declaration) (module_declaration) @@ -13,7 +12,6 @@ (assert_statement) (break_statement) (continue_statement) - (declaration) (do_statement) (enhanced_for_statement) (expression_statement) @@ -38,9 +36,11 @@ ;; exceptions ;; ";", ;; "block", + ;; (declaration) ;; Is a compound of all other declarations ;; Disabled on purpose. We have a better definition of this below. ;; (if_statement) + ;; (enum_declaration) ] @statement ( @@ -54,10 +54,19 @@ (enum_declaration name: (_) @name body: (_ - "{" @interior.start.endOf @name.iteration.start.endOf - "}" @interior.end.startOf @name.iteration.end.startOf + "{" @name.iteration.start.endOf + "}" @name.iteration.end.startOf ) -) @type @name.domain @interior.domain +) @statement @type @name.domain + +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) ;;!! enum Foo { bar, baz } ;;! ^^^ ^^^ @@ -114,19 +123,6 @@ (#type? @_dummy block class_body interface_body constructor_body) ) -;;!! { } -;;! ^ -( - (_ - (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @_dummy - ) @_.domain - (#type? @_dummy block class_body interface_body constructor_body switch_block) - (#not-type? @_.domain try_statement if_statement) -) - ;;!! void myFunk() {} ;;! ^^^^^^^^^^^^^^^^ (method_declaration @@ -207,16 +203,20 @@ ) ) @condition.domain +;;!! case "0" -> "zero"; +;;! ^^^^^^^^ +(switch_rule + "->" @interior.start.endOf + (expression_statement) +) @interior.end.endOf + ;;!! case 0: break; -;;! ^^^^^^ -(_ - (switch_label) - . - (_) @interior.start - (_)? @interior.end - . - (#not-type? @interior.start block) -) @_.domain +;;! ^^^^^^^ +(switch_block_statement_group + ":" @interior.start.endOf + (_) @_dummy + (#not-type? @_dummy block) +) @interior.end.endOf (switch_expression body: (_ @@ -236,12 +236,9 @@ ;;! ^^^^^^^^ ( (if_statement - "if" @branch.start @branch.removal.start @interior.domain.start.startOf + "if" @branch.start @branch.removal.start condition: (_) @condition - consequence: (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @branch.removal.end @interior.domain.end.endOf + consequence: (_) @branch.end @branch.removal.end "else"? @branch.removal.end.startOf alternative: (if_statement)? @branch.removal.end.startOf ) @condition.domain @@ -252,13 +249,10 @@ ;;!! else if () {} ;;! ^^^^^^^^^^^^^ (if_statement - "else" @branch.start @condition.domain.start @interior.domain.start.startOf + "else" @branch.start @condition.domain.start alternative: (if_statement condition: (_) @condition - consequence: (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @condition.domain.end @interior.domain.end.endOf + consequence: (block) @branch.end @condition.domain.end (#child-range! @condition 0 -1 true true) ) ) @@ -266,21 +260,15 @@ ;;!! else {} ;;! ^^^^^^^ (if_statement - "else" @branch.start @interior.domain.start.startOf - alternative: (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @interior.domain.end.endOf + "else" @branch.start + alternative: (block) @branch.end ) ;;!! try {} ;;! ^^^^^^ (try_statement - "try" @branch.start @interior.domain.start.startOf - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @interior.domain.end.endOf + "try" @branch.start + body: (_) @branch.end ) ;;!! catch (Exception e) {} diff --git a/queries/javascript.core.scm b/queries/javascript.core.scm index 21d402ccaf..3542c89eac 100644 --- a/queries/javascript.core.scm +++ b/queries/javascript.core.scm @@ -57,6 +57,15 @@ (#document-range! @name.iteration @value.iteration @type.iteration) ) +;;!! { } +;;! ^ +(_ + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) + ;; `name` scope without `export` ( (_ @@ -502,17 +511,6 @@ (#type? @_dummy statement_block class_body interface_body) ) -( - (_ - (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @_dummy - ) @_.domain - (#type? @_dummy statement_block class_body interface_body switch_body) - (#not-type? @_.domain if_statement try_statement) -) - ;;!! const aaa = {bbb: 0, ccc: 0}; ;;! ************** (object @@ -682,19 +680,23 @@ ;;! ^^^^^^^^^^^^^^^ (switch_default) @branch +;;!! case 0: break; +;;! ^^^^^^^ (switch_case - body: (_) @interior.start - body: (_)? @interior.end + ":" @interior.start.endOf . - (#not-type? @interior.start statement_block) -) @_.domain + (_) @_dummy + (#not-type? @_dummy statement_block) +) @interior.end.endOf +;;!! default: break; +;;! ^^^^^^^ (switch_default - body: (_) @interior.start - body: (_)? @interior.end + ":" @interior.start.endOf . - (#not-type? @interior.start statement_block) -) @_.domain + (_) @_dummy + (#not-type? @_dummy statement_block) +) @interior.end.endOf ;;!! if () {} else {} ;;! ^^^^^^^^^^^^^^^^ @@ -707,12 +709,9 @@ ;;! ^^^^^^^^ ( (if_statement - "if" @branch.start.startOf @branch.removal.start.startOf @interior.domain.start.startOf + "if" @branch.start.startOf @branch.removal.start.startOf condition: (_) @condition - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end.endOf @branch.removal.end.endOf @interior.domain.end.endOf + consequence: (_) @branch.end.endOf @branch.removal.end.endOf alternative: (else_clause (if_statement)? @branch.removal.end.startOf )? @branch.removal.end.startOf @@ -724,13 +723,10 @@ ;;!! else if () {} ;;! ^^^^^^^^^^^^^ (else_clause - "else" @branch.start.startOf @condition.domain.start.startOf @interior.domain.start.startOf + "else" @branch.start.startOf @condition.domain.start.startOf (if_statement condition: (_) @condition - consequence: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end.endOf @condition.domain.end.endOf @interior.domain.end.endOf + consequence: (_) @branch.end.endOf @condition.domain.end.endOf ) (#child-range! @condition 0 -1 true true) ) @@ -738,20 +734,14 @@ ;;!! else {} ;;! ^^^^^^^ (else_clause - (statement_block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @branch @interior.domain + (statement_block) +) @branch ;;!! try () {} ;;! ^^^^^^^^^ (try_statement - "try" @branch.start @interior.domain.start.startOf - body: (_ - "{" @interior.start.endOf - "}" @interior.end.startOf - ) @branch.end @interior.domain.end.endOf + "try" @branch.start + body: (_) @branch.end ) ;;!! catch () {} diff --git a/queries/javascript.jsx.scm b/queries/javascript.jsx.scm index 2825fcff08..d673455c01 100644 --- a/queries/javascript.jsx.scm +++ b/queries/javascript.jsx.scm @@ -1,23 +1,19 @@ ;;!! bar ;;! ^^^^^^^^^^^^^^ -;;! ### -;;! *** -( - (jsx_element) @xmlElement @interior @interior.domain - (#child-range! @interior 0 -1 true true) -) -( - (jsx_element) @xmlElement.iteration - (#child-range! @xmlElement.iteration 0 -1 true true) +(jsx_element) @xmlElement + +;;!! bar +;;! ^^^ +(jsx_element + (jsx_opening_element) @interior.start.endOf @xmlElement.iteration.start.endOf + (jsx_closing_element) @interior.end.startOf @xmlElement.iteration.end.startOf ) ;;!! bar -;;! *** -( - (jsx_element) @xmlStartTag.iteration @xmlEndTag.iteration @xmlBothTags.iteration - (#child-range! @xmlStartTag.iteration 0 -1 true true) - (#child-range! @xmlEndTag.iteration 0 -1 true true) - (#child-range! @xmlBothTags.iteration 0 -1 true true) +;;! ^^^ +(jsx_element + (jsx_opening_element) @xmlStartTag.iteration.start.endOf @xmlEndTag.iteration.start.endOf @xmlBothTags.iteration.start.endOf + (jsx_closing_element) @xmlStartTag.iteration.end.startOf @xmlEndTag.iteration.end.startOf @xmlBothTags.iteration.end.startOf ) ;;!! bar diff --git a/queries/latex.scm b/queries/latex.scm index b357165ce1..2918539577 100644 --- a/queries/latex.scm +++ b/queries/latex.scm @@ -16,14 +16,22 @@ (subparagraph) @subParagraph (_ - (begin) @xmlStartTag @interior.start.endOf - (end) @xmlEndTag @interior.end.startOf + (begin) @xmlStartTag + (end) @xmlEndTag ) @environment @xmlElement @_.domain +;;!! \begin{quote} Hello \end{quote} +;;! ^^^^^^^ +(_ + (begin) @interior.start.endOf + (end) @interior.end.startOf +) + (_ (begin) @xmlBothTags (#allow-multiple! @xmlBothTags) ) @_.domain + (_ (end) @xmlBothTags (#allow-multiple! @xmlBothTags) diff --git a/queries/lua.scm b/queries/lua.scm index ed6c682f60..3a11e70ec0 100644 --- a/queries/lua.scm +++ b/queries/lua.scm @@ -49,11 +49,18 @@ ;;! ^^^^^^^^^^^^^^^^ ;;! ^^^^ (if_statement - "if" @interior.domain.start condition: (_) @condition - consequence: (_)? @interior @interior.domain.end ) @ifStatement @condition.domain @branch.iteration +;;!! if true then a=1 end +;;! ^^^^^ +(if_statement + "then" @interior.start.endOf + consequence: (_) + . + _ @interior.end.startOf +) + ;;!! if true then end ;;! ^^^^^^^^^^^^ (if_statement @@ -85,16 +92,25 @@ ;;!! elseif true then ;;! ^^^^^^^^^^^^^^^^ ;;! ^^^^ -(elseif_statement - condition: (_) @condition - consequence: (_) @interior -) @branch @_.domain +(if_statement + (elseif_statement + condition: (_) @condition + "then" @interior.start.endOf + ) @branch @condition.domain + . + _ @interior.end.startOf +) ;;!! else then ;;! ^^^^^^^^^ -(else_statement - body: (_) @interior -) @branch @interior.domain + +(if_statement + (else_statement + "else" @interior.start.endOf + ) @branch + . + _ @interior.end.startOf +) ;;!! while true do ;;! ^^^^ @@ -220,7 +236,7 @@ name: (_) @name parameters: (_) @interior.start.endOf "end" @interior.end.startOf -) @namedFunction @_.domain +) @namedFunction @name.domain ;; inside lambda: ;;!! __add = function(a, b) return a + b end @@ -231,7 +247,7 @@ (function_definition parameters: (_) @interior.start.endOf "end" @interior.end.startOf -) @anonymousFunction @_.domain +) @anonymousFunction ;; Names and values diff --git a/queries/markdown.scm b/queries/markdown.scm index e81ecc9e9c..afb93bd165 100644 --- a/queries/markdown.scm +++ b/queries/markdown.scm @@ -52,7 +52,7 @@ . (block_continuation) (fenced_code_block_delimiter) @interior.end.startOf - ) @notebookCell @interior.domain + ) @notebookCell (#trim-end! @notebookCell) (#insertion-delimiter! @notebookCell "\n\n") ) @@ -68,7 +68,7 @@ (fenced_code_block (info_string) @interior.start.endOf (fenced_code_block_delimiter) @interior.end.startOf - ) @notebookCell @interior.domain + ) @notebookCell (#trim-end! @notebookCell) (#insertion-delimiter! @notebookCell "\n\n") ) diff --git a/queries/python.scm b/queries/python.scm index eaf072cc30..81af439cbf 100644 --- a/queries/python.scm +++ b/queries/python.scm @@ -34,6 +34,14 @@ ;; (if_statement) ] @statement +;;!! if True: pass +;;! ^^^^^ +(_ + ":" @interior.start.endOf + . + (block) @interior.end.endOf +) + ;;!! a = 25 ;;! ^^ ;;! xxxxx @@ -170,12 +178,6 @@ (_) @value ) @_.domain -;;!! with aaa: -;;! ^^^ -(with_statement - body: (_) @interior -) @interior.domain - ;;!! with aaa: ;;! ^^^ ;;! -------- @@ -298,7 +300,6 @@ ( (function_definition name: (_) @name - body: (_) @interior ) @namedFunction @statement @_.domain (#not-parent-type? @namedFunction decorated_definition) ) @@ -308,7 +309,6 @@ (decorated_definition (function_definition name: (_) @name - body: (_) @interior ) ) @namedFunction @_.domain @@ -333,7 +333,6 @@ ( (class_definition name: (_) @name - body: (_) @interior ) @_.domain (#not-parent-type? @_.domain decorated_definition) ) @@ -347,7 +346,6 @@ (decorated_definition (class_definition name: (_) @name - body: (_) @interior ) ) @_.domain @@ -407,7 +405,6 @@ ;;! ^^^^^ (match_statement subject: (_) @value - body: (_) @interior ) @_.domain ;;!! { "value": 0 } @@ -433,7 +430,6 @@ (case_clause (case_pattern) @condition.start guard: (_)? @condition.end - consequence: (_) @interior ) @_.domain ;;!! case 0: pass @@ -482,13 +478,6 @@ ;;! ^^^^^^^^^^^^^^^^^^^^^^^^ (if_statement) @ifStatement @statement @branch.iteration -;;!! if True: pass -;;! ^^^^^^^^^^^^^ -(if_statement - "if" @interior.domain.start - consequence: (_) @interior @interior.domain.end -) - ;;!! if True: pass ;;! ^^^^^^^^^^^^^ (if_statement @@ -511,33 +500,27 @@ ;;!! elif True: pass ;;! ^^^^^^^^^^^^^^^ (elif_clause - consequence: (_) @interior -) @branch @interior.domain + consequence: (_) +) @branch ;;!! else: pass ;;! ^^^^^^^^^^ -(else_clause - body: (_) @interior -) @branch @interior.domain +(else_clause) @branch ;;!! try: pass ;;! ^^^^^^^^^ (try_statement - "try" @branch.start @interior.domain.start - body: (_) @branch.end @interior @interior.domain.end + "try" @branch.start + body: (_) @branch.end ) ;;!! except: pass ;;! ^^^^^^^^^^^^ -(except_clause - (block) @interior -) @branch @interior.domain +(except_clause) @branch ;;!! except*: pass ;;! ^^^^^^^^^^^^^ -(except_group_clause - (block) @interior -) @branch @interior.domain +(except_group_clause) @branch ;;!! except Exception as ex: ;;! ^^^^^^^^^^^^^^^ @@ -553,8 +536,8 @@ ;;!! finally: pass ;;! ^^^^^^^^^^^^^ (finally_clause - (block) @interior -) @branch @interior.domain + (block) +) @branch (try_statement) @branch.iteration @@ -562,8 +545,8 @@ ;;! ^^^^^^^^^^^^^^^^ (while_statement "while" @branch.start - body: (_) @branch.end @interior -) @interior.domain + body: (_) @branch.end +) (while_statement) @branch.iteration @@ -571,8 +554,8 @@ ;;! ^^^^^^^^^^^^^^^^^^^^ (for_statement "for" @branch.start - body: (_) @branch.end @interior -) @interior.domain + body: (_) @branch.end +) (for_statement) @branch.iteration diff --git a/queries/r.scm b/queries/r.scm index f70cd30cdb..b34f60cd6f 100644 --- a/queries/r.scm +++ b/queries/r.scm @@ -27,7 +27,7 @@ rhs: (function_definition name: "function" parameters: (parameters) - body: (braced_expression) @interior + body: (braced_expression) ) @name.trailing.startOf ) @namedFunction @_.domain diff --git a/queries/scss.scm b/queries/scss.scm index ceda500c02..256bbd63d4 100644 --- a/queries/scss.scm +++ b/queries/scss.scm @@ -30,12 +30,14 @@ (while_statement) ] @statement +;;!! { } +;;! ^ (_ - (block - "{" @interior.start.endOf - "}" @interior.end.startOf - ) -) @_.domain + . + "{" @interior.start.endOf + "}" @interior.end.startOf + . +) (single_line_comment) @comment @textFragment diff --git a/queries/talon.scm b/queries/talon.scm index 74b212f428..8b5f86d576 100644 --- a/queries/talon.scm +++ b/queries/talon.scm @@ -121,12 +121,19 @@ ;;!! slap: key(enter) ;;! ^^^^^^^^^^^^^^^^ ( - (command_declaration - right: (_) @interior - ) @command @interior.domain + (command_declaration) @command (#insertion-delimiter! @command "\n") ) +;;!! slap: key(enter) +;;! ^^^^^^^^^^^ +( + (command_declaration + ":" @interior.start.endOf + right: (_) @interior.end.endOf + ) +) + ;;!! key(enter) ;;! ^^^^^^^^^^ ;;!! edit.left() diff --git a/queries/typescript.core.scm b/queries/typescript.core.scm index b1430d08e4..e58003a4b1 100644 --- a/queries/typescript.core.scm +++ b/queries/typescript.core.scm @@ -39,10 +39,10 @@ ;;! ^ (enum_declaration (enum_body - "{" @interior.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf - "}" @interior.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf + "{" @name.iteration.start.endOf @value.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf ) -) @type @interior.domain +) @type ;;!! enum Foo { aaa, bbb } ;;! ^^^ ^^^ diff --git a/queries/xml.scm b/queries/xml.scm index f8e3098d6f..450008afd4 100644 --- a/queries/xml.scm +++ b/queries/xml.scm @@ -52,7 +52,7 @@ (element (STag) @interior.start.endOf (ETag) @interior.end.startOf -) @xmlElement @interior.domain +) @xmlElement ;;!! text ;;! ^^^^^ ^^^^^^