diff --git a/data/fixtures/recorded/languages/go/changeEveryBranchSun.yml b/data/fixtures/recorded/languages/go/changeEveryBranchSun.yml deleted file mode 100644 index 8eb778e9c1..0000000000 --- a/data/fixtures/recorded/languages/go/changeEveryBranchSun.yml +++ /dev/null @@ -1,38 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change every branch sun - action: - name: clearAndSetSelection - target: - type: primitive - mark: {type: decoratedSymbol, symbolColor: default, character: s} - modifiers: - - type: everyScope - scopeType: {type: branch} - usePrePhraseSnapshot: true -initialState: - documentContents: |- - switch x { - case 1: - default: - panic(x) - } - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: - default.s: - start: {line: 0, character: 0} - end: {line: 0, character: 6} -finalState: - documentContents: |- - switch x { - - - } - selections: - - anchor: {line: 1, character: 0} - active: {line: 1, character: 0} - - anchor: {line: 2, character: 0} - active: {line: 2, character: 0} diff --git a/data/fixtures/recorded/languages/go/changeFunk.yml b/data/fixtures/recorded/languages/go/changeFunk.yml deleted file mode 100644 index 0920f68c35..0000000000 --- a/data/fixtures/recorded/languages/go/changeFunk.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change funk - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: namedFunction} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = func() { /* body */ } - selections: - - anchor: {line: 0, character: 25} - active: {line: 0, character: 25} - marks: {} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListCap.yml b/data/fixtures/recorded/languages/go/changeListCap.yml deleted file mode 100644 index 107308a088..0000000000 --- a/data/fixtures/recorded/languages/go/changeListCap.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list cap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: c} - usePrePhraseSnapshot: true -initialState: - documentContents: | - _ = T{ /* comment */ } - selections: - - anchor: {line: 0, character: 22} - active: {line: 0, character: 22} - marks: - default.c: - start: {line: 0, character: 10} - end: {line: 0, character: 17} -finalState: - documentContents: | - _ = - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListCap2.yml b/data/fixtures/recorded/languages/go/changeListCap2.yml deleted file mode 100644 index 6d4f67b888..0000000000 --- a/data/fixtures/recorded/languages/go/changeListCap2.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list cap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: c} - usePrePhraseSnapshot: true -initialState: - documentContents: | - _ = &T{ /* comment */ } - selections: - - anchor: {line: 0, character: 23} - active: {line: 0, character: 23} - marks: - default.c: - start: {line: 0, character: 11} - end: {line: 0, character: 18} -finalState: - documentContents: | - _ = - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListOne.yml b/data/fixtures/recorded/languages/go/changeListOne.yml deleted file mode 100644 index d387bf0d35..0000000000 --- a/data/fixtures/recorded/languages/go/changeListOne.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list one - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: '1'} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = T{{1}} - selections: - - anchor: {line: 0, character: 10} - active: {line: 0, character: 10} - marks: - default.1: - start: {line: 0, character: 7} - end: {line: 0, character: 8} -finalState: - documentContents: _ = T{} - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/go/changeListOne2.yml b/data/fixtures/recorded/languages/go/changeListOne2.yml deleted file mode 100644 index a8a7e60bee..0000000000 --- a/data/fixtures/recorded/languages/go/changeListOne2.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list one - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: '1'} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = T{{1, 2: \"a\"}}" - selections: - - anchor: {line: 0, character: 18} - active: {line: 0, character: 18} - marks: - default.1: - start: {line: 0, character: 7} - end: {line: 0, character: 8} -finalState: - documentContents: _ = T{} - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/go/changeListTrap.yml b/data/fixtures/recorded/languages/go/changeListTrap.yml deleted file mode 100644 index 33d13e660a..0000000000 --- a/data/fixtures/recorded/languages/go/changeListTrap.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = &T{} - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: - default.t: - start: {line: 0, character: 5} - end: {line: 0, character: 6} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListTrap2.yml b/data/fixtures/recorded/languages/go/changeListTrap2.yml deleted file mode 100644 index 9a9238d55f..0000000000 --- a/data/fixtures/recorded/languages/go/changeListTrap2.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = &T{1} - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: - default.t: - start: {line: 0, character: 5} - end: {line: 0, character: 6} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListTrap3.yml b/data/fixtures/recorded/languages/go/changeListTrap3.yml deleted file mode 100644 index d9d4560c8e..0000000000 --- a/data/fixtures/recorded/languages/go/changeListTrap3.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = T{} - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} - marks: - default.t: - start: {line: 0, character: 4} - end: {line: 0, character: 5} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListTrap4.yml b/data/fixtures/recorded/languages/go/changeListTrap4.yml deleted file mode 100644 index f8683e405f..0000000000 --- a/data/fixtures/recorded/languages/go/changeListTrap4.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = T{1, 2: \"a\"}" - selections: - - anchor: {line: 0, character: 16} - active: {line: 0, character: 16} - marks: - default.t: - start: {line: 0, character: 4} - end: {line: 0, character: 5} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeListTwo.yml b/data/fixtures/recorded/languages/go/changeListTwo.yml deleted file mode 100644 index 2f762529e4..0000000000 --- a/data/fixtures/recorded/languages/go/changeListTwo.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change list two - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - mark: {type: decoratedSymbol, symbolColor: default, character: '2'} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = T{{2: \"a\"}}" - selections: - - anchor: {line: 0, character: 15} - active: {line: 0, character: 15} - marks: - default.2: - start: {line: 0, character: 7} - end: {line: 0, character: 8} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapCap.yml b/data/fixtures/recorded/languages/go/changeMapCap.yml deleted file mode 100644 index 0060d8f7bf..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapCap.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map cap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: c} - usePrePhraseSnapshot: true -initialState: - documentContents: | - _ = T{ /* comment */ } - selections: - - anchor: {line: 0, character: 22} - active: {line: 0, character: 22} - marks: - default.c: - start: {line: 0, character: 10} - end: {line: 0, character: 17} -finalState: - documentContents: | - _ = - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapCap2.yml b/data/fixtures/recorded/languages/go/changeMapCap2.yml deleted file mode 100644 index b8bfb79d1e..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapCap2.yml +++ /dev/null @@ -1,29 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map cap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: c} - usePrePhraseSnapshot: true -initialState: - documentContents: | - _ = &T{ /* comment */ } - selections: - - anchor: {line: 0, character: 23} - active: {line: 0, character: 23} - marks: - default.c: - start: {line: 0, character: 11} - end: {line: 0, character: 18} -finalState: - documentContents: | - _ = - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapOne2.yml b/data/fixtures/recorded/languages/go/changeMapOne2.yml deleted file mode 100644 index 55981f8619..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapOne2.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map one - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: '1'} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = T{{1, 2: \"a\"}}" - selections: - - anchor: {line: 0, character: 18} - active: {line: 0, character: 18} - marks: - default.1: - start: {line: 0, character: 7} - end: {line: 0, character: 8} -finalState: - documentContents: _ = T{} - selections: - - anchor: {line: 0, character: 6} - active: {line: 0, character: 6} diff --git a/data/fixtures/recorded/languages/go/changeMapTrap.yml b/data/fixtures/recorded/languages/go/changeMapTrap.yml deleted file mode 100644 index d67bc1a17d..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapTrap.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = &T{} - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: - default.t: - start: {line: 0, character: 5} - end: {line: 0, character: 6} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapTrap2.yml b/data/fixtures/recorded/languages/go/changeMapTrap2.yml deleted file mode 100644 index 2a231cf5b7..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapTrap2.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = &T{a: 1}" - selections: - - anchor: {line: 0, character: 0} - active: {line: 0, character: 0} - marks: - default.t: - start: {line: 0, character: 5} - end: {line: 0, character: 6} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapTrap3.yml b/data/fixtures/recorded/languages/go/changeMapTrap3.yml deleted file mode 100644 index c651dce1a7..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapTrap3.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: _ = T{} - selections: - - anchor: {line: 0, character: 7} - active: {line: 0, character: 7} - marks: - default.t: - start: {line: 0, character: 4} - end: {line: 0, character: 5} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/changeMapTrap4.yml b/data/fixtures/recorded/languages/go/changeMapTrap4.yml deleted file mode 100644 index 6b1c8a2a46..0000000000 --- a/data/fixtures/recorded/languages/go/changeMapTrap4.yml +++ /dev/null @@ -1,27 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: change map trap - action: - name: clearAndSetSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - mark: {type: decoratedSymbol, symbolColor: default, character: t} - usePrePhraseSnapshot: true -initialState: - documentContents: "_ = T{1, 2: \"a\"}" - selections: - - anchor: {line: 0, character: 16} - active: {line: 0, character: 16} - marks: - default.t: - start: {line: 0, character: 4} - end: {line: 0, character: 5} -finalState: - documentContents: "_ = " - selections: - - anchor: {line: 0, character: 4} - active: {line: 0, character: 4} diff --git a/data/fixtures/recorded/languages/go/takeList.yml b/data/fixtures/recorded/languages/go/takeList.yml deleted file mode 100644 index a6501f9ebc..0000000000 --- a/data/fixtures/recorded/languages/go/takeList.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: take list - action: - name: setSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: list} - usePrePhraseSnapshot: false -initialState: - documentContents: x := []string{"a", "b"} - selections: - - anchor: {line: 0, character: 16} - active: {line: 0, character: 16} - marks: {} -finalState: - documentContents: x := []string{"a", "b"} - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 23} diff --git a/data/fixtures/recorded/languages/go/takeMap.yml b/data/fixtures/recorded/languages/go/takeMap.yml deleted file mode 100644 index 0e2fbeca28..0000000000 --- a/data/fixtures/recorded/languages/go/takeMap.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: take map - action: - name: setSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: map} - usePrePhraseSnapshot: false -initialState: - documentContents: "x := map[string]string{\"a\": \"b\"}" - selections: - - anchor: {line: 0, character: 24} - active: {line: 0, character: 24} - marks: {} -finalState: - documentContents: "x := map[string]string{\"a\": \"b\"}" - selections: - - anchor: {line: 0, character: 5} - active: {line: 0, character: 32} diff --git a/data/fixtures/recorded/languages/go/takeState.yml b/data/fixtures/recorded/languages/go/takeState.yml deleted file mode 100644 index cb38cdde96..0000000000 --- a/data/fixtures/recorded/languages/go/takeState.yml +++ /dev/null @@ -1,23 +0,0 @@ -languageId: go -command: - version: 6 - spokenForm: take state - action: - name: setSelection - target: - type: primitive - modifiers: - - type: containingScope - scopeType: {type: statement} - usePrePhraseSnapshot: false -initialState: - documentContents: "type Hello struct {\n\tworld string\n}" - selections: - - anchor: {line: 1, character: 12} - active: {line: 1, character: 12} - marks: {} -finalState: - documentContents: "type Hello struct {\n\tworld string\n}" - selections: - - anchor: {line: 0, character: 0} - active: {line: 2, character: 1} diff --git a/data/fixtures/scopes/go/anonymousFunction.scope b/data/fixtures/scopes/go/anonymousFunction.scope new file mode 100644 index 0000000000..4df5d7defd --- /dev/null +++ b/data/fixtures/scopes/go/anonymousFunction.scope @@ -0,0 +1,17 @@ +foo := func() {} +--- + +[Content] = +[Domain] = 0:7-0:16 + >---------< +0| foo := func() {} + +[Removal] = 0:6-0:16 + >----------< +0| foo := func() {} + +[Leading delimiter] = 0:6-0:7 + >-< +0| foo := func() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/argument/argument.actual.iteration.scope b/data/fixtures/scopes/go/argument/argument.actual.iteration.scope new file mode 100644 index 0000000000..0ea7673e0e --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.iteration.scope @@ -0,0 +1,10 @@ +foo(aaa, bbb, ccc) +--- + +[Content] = 0:4-0:17 + >-------------< +0| foo(aaa, bbb, ccc) + +[Domain] = 0:0-0:18 + >------------------< +0| foo(aaa, bbb, ccc) diff --git a/data/fixtures/scopes/go/argument/argument.actual.method.iteration.scope b/data/fixtures/scopes/go/argument/argument.actual.method.iteration.scope new file mode 100644 index 0000000000..3afa7f9d34 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.method.iteration.scope @@ -0,0 +1,10 @@ +foo.bar(aaa, bbb, ccc) +--- + +[Content] = 0:8-0:21 + >-------------< +0| foo.bar(aaa, bbb, ccc) + +[Domain] = 0:0-0:22 + >----------------------< +0| foo.bar(aaa, bbb, ccc) diff --git a/data/fixtures/scopes/go/argument/argument.actual.method.multiLine.scope b/data/fixtures/scopes/go/argument/argument.actual.method.multiLine.scope new file mode 100644 index 0000000000..d77be8ad8e --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.method.multiLine.scope @@ -0,0 +1,44 @@ +foo.bar( + aaa, + bbb, +) +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:7 + >---< +1| aaa, + +[#1 Removal] = 1:4-2:4 + >---- +1| aaa, +2| bbb, + ----< + +[#1 Trailing delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb, + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:7 + >---< +2| bbb, + +[#2 Removal] = 1:7-2:7 + >- +1| aaa, +2| bbb, + -------< + +[#2 Leading delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb, + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argument/argument.actual.method.singleLine.scope b/data/fixtures/scopes/go/argument/argument.actual.method.singleLine.scope new file mode 100644 index 0000000000..d22bd33706 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.method.singleLine.scope @@ -0,0 +1,33 @@ +foo.bar(aaa, bbb) +--- + +[#1 Content] = +[#1 Domain] = 0:8-0:11 + >---< +0| foo.bar(aaa, bbb) + +[#1 Removal] = 0:8-0:13 + >-----< +0| foo.bar(aaa, bbb) + +[#1 Trailing delimiter] = 0:11-0:13 + >--< +0| foo.bar(aaa, bbb) + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:13-0:16 + >---< +0| foo.bar(aaa, bbb) + +[#2 Removal] = 0:11-0:16 + >-----< +0| foo.bar(aaa, bbb) + +[#2 Leading delimiter] = 0:11-0:13 + >--< +0| foo.bar(aaa, bbb) + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argument/argument.actual.multiLine.scope b/data/fixtures/scopes/go/argument/argument.actual.multiLine.scope new file mode 100644 index 0000000000..796855df6e --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.multiLine.scope @@ -0,0 +1,44 @@ +foo( + aaa, + bbb, +) +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:7 + >---< +1| aaa, + +[#1 Removal] = 1:4-2:4 + >---- +1| aaa, +2| bbb, + ----< + +[#1 Trailing delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb, + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:7 + >---< +2| bbb, + +[#2 Removal] = 1:7-2:7 + >- +1| aaa, +2| bbb, + -------< + +[#2 Leading delimiter] = 1:7-2:4 + >- +1| aaa, +2| bbb, + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argument/argument.actual.singleLine.scope b/data/fixtures/scopes/go/argument/argument.actual.singleLine.scope new file mode 100644 index 0000000000..b1a9403ff3 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.actual.singleLine.scope @@ -0,0 +1,33 @@ +foo(aaa, bbb) +--- + +[#1 Content] = +[#1 Domain] = 0:4-0:7 + >---< +0| foo(aaa, bbb) + +[#1 Removal] = 0:4-0:9 + >-----< +0| foo(aaa, bbb) + +[#1 Trailing delimiter] = 0:7-0:9 + >--< +0| foo(aaa, bbb) + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:9-0:12 + >---< +0| foo(aaa, bbb) + +[#2 Removal] = 0:7-0:12 + >-----< +0| foo(aaa, bbb) + +[#2 Leading delimiter] = 0:7-0:9 + >--< +0| foo(aaa, bbb) + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argument/argument.formal.iteration.scope b/data/fixtures/scopes/go/argument/argument.formal.iteration.scope new file mode 100644 index 0000000000..4ae5d8a591 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.iteration.scope @@ -0,0 +1,10 @@ +func foo(aaa int, bbb string, ccc int) {} +--- + +[Content] = 0:9-0:37 + >----------------------------< +0| func foo(aaa int, bbb string, ccc int) {} + +[Domain] = 0:0-0:41 + >-----------------------------------------< +0| func foo(aaa int, bbb string, ccc int) {} diff --git a/data/fixtures/scopes/go/argument/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/go/argument/argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..c70dfa181e --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.lambda.iteration.scope @@ -0,0 +1,10 @@ +func(aaa int, bbb string, ccc int) {} +--- + +[Content] = 0:5-0:33 + >----------------------------< +0| func(aaa int, bbb string, ccc int) {} + +[Domain] = 0:0-0:37 + >-------------------------------------< +0| func(aaa int, bbb string, ccc int) {} diff --git a/data/fixtures/scopes/go/argument/argument.formal.lambda.multiLine.scope b/data/fixtures/scopes/go/argument/argument.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..e70c7ccd1d --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.lambda.multiLine.scope @@ -0,0 +1,44 @@ +func( + aaa int, + bbb string, +) {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:11 + >-------< +1| aaa int, + +[#1 Removal] = 1:4-2:4 + >-------- +1| aaa int, +2| bbb string, + ----< + +[#1 Trailing delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:14 + >----------< +2| bbb string, + +[#2 Removal] = 1:11-2:14 + >- +1| aaa int, +2| bbb string, + --------------< + +[#2 Leading delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argument/argument.formal.lambda.singleLine.scope b/data/fixtures/scopes/go/argument/argument.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..e788b37431 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.lambda.singleLine.scope @@ -0,0 +1,33 @@ +func(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:5-0:12 + >-------< +0| func(aaa int, bbb string) {} + +[#1 Removal] = 0:5-0:14 + >---------< +0| func(aaa int, bbb string) {} + +[#1 Trailing delimiter] = 0:12-0:14 + >--< +0| func(aaa int, bbb string) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:14-0:24 + >----------< +0| func(aaa int, bbb string) {} + +[#2 Removal] = 0:12-0:24 + >------------< +0| func(aaa int, bbb string) {} + +[#2 Leading delimiter] = 0:12-0:14 + >--< +0| func(aaa int, bbb string) {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argument/argument.formal.method.iteration.scope b/data/fixtures/scopes/go/argument/argument.formal.method.iteration.scope new file mode 100644 index 0000000000..b30e516cd7 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.method.iteration.scope @@ -0,0 +1,10 @@ +func (f Foo) bar(aaa int, bbb string, ccc int) {} +--- + +[Content] = 0:17-0:45 + >----------------------------< +0| func (f Foo) bar(aaa int, bbb string, ccc int) {} + +[Domain] = 0:0-0:49 + >-------------------------------------------------< +0| func (f Foo) bar(aaa int, bbb string, ccc int) {} diff --git a/data/fixtures/scopes/go/argument/argument.formal.method.multiLine.scope b/data/fixtures/scopes/go/argument/argument.formal.method.multiLine.scope new file mode 100644 index 0000000000..d071c6aecd --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.method.multiLine.scope @@ -0,0 +1,53 @@ +func (f Foo) bar( + aaa int, + bbb string, +) {} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:6-0:11 + >-----< +0| func (f Foo) bar( + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 1:4-1:11 + >-------< +1| aaa int, + +[#2 Removal] = 1:4-2:4 + >-------- +1| aaa int, +2| bbb string, + ----< + +[#2 Trailing delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 2:4-2:14 + >----------< +2| bbb string, + +[#3 Removal] = 1:11-2:14 + >- +1| aaa int, +2| bbb string, + --------------< + +[#3 Leading delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#3 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argument/argument.formal.method.singleLine.scope b/data/fixtures/scopes/go/argument/argument.formal.method.singleLine.scope new file mode 100644 index 0000000000..d81c3a56e9 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.method.singleLine.scope @@ -0,0 +1,42 @@ +func (f Foo) bar(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:6-0:11 + >-----< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:17-0:24 + >-------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#2 Removal] = 0:17-0:26 + >---------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#2 Trailing delimiter] = 0:24-0:26 + >--< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 0:26-0:36 + >----------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#3 Removal] = 0:24-0:36 + >------------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#3 Leading delimiter] = 0:24-0:26 + >--< +0| func (f Foo) bar(aaa int, bbb string) {} + +[#3 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argument/argument.formal.multiLine.scope b/data/fixtures/scopes/go/argument/argument.formal.multiLine.scope new file mode 100644 index 0000000000..c9b0898619 --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.multiLine.scope @@ -0,0 +1,44 @@ +func foo( + aaa int, + bbb string, +) {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:11 + >-------< +1| aaa int, + +[#1 Removal] = 1:4-2:4 + >-------- +1| aaa int, +2| bbb string, + ----< + +[#1 Trailing delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:14 + >----------< +2| bbb string, + +[#2 Removal] = 1:11-2:14 + >- +1| aaa int, +2| bbb string, + --------------< + +[#2 Leading delimiter] = 1:11-2:4 + >- +1| aaa int, +2| bbb string, + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argument/argument.formal.singleLine.scope b/data/fixtures/scopes/go/argument/argument.formal.singleLine.scope new file mode 100644 index 0000000000..3915fbd53e --- /dev/null +++ b/data/fixtures/scopes/go/argument/argument.formal.singleLine.scope @@ -0,0 +1,33 @@ +func foo(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:9-0:16 + >-------< +0| func foo(aaa int, bbb string) {} + +[#1 Removal] = 0:9-0:18 + >---------< +0| func foo(aaa int, bbb string) {} + +[#1 Trailing delimiter] = 0:16-0:18 + >--< +0| func foo(aaa int, bbb string) {} + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:18-0:28 + >----------< +0| func foo(aaa int, bbb string) {} + +[#2 Removal] = 0:16-0:28 + >------------< +0| func foo(aaa int, bbb string) {} + +[#2 Leading delimiter] = 0:16-0:18 + >--< +0| func foo(aaa int, bbb string) {} + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.empty.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.empty.scope new file mode 100644 index 0000000000..947915ef96 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.empty.scope @@ -0,0 +1,13 @@ +foo() +--- + +[Content] = +[Removal] = 0:4-0:4 + >< +0| foo() + +[Domain] = 0:0-0:5 + >-----< +0| foo() + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.method.empty.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.empty.scope new file mode 100644 index 0000000000..ed61422204 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.empty.scope @@ -0,0 +1,13 @@ +foo.bar() +--- + +[Content] = +[Removal] = 0:8-0:8 + >< +0| foo.bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.method.multiLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.multiLine.scope new file mode 100644 index 0000000000..322349d0e1 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.multiLine.scope @@ -0,0 +1,33 @@ +foo.bar( + aaa, + bbb, +) +--- + +[Content] = 1:4-2:8 + >---- +1| aaa, +2| bbb, + --------< + +[Removal] = 0:8-3:0 + > +0| foo.bar( +1| aaa, +2| bbb, +3| ) + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:1 + >-------- +0| foo.bar( +1| aaa, +2| bbb, +3| ) + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.method.singleLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.singleLine.scope new file mode 100644 index 0000000000..69cf068256 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.method.singleLine.scope @@ -0,0 +1,13 @@ +foo.bar(aaa, bbb) +--- + +[Content] = +[Removal] = 0:8-0:16 + >--------< +0| foo.bar(aaa, bbb) + +[Domain] = 0:0-0:17 + >-----------------< +0| foo.bar(aaa, bbb) + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.multiLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.multiLine.scope new file mode 100644 index 0000000000..2781ed2967 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.multiLine.scope @@ -0,0 +1,33 @@ +foo( + aaa, + bbb, +) +--- + +[Content] = 1:4-2:8 + >---- +1| aaa, +2| bbb, + --------< + +[Removal] = 0:4-3:0 + > +0| foo( +1| aaa, +2| bbb, +3| ) + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:1 + >---- +0| foo( +1| aaa, +2| bbb, +3| ) + -< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.actual.singleLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.actual.singleLine.scope new file mode 100644 index 0000000000..f0de18dd5d --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.actual.singleLine.scope @@ -0,0 +1,13 @@ +foo(aaa, bbb) +--- + +[Content] = +[Removal] = 0:4-0:12 + >--------< +0| foo(aaa, bbb) + +[Domain] = 0:0-0:13 + >-------------< +0| foo(aaa, bbb) + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.empty.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.empty.scope new file mode 100644 index 0000000000..cdfade5856 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.empty.scope @@ -0,0 +1,13 @@ +func foo() {} +--- + +[Content] = +[Removal] = 0:9-0:9 + >< +0| func foo() {} + +[Domain] = 0:0-0:13 + >-------------< +0| func foo() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.empty.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.empty.scope new file mode 100644 index 0000000000..d883d27f58 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.empty.scope @@ -0,0 +1,13 @@ +func() {} +--- + +[Content] = +[Removal] = 0:5-0:5 + >< +0| func() {} + +[Domain] = 0:0-0:9 + >---------< +0| func() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.multiLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..0a3dc1a323 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.multiLine.scope @@ -0,0 +1,33 @@ +func( + aaa int, + bbb string, +) {} +--- + +[Content] = 1:4-2:15 + >-------- +1| aaa int, +2| bbb string, + ---------------< + +[Removal] = 0:5-3:0 + > +0| func( +1| aaa int, +2| bbb string, +3| ) {} + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa int, + +[Domain] = 0:0-3:4 + >----- +0| func( +1| aaa int, +2| bbb string, +3| ) {} + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.singleLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..b347f64e7d --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.lambda.singleLine.scope @@ -0,0 +1,13 @@ +func(aaa int, bbb string) {} +--- + +[Content] = +[Removal] = 0:5-0:24 + >-------------------< +0| func(aaa int, bbb string) {} + +[Domain] = 0:0-0:28 + >----------------------------< +0| func(aaa int, bbb string) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.method.empty.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.empty.scope new file mode 100644 index 0000000000..28a013fff7 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.empty.scope @@ -0,0 +1,13 @@ +func (f Foo) bar() {} +--- + +[Content] = +[Removal] = 0:17-0:17 + >< +0| func (f Foo) bar() {} + +[Domain] = 0:0-0:21 + >---------------------< +0| func (f Foo) bar() {} + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.method.multiLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.multiLine.scope new file mode 100644 index 0000000000..44dac7fc46 --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.multiLine.scope @@ -0,0 +1,33 @@ +func (f Foo) bar( + aaa int, + bbb string, +) {} +--- + +[Content] = 1:4-2:15 + >-------- +1| aaa int, +2| bbb string, + ---------------< + +[Removal] = 0:17-3:0 + > +0| func (f Foo) bar( +1| aaa int, +2| bbb string, +3| ) {} + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa int, + +[Domain] = 0:0-3:4 + >----------------- +0| func (f Foo) bar( +1| aaa int, +2| bbb string, +3| ) {} + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.method.singleLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.singleLine.scope new file mode 100644 index 0000000000..de87859bba --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.method.singleLine.scope @@ -0,0 +1,13 @@ +func (f Foo) bar(aaa int, bbb string) {} +--- + +[Content] = +[Removal] = 0:17-0:36 + >-------------------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[Domain] = 0:0-0:40 + >----------------------------------------< +0| func (f Foo) bar(aaa int, bbb string) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.multiLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.multiLine.scope new file mode 100644 index 0000000000..e3b13c6a4d --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.multiLine.scope @@ -0,0 +1,33 @@ +func foo( + aaa int, + bbb string, +) {} +--- + +[Content] = 1:4-2:15 + >-------- +1| aaa int, +2| bbb string, + ---------------< + +[Removal] = 0:9-3:0 + > +0| func foo( +1| aaa int, +2| bbb string, +3| ) {} + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa int, + +[Domain] = 0:0-3:4 + >--------- +0| func foo( +1| aaa int, +2| bbb string, +3| ) {} + ----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/go/argumentList/argumentList.formal.singleLine.scope b/data/fixtures/scopes/go/argumentList/argumentList.formal.singleLine.scope new file mode 100644 index 0000000000..8203cbd40f --- /dev/null +++ b/data/fixtures/scopes/go/argumentList/argumentList.formal.singleLine.scope @@ -0,0 +1,13 @@ +func foo(aaa int, bbb string) {} +--- + +[Content] = +[Removal] = 0:9-0:28 + >-------------------< +0| func foo(aaa int, bbb string) {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| func foo(aaa int, bbb string) {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/branch/branch.if.elif.else.scope b/data/fixtures/scopes/go/branch/branch.if.elif.else.scope new file mode 100644 index 0000000000..1f5f5582b6 --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.if.elif.else.scope @@ -0,0 +1,68 @@ +if true { +} else if false { +} else { +} +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:1 + >--------- +0| if true { +1| } else if false { + -< + +[#1 Removal] = 0:0-1:2 + >--------- +0| if true { +1| } else if false { + --< + +[#1 Trailing delimiter] = 1:1-1:2 + >-< +1| } else if false { + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 1:2-2:1 + >--------------- +1| } else if false { +2| } else { + -< + +[#2 Removal] = 1:2-2:2 + >--------------- +1| } else if false { +2| } else { + --< + +[#2 Leading delimiter] = 1:1-1:2 + >-< +1| } else if false { + +[#2 Trailing delimiter] = 2:1-2:2 + >-< +2| } else { + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Domain] = 2:2-3:1 + >------ +2| } else { +3| } + -< + +[#3 Removal] = 2:1-3:1 + >------- +2| } else { +3| } + -< + +[#3 Leading delimiter] = 2:1-2:2 + >-< +2| } else { + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/branch/branch.if.else.scope b/data/fixtures/scopes/go/branch/branch.if.else.scope new file mode 100644 index 0000000000..eb3cfcfe18 --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.if.else.scope @@ -0,0 +1,43 @@ +if true { +} else { +} +--- + +[#1 Content] = +[#1 Domain] = 0:0-1:1 + >--------- +0| if true { +1| } else { + -< + +[#1 Removal] = 0:0-1:2 + >--------- +0| if true { +1| } else { + --< + +[#1 Trailing delimiter] = 1:1-1:2 + >-< +1| } else { + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Domain] = 1:2-2:1 + >------ +1| } else { +2| } + -< + +[#2 Removal] = 1:1-2:1 + >------- +1| } else { +2| } + -< + +[#2 Leading delimiter] = 1:1-1:2 + >-< +1| } else { + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/branch/branch.if.iteration.scope b/data/fixtures/scopes/go/branch/branch.if.iteration.scope new file mode 100644 index 0000000000..701bb81573 --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.if.iteration.scope @@ -0,0 +1,14 @@ +if true { +} else if false { +} else { +} +--- + +[Content] = +[Domain] = 0:0-3:1 + >--------- +0| if true { +1| } else if false { +2| } else { +3| } + -< diff --git a/data/fixtures/scopes/go/branch/branch.if.scope b/data/fixtures/scopes/go/branch/branch.if.scope new file mode 100644 index 0000000000..48d491ae4f --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.if.scope @@ -0,0 +1,13 @@ +if true { +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-1:1 + >--------- +0| if true { +1| } + -< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/branch/branch.switchCase.iteration.scope b/data/fixtures/scopes/go/branch/branch.switchCase.iteration.scope new file mode 100644 index 0000000000..82cc8a4e12 --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.switchCase.iteration.scope @@ -0,0 +1,7 @@ +switch foo { } +--- + +[Content] = +[Domain] = 0:12-0:13 + >-< +0| switch foo { } diff --git a/data/fixtures/scopes/go/branch/branch.switchCase.iteration2.scope b/data/fixtures/scopes/go/branch/branch.switchCase.iteration2.scope new file mode 100644 index 0000000000..80f83532f7 --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.switchCase.iteration2.scope @@ -0,0 +1,7 @@ +switch v := x.(type) { } +--- + +[Content] = +[Domain] = 0:22-0:23 + >-< +0| switch v := x.(type) { } diff --git a/data/fixtures/scopes/go/branch/branch.switchCase.scope b/data/fixtures/scopes/go/branch/branch.switchCase.scope new file mode 100644 index 0000000000..2573c6a39a --- /dev/null +++ b/data/fixtures/scopes/go/branch/branch.switchCase.scope @@ -0,0 +1,44 @@ +switch (foo) { + case 0: + break + default: {} +} +--- + +[#1 Content] = +[#1 Domain] = 1:4-2:13 + >------- +1| case 0: +2| break + -------------< + +[#1 Removal] = 1:0-3:0 + >----------- +1| case 0: +2| break +3| default: {} + < + +[#1 Leading delimiter] = 1:0-1:4 + >----< +1| case 0: + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 3:4-3:15 + >-----------< +3| default: {} + +[#2 Removal] = 3:0-4:0 + >--------------- +3| default: {} +4| } + < + +[#2 Leading delimiter] = 3:0-3:4 + >----< +3| default: {} + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/class.iteration.block.scope b/data/fixtures/scopes/go/class.iteration.block.scope new file mode 100644 index 0000000000..eb1487158f --- /dev/null +++ b/data/fixtures/scopes/go/class.iteration.block.scope @@ -0,0 +1,13 @@ +func foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| func foo() { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| func foo() { } diff --git a/data/fixtures/scopes/go/class.iteration.document.scope b/data/fixtures/scopes/go/class.iteration.document.scope new file mode 100644 index 0000000000..1036138cb1 --- /dev/null +++ b/data/fixtures/scopes/go/class.iteration.document.scope @@ -0,0 +1,12 @@ + +type Foo struct {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| type Foo struct {} +2| + < diff --git a/data/fixtures/scopes/go/class.scope b/data/fixtures/scopes/go/class.scope new file mode 100644 index 0000000000..9a7bd2a866 --- /dev/null +++ b/data/fixtures/scopes/go/class.scope @@ -0,0 +1,10 @@ +type Foo struct {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| type Foo struct {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/collectionItem.unenclosed.iteration.scope b/data/fixtures/scopes/go/collectionItem.unenclosed.iteration.scope new file mode 100644 index 0000000000..dfd6e14f6c --- /dev/null +++ b/data/fixtures/scopes/go/collectionItem.unenclosed.iteration.scope @@ -0,0 +1,19 @@ +foo, bar := 1, 2 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:8 + >--------< +0| foo, bar := 1, 2 + + +[#2 Content] = +[#2 Domain] = 0:0-0:16 + >----------------< +0| foo, bar := 1, 2 + + +[#3 Content] = +[#3 Domain] = 0:12-0:16 + >----< +0| foo, bar := 1, 2 diff --git a/data/fixtures/scopes/go/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/go/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..0bb003ce00 --- /dev/null +++ b/data/fixtures/scopes/go/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,90 @@ +foo, + baz := 1, 2 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:3 + >---< +0| foo, + +[#1 Removal] = 0:0-1:4 + >---- +0| foo, +1| baz := 1, 2 + ----< + +[#1 Trailing delimiter] = 0:3-1:4 + >- +0| foo, +1| baz := 1, 2 + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:7 + >---< +1| baz := 1, 2 + +[#2 Removal] = 0:3-1:7 + >- +0| foo, +1| baz := 1, 2 + -------< + +[#2 Leading delimiter] = 0:3-1:4 + >- +0| foo, +1| baz := 1, 2 + ----< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 1:4-1:12 + >--------< +1| baz := 1, 2 + +[#3 Removal] = 1:4-1:14 + >----------< +1| baz := 1, 2 + +[#3 Trailing delimiter] = 1:12-1:14 + >--< +1| baz := 1, 2 + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 1:11-1:12 + >-< +1| baz := 1, 2 + +[#4 Removal] = 1:11-1:14 + >---< +1| baz := 1, 2 + +[#4 Trailing delimiter] = 1:12-1:14 + >--< +1| baz := 1, 2 + +[#4 Insertion delimiter] = ", " + + +[#5 Content] = +[#5 Domain] = 1:14-1:15 + >-< +1| baz := 1, 2 + +[#5 Removal] = 1:12-1:15 + >---< +1| baz := 1, 2 + +[#5 Leading delimiter] = 1:12-1:14 + >--< +1| baz := 1, 2 + +[#5 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/collectionItem.unenclosed.singleLine.scope b/data/fixtures/scopes/go/collectionItem.unenclosed.singleLine.scope new file mode 100644 index 0000000000..966939e494 --- /dev/null +++ b/data/fixtures/scopes/go/collectionItem.unenclosed.singleLine.scope @@ -0,0 +1,85 @@ +foo, bar := 1, 2 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:3 + >---< +0| foo, bar := 1, 2 + +[#1 Removal] = 0:0-0:5 + >-----< +0| foo, bar := 1, 2 + +[#1 Trailing delimiter] = 0:3-0:5 + >--< +0| foo, bar := 1, 2 + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:5-0:8 + >---< +0| foo, bar := 1, 2 + +[#2 Removal] = 0:3-0:8 + >-----< +0| foo, bar := 1, 2 + +[#2 Leading delimiter] = 0:3-0:5 + >--< +0| foo, bar := 1, 2 + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 0:5-0:13 + >--------< +0| foo, bar := 1, 2 + +[#3 Removal] = 0:5-0:15 + >----------< +0| foo, bar := 1, 2 + +[#3 Leading delimiter] = 0:3-0:5 + >--< +0| foo, bar := 1, 2 + +[#3 Trailing delimiter] = 0:13-0:15 + >--< +0| foo, bar := 1, 2 + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 0:12-0:13 + >-< +0| foo, bar := 1, 2 + +[#4 Removal] = 0:12-0:15 + >---< +0| foo, bar := 1, 2 + +[#4 Trailing delimiter] = 0:13-0:15 + >--< +0| foo, bar := 1, 2 + +[#4 Insertion delimiter] = ", " + + +[#5 Content] = +[#5 Domain] = 0:15-0:16 + >-< +0| foo, bar := 1, 2 + +[#5 Removal] = 0:13-0:16 + >---< +0| foo, bar := 1, 2 + +[#5 Leading delimiter] = 0:13-0:15 + >--< +0| foo, bar := 1, 2 + +[#5 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/go/comment.block.scope b/data/fixtures/scopes/go/comment.block.scope new file mode 100644 index 0000000000..5e8b51111c --- /dev/null +++ b/data/fixtures/scopes/go/comment.block.scope @@ -0,0 +1,10 @@ +/* Hello world */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| /* Hello world */ + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/condition/condition.for.scope b/data/fixtures/scopes/go/condition/condition.for.scope new file mode 100644 index 0000000000..e453771326 --- /dev/null +++ b/data/fixtures/scopes/go/condition/condition.for.scope @@ -0,0 +1,20 @@ +for i := 0; i < size; i++ {} +--- + +[Content] = 0:12-0:20 + >--------< +0| for i := 0; i < size; i++ {} + +[Removal] = 0:11-0:20 + >---------< +0| for i := 0; i < size; i++ {} + +[Leading delimiter] = 0:11-0:12 + >-< +0| for i := 0; i < size; i++ {} + +[Domain] = 0:0-0:28 + >----------------------------< +0| for i := 0; i < size; i++ {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/condition/condition.if.scope b/data/fixtures/scopes/go/condition/condition.if.scope new file mode 100644 index 0000000000..0b2a84f7bc --- /dev/null +++ b/data/fixtures/scopes/go/condition/condition.if.scope @@ -0,0 +1,57 @@ +if true { +} else if false { +} else { +} +--- + +[#1 Content] = 0:3-0:7 + >----< +0| if true { + +[#1 Removal] = 0:3-0:8 + >-----< +0| if true { + +[#1 Leading delimiter] = 0:2-0:3 + >-< +0| if true { + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| if true { + +[#1 Domain] = 0:0-3:1 + >--------- +0| if true { +1| } else if false { +2| } else { +3| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:10-1:15 + >-----< +1| } else if false { + +[#2 Removal] = 1:10-1:16 + >------< +1| } else if false { + +[#2 Leading delimiter] = 1:9-1:10 + >-< +1| } else if false { + +[#2 Trailing delimiter] = 1:15-1:16 + >-< +1| } else if false { + +[#2 Domain] = 1:7-3:1 + >---------- +1| } else if false { +2| } else { +3| } + -< + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/condition/condition.switchCase.iteration.scope b/data/fixtures/scopes/go/condition/condition.switchCase.iteration.scope new file mode 100644 index 0000000000..82cc8a4e12 --- /dev/null +++ b/data/fixtures/scopes/go/condition/condition.switchCase.iteration.scope @@ -0,0 +1,7 @@ +switch foo { } +--- + +[Content] = +[Domain] = 0:12-0:13 + >-< +0| switch foo { } diff --git a/data/fixtures/scopes/go/condition/condition.switchCase.iteration2.scope b/data/fixtures/scopes/go/condition/condition.switchCase.iteration2.scope new file mode 100644 index 0000000000..80f83532f7 --- /dev/null +++ b/data/fixtures/scopes/go/condition/condition.switchCase.iteration2.scope @@ -0,0 +1,7 @@ +switch v := x.(type) { } +--- + +[Content] = +[Domain] = 0:22-0:23 + >-< +0| switch v := x.(type) { } diff --git a/data/fixtures/scopes/go/condition/condition.switchCase.scope b/data/fixtures/scopes/go/condition/condition.switchCase.scope new file mode 100644 index 0000000000..12a5a3984c --- /dev/null +++ b/data/fixtures/scopes/go/condition/condition.switchCase.scope @@ -0,0 +1,42 @@ +switch (foo) { + case 0: break + case 1, 2: break +} +--- + +[#1 Content] = 1:9-1:10 + >-< +1| case 0: break + +[#1 Removal] = 1:8-1:10 + >--< +1| case 0: break + +[#1 Leading delimiter] = 1:8-1:9 + >-< +1| case 0: break + +[#1 Domain] = 1:4-1:17 + >-------------< +1| case 0: break + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:9-2:13 + >----< +2| case 1, 2: break + +[#2 Removal] = 2:8-2:13 + >-----< +2| case 1, 2: break + +[#2 Leading delimiter] = 2:8-2:9 + >-< +2| case 1, 2: break + +[#2 Domain] = 2:4-2:20 + >----------------< +2| case 1, 2: break + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCall.chain.scope b/data/fixtures/scopes/go/functionCall.chain.scope new file mode 100644 index 0000000000..c73434c70d --- /dev/null +++ b/data/fixtures/scopes/go/functionCall.chain.scope @@ -0,0 +1,19 @@ +foo().bar() +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-0:5 + >-----< +0| foo().bar() + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:0-0:11 + >-----------< +0| foo().bar() + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCall.method.scope b/data/fixtures/scopes/go/functionCall.method.scope new file mode 100644 index 0000000000..6ab0ba4c3a --- /dev/null +++ b/data/fixtures/scopes/go/functionCall.method.scope @@ -0,0 +1,10 @@ +foo.bar() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCall.scope b/data/fixtures/scopes/go/functionCall.scope new file mode 100644 index 0000000000..00162e317c --- /dev/null +++ b/data/fixtures/scopes/go/functionCall.scope @@ -0,0 +1,10 @@ +foo() +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| foo() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCallee.chain.scope b/data/fixtures/scopes/go/functionCallee.chain.scope new file mode 100644 index 0000000000..b0b9872650 --- /dev/null +++ b/data/fixtures/scopes/go/functionCallee.chain.scope @@ -0,0 +1,25 @@ +foo().bar() +--- + +[#1 Content] = +[#1 Removal] = 0:0-0:3 + >---< +0| foo().bar() + +[#1 Domain] = 0:0-0:5 + >-----< +0| foo().bar() + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 0:0-0:9 + >---------< +0| foo().bar() + +[#2 Domain] = 0:0-0:11 + >-----------< +0| foo().bar() + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCallee.method.scope b/data/fixtures/scopes/go/functionCallee.method.scope new file mode 100644 index 0000000000..e77bc361ec --- /dev/null +++ b/data/fixtures/scopes/go/functionCallee.method.scope @@ -0,0 +1,13 @@ +foo.bar() +--- + +[Content] = +[Removal] = 0:0-0:7 + >-------< +0| foo.bar() + +[Domain] = 0:0-0:9 + >---------< +0| foo.bar() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/functionCallee.scope b/data/fixtures/scopes/go/functionCallee.scope new file mode 100644 index 0000000000..2b075b5c33 --- /dev/null +++ b/data/fixtures/scopes/go/functionCallee.scope @@ -0,0 +1,13 @@ +foo() +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo() + +[Domain] = 0:0-0:5 + >-----< +0| foo() + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/ifStatement.scope b/data/fixtures/scopes/go/ifStatement.scope new file mode 100644 index 0000000000..8f864e71e7 --- /dev/null +++ b/data/fixtures/scopes/go/ifStatement.scope @@ -0,0 +1,17 @@ +if true { +} else if false { +} else { +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:1 + >--------- +0| if true { +1| } else if false { +2| } else { +3| } + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/interior/interior.class.scope b/data/fixtures/scopes/go/interior/interior.class.scope new file mode 100644 index 0000000000..41759cfbc9 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.class.scope @@ -0,0 +1,10 @@ +type Foo struct { } +--- + +[Content] = +[Removal] = +[Domain] = 0:17-0:18 + >-< +0| type Foo struct { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.for.scope b/data/fixtures/scopes/go/interior/interior.for.scope new file mode 100644 index 0000000000..0532404a58 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.for.scope @@ -0,0 +1,10 @@ +for i := 0; i < size; i++ { } +--- + +[Content] = +[Removal] = +[Domain] = 0:27-0:28 + >-< +0| for i := 0; i < size; i++ { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.foreach.scope b/data/fixtures/scopes/go/interior/interior.foreach.scope new file mode 100644 index 0000000000..9e3ecabac0 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.foreach.scope @@ -0,0 +1,10 @@ +for _, v := range values { } +--- + +[Content] = +[Removal] = +[Domain] = 0:26-0:27 + >-< +0| for _, v := range values { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.function.scope b/data/fixtures/scopes/go/interior/interior.function.scope new file mode 100644 index 0000000000..7c395916ef --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.function.scope @@ -0,0 +1,10 @@ +func foo() { } +--- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| func foo() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.if.scope b/data/fixtures/scopes/go/interior/interior.if.scope new file mode 100644 index 0000000000..97a15114cc --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.if.scope @@ -0,0 +1,37 @@ +if true { +} else if false { +} else { +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:9-1:0 + > +0| if true { +1| } else if false { + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 1:17-2:0 + > +1| } else if false { +2| } else { + < + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Removal] = +[#3 Domain] = 2:8-3:0 + > +2| } else { +3| } + < + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.interface.scope b/data/fixtures/scopes/go/interior/interior.interface.scope new file mode 100644 index 0000000000..2520c3d660 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.interface.scope @@ -0,0 +1,10 @@ +type Foo interface { } +--- + +[Content] = +[Removal] = +[Domain] = 0:20-0:21 + >-< +0| type Foo interface { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.lambda.scope b/data/fixtures/scopes/go/interior/interior.lambda.scope new file mode 100644 index 0000000000..f5bdd78a11 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.lambda.scope @@ -0,0 +1,10 @@ +foo := func() { } +--- + +[Content] = +[Removal] = +[Domain] = 0:15-0:16 + >-< +0| foo := func() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.method.scope b/data/fixtures/scopes/go/interior/interior.method.scope new file mode 100644 index 0000000000..08626611e1 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.method.scope @@ -0,0 +1,10 @@ +func (f Foo) bar() { } +--- + +[Content] = +[Removal] = +[Domain] = 0:20-0:21 + >-< +0| func (f Foo) bar() { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.switch.scope b/data/fixtures/scopes/go/interior/interior.switch.scope new file mode 100644 index 0000000000..5e37bb02c8 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.switch.scope @@ -0,0 +1,10 @@ +switch foo { } +--- + +[Content] = +[Removal] = +[Domain] = 0:12-0:13 + >-< +0| switch foo { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.switch2.scope b/data/fixtures/scopes/go/interior/interior.switch2.scope new file mode 100644 index 0000000000..02f00f2b00 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.switch2.scope @@ -0,0 +1,10 @@ +switch v := x.(type) { } +--- + +[Content] = +[Removal] = +[Domain] = 0:22-0:23 + >-< +0| switch v := x.(type) { } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/interior/interior.switchCase.scope b/data/fixtures/scopes/go/interior/interior.switchCase.scope new file mode 100644 index 0000000000..52039fb2b3 --- /dev/null +++ b/data/fixtures/scopes/go/interior/interior.switchCase.scope @@ -0,0 +1,100 @@ +switch foo { + case 0: + bar + break + case 1: { + break + } + default: + break +} +--- + +[#1 Content] = 1:4-8:13 + >------- +1| case 0: +2| bar +3| break +4| case 1: { +5| break +6| } +7| default: +8| break + -------------< + +[#1 Removal] = +[#1 Domain] = 0:12-9:0 + > +0| switch foo { +1| case 0: +2| bar +3| break +4| case 1: { +5| break +6| } +7| default: +8| break +9| } + < + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 2:8-2:11 + >---< +2| bar + +[#2 Removal] = +[#2 Domain] = 1:11-2:11 + > +1| case 0: +2| bar + -----------< + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 2:8-3:13 + >--- +2| bar +3| break + -------------< + +[#3 Removal] = +[#3 Domain] = 1:11-3:13 + > +1| case 0: +2| bar +3| break + -------------< + +[#3 Insertion delimiter] = " " + + +[#4 Content] = 5:8-5:13 + >-----< +5| break + +[#4 Removal] = +[#4 Domain] = 4:13-6:4 + > +4| case 1: { +5| break +6| } + ----< + +[#4 Insertion delimiter] = " " + + +[#5 Content] = 8:8-8:13 + >-----< +8| break + +[#5 Removal] = +[#5 Domain] = 7:12-8:13 + > +7| default: +8| break + -------------< + +[#5 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/key.mapPair.iteration.scope b/data/fixtures/scopes/go/key.mapPair.iteration.scope new file mode 100644 index 0000000000..82c069999d --- /dev/null +++ b/data/fixtures/scopes/go/key.mapPair.iteration.scope @@ -0,0 +1,7 @@ +map[string]int{"aaa": 1, "bbb": 2} +--- + +[Content] = +[Domain] = 0:15-0:33 + >------------------< +0| map[string]int{"aaa": 1, "bbb": 2} diff --git a/data/fixtures/scopes/go/key.mapPair.scope b/data/fixtures/scopes/go/key.mapPair.scope new file mode 100644 index 0000000000..c94b925827 --- /dev/null +++ b/data/fixtures/scopes/go/key.mapPair.scope @@ -0,0 +1,32 @@ +map[string]int{"aaa": 1, "bbb": 2} +--- + +[#1 Content] = +[#1 Removal] = 0:15-0:20 + >-----< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Domain] = 0:15-0:23 + >--------< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:25-0:30 + >-----< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Removal] = 0:24-0:30 + >------< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Leading delimiter] = 0:24-0:25 + >-< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Domain] = 0:25-0:33 + >--------< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/list.scope b/data/fixtures/scopes/go/list.scope new file mode 100644 index 0000000000..3e4099ae86 --- /dev/null +++ b/data/fixtures/scopes/go/list.scope @@ -0,0 +1,10 @@ +T{aaa, bbb} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:11 + >----------< +0| T{aaa, bbb} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/list2.scope b/data/fixtures/scopes/go/list2.scope new file mode 100644 index 0000000000..47d341f6d1 --- /dev/null +++ b/data/fixtures/scopes/go/list2.scope @@ -0,0 +1,10 @@ +T{aaa, bbb: 0} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:14 + >-------------< +0| T{aaa, bbb: 0} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/list3.scope b/data/fixtures/scopes/go/list3.scope new file mode 100644 index 0000000000..c5ddfe935b --- /dev/null +++ b/data/fixtures/scopes/go/list3.scope @@ -0,0 +1,10 @@ +T{} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:3 + >--< +0| T{} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/map.scope b/data/fixtures/scopes/go/map.scope new file mode 100644 index 0000000000..55932a0b71 --- /dev/null +++ b/data/fixtures/scopes/go/map.scope @@ -0,0 +1,10 @@ +T{"aaa": 0, "bbb": 1} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:21 + >--------------------< +0| T{"aaa": 0, "bbb": 1} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/map2.scope b/data/fixtures/scopes/go/map2.scope new file mode 100644 index 0000000000..47d341f6d1 --- /dev/null +++ b/data/fixtures/scopes/go/map2.scope @@ -0,0 +1,10 @@ +T{aaa, bbb: 0} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:14 + >-------------< +0| T{aaa, bbb: 0} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/map3.scope b/data/fixtures/scopes/go/map3.scope new file mode 100644 index 0000000000..c5ddfe935b --- /dev/null +++ b/data/fixtures/scopes/go/map3.scope @@ -0,0 +1,10 @@ +T{} +--- + +[Content] = +[Removal] = +[Domain] = 0:1-0:3 + >--< +0| T{} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/go/name/name.argument.formal.iteration.scope new file mode 100644 index 0000000000..da67ab7983 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.argument.formal.iteration.scope @@ -0,0 +1,13 @@ +func foo(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| func foo(aaa int, bbb string) {} + + +[#2 Content] = +[#2 Domain] = 0:9-0:28 + >-------------------< +0| func foo(aaa int, bbb string) {} diff --git a/data/fixtures/scopes/go/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/go/name/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..a86e6ecf9b --- /dev/null +++ b/data/fixtures/scopes/go/name/name.argument.formal.method.iteration.scope @@ -0,0 +1,13 @@ +func (f Foo) bar(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:40 + >----------------------------------------< +0| func (f Foo) bar(aaa int, bbb string) {} + + +[#2 Content] = +[#2 Domain] = 0:17-0:36 + >-------------------< +0| func (f Foo) bar(aaa int, bbb string) {} diff --git a/data/fixtures/scopes/go/name/name.argument.formal.method.scope b/data/fixtures/scopes/go/name/name.argument.formal.method.scope new file mode 100644 index 0000000000..a9d14ea6ac --- /dev/null +++ b/data/fixtures/scopes/go/name/name.argument.formal.method.scope @@ -0,0 +1,55 @@ +func (f Foo) bar(aaa int) {} +--- + +[#1 Content] = +[#1 Removal] = 0:13-0:16 + >---< +0| func (f Foo) bar(aaa int) {} + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| func (f Foo) bar(aaa int) {} + +[#1 Domain] = 0:0-0:28 + >----------------------------< +0| func (f Foo) bar(aaa int) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:6-0:7 + >-< +0| func (f Foo) bar(aaa int) {} + +[#2 Removal] = 0:6-0:8 + >--< +0| func (f Foo) bar(aaa int) {} + +[#2 Trailing delimiter] = 0:7-0:8 + >-< +0| func (f Foo) bar(aaa int) {} + +[#2 Domain] = 0:6-0:11 + >-----< +0| func (f Foo) bar(aaa int) {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:17-0:20 + >---< +0| func (f Foo) bar(aaa int) {} + +[#3 Removal] = 0:17-0:21 + >----< +0| func (f Foo) bar(aaa int) {} + +[#3 Trailing delimiter] = 0:20-0:21 + >-< +0| func (f Foo) bar(aaa int) {} + +[#3 Domain] = 0:17-0:24 + >-------< +0| func (f Foo) bar(aaa int) {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.argument.formal.scope b/data/fixtures/scopes/go/name/name.argument.formal.scope new file mode 100644 index 0000000000..47ba9e689d --- /dev/null +++ b/data/fixtures/scopes/go/name/name.argument.formal.scope @@ -0,0 +1,36 @@ +func foo(aaa int) {} +--- + +[#1 Content] = +[#1 Removal] = 0:5-0:8 + >---< +0| func foo(aaa int) {} + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| func foo(aaa int) {} + +[#1 Domain] = 0:0-0:20 + >--------------------< +0| func foo(aaa int) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:9-0:12 + >---< +0| func foo(aaa int) {} + +[#2 Removal] = 0:9-0:13 + >----< +0| func foo(aaa int) {} + +[#2 Trailing delimiter] = 0:12-0:13 + >-< +0| func foo(aaa int) {} + +[#2 Domain] = 0:9-0:16 + >-------< +0| func foo(aaa int) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.assignment.scope b/data/fixtures/scopes/go/name/name.assignment.scope new file mode 100644 index 0000000000..829dd52b1c --- /dev/null +++ b/data/fixtures/scopes/go/name/name.assignment.scope @@ -0,0 +1,20 @@ +foo = 1 +--- + +[Content] = 0:0-0:3 + >---< +0| foo = 1 + +[Removal] = 0:0-0:4 + >----< +0| foo = 1 + +[Trailing delimiter] = 0:3-0:4 + >-< +0| foo = 1 + +[Domain] = 0:0-0:7 + >-------< +0| foo = 1 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.class.scope b/data/fixtures/scopes/go/name/name.class.scope new file mode 100644 index 0000000000..1e7219ffe4 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.class.scope @@ -0,0 +1,24 @@ +type Foo struct {} +--- + +[Content] = 0:5-0:8 + >---< +0| type Foo struct {} + +[Removal] = 0:5-0:9 + >----< +0| type Foo struct {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| type Foo struct {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| type Foo struct {} + +[Domain] = 0:0-0:18 + >------------------< +0| type Foo struct {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.field.class.scope b/data/fixtures/scopes/go/name/name.field.class.scope new file mode 100644 index 0000000000..64ad3cdcd6 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.field.class.scope @@ -0,0 +1,52 @@ +type Foo struct { + bar int +} +--- + +[#1 Content] = 0:5-0:8 + >---< +0| type Foo struct { + +[#1 Removal] = 0:5-0:9 + >----< +0| type Foo struct { + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| type Foo struct { + +[#1 Trailing delimiter] = 0:8-0:9 + >-< +0| type Foo struct { + +[#1 Domain] = 0:0-2:1 + >----------------- +0| type Foo struct { +1| bar int +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:4-1:7 + >---< +1| bar int + +[#2 Removal] = 1:4-1:8 + >----< +1| bar int + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar int + +[#2 Trailing delimiter] = 1:7-1:8 + >-< +1| bar int + +[#2 Domain] = 1:4-1:11 + >-------< +1| bar int + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.field.interface.scope b/data/fixtures/scopes/go/name/name.field.interface.scope new file mode 100644 index 0000000000..9b88b65615 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.field.interface.scope @@ -0,0 +1,45 @@ +type Foo interface { + bar() +} +--- + +[#1 Content] = 0:5-0:8 + >---< +0| type Foo interface { + +[#1 Removal] = 0:5-0:9 + >----< +0| type Foo interface { + +[#1 Leading delimiter] = 0:4-0:5 + >-< +0| type Foo interface { + +[#1 Trailing delimiter] = 0:8-0:9 + >-< +0| type Foo interface { + +[#1 Domain] = 0:0-2:1 + >-------------------- +0| type Foo interface { +1| bar() +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = 1:4-1:7 + >---< +1| bar() + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() + +[#2 Domain] = 1:4-1:9 + >-----< +1| bar() + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.foreach.scope b/data/fixtures/scopes/go/name/name.foreach.scope new file mode 100644 index 0000000000..9fa9ed0460 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.foreach.scope @@ -0,0 +1,24 @@ +for i, v := range values {} +--- + +[Content] = 0:4-0:8 + >----< +0| for i, v := range values {} + +[Removal] = 0:4-0:9 + >-----< +0| for i, v := range values {} + +[Leading delimiter] = 0:3-0:4 + >-< +0| for i, v := range values {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| for i, v := range values {} + +[Domain] = 0:0-0:27 + >---------------------------< +0| for i, v := range values {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.function.scope b/data/fixtures/scopes/go/name/name.function.scope new file mode 100644 index 0000000000..d9a1dd759b --- /dev/null +++ b/data/fixtures/scopes/go/name/name.function.scope @@ -0,0 +1,17 @@ +func foo() {} +--- + +[Content] = +[Removal] = 0:5-0:8 + >---< +0| func foo() {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| func foo() {} + +[Domain] = 0:0-0:13 + >-------------< +0| func foo() {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.interface.scope b/data/fixtures/scopes/go/name/name.interface.scope new file mode 100644 index 0000000000..68a624009b --- /dev/null +++ b/data/fixtures/scopes/go/name/name.interface.scope @@ -0,0 +1,24 @@ +type Foo interface {} +--- + +[Content] = 0:5-0:8 + >---< +0| type Foo interface {} + +[Removal] = 0:5-0:9 + >----< +0| type Foo interface {} + +[Leading delimiter] = 0:4-0:5 + >-< +0| type Foo interface {} + +[Trailing delimiter] = 0:8-0:9 + >-< +0| type Foo interface {} + +[Domain] = 0:0-0:21 + >---------------------< +0| type Foo interface {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.iteration.block.scope b/data/fixtures/scopes/go/name/name.iteration.block.scope new file mode 100644 index 0000000000..eb1487158f --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.block.scope @@ -0,0 +1,13 @@ +func foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| func foo() { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| func foo() { } diff --git a/data/fixtures/scopes/go/name/name.iteration.block2.scope b/data/fixtures/scopes/go/name/name.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/go/name/name.iteration.block3.scope b/data/fixtures/scopes/go/name/name.iteration.block3.scope new file mode 100644 index 0000000000..ff81219a4b --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.block3.scope @@ -0,0 +1,13 @@ +for { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| for { } + + +[#2 Content] = +[#2 Domain] = 0:5-0:6 + >-< +0| for { } diff --git a/data/fixtures/scopes/go/name/name.iteration.class.scope b/data/fixtures/scopes/go/name/name.iteration.class.scope new file mode 100644 index 0000000000..90d5342216 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.class.scope @@ -0,0 +1,13 @@ +type Foo struct { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:19 + >-------------------< +0| type Foo struct { } + + +[#2 Content] = +[#2 Domain] = 0:17-0:18 + >-< +0| type Foo struct { } diff --git a/data/fixtures/scopes/go/name/name.iteration.document.scope b/data/fixtures/scopes/go/name/name.iteration.document.scope new file mode 100644 index 0000000000..f70d9ac2c1 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.document.scope @@ -0,0 +1,12 @@ + +var foo int + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| var foo int +2| + < diff --git a/data/fixtures/scopes/go/name/name.iteration.interface.scope b/data/fixtures/scopes/go/name/name.iteration.interface.scope new file mode 100644 index 0000000000..6e6f9959f7 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.iteration.interface.scope @@ -0,0 +1,13 @@ +type Foo interface { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| type Foo interface { } + + +[#2 Content] = +[#2 Domain] = 0:20-0:21 + >-< +0| type Foo interface { } diff --git a/data/fixtures/scopes/go/name/name.method.scope b/data/fixtures/scopes/go/name/name.method.scope new file mode 100644 index 0000000000..4359f05fa9 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.method.scope @@ -0,0 +1,36 @@ +func (f Foo) bar() {} +--- + +[#1 Content] = +[#1 Removal] = 0:13-0:16 + >---< +0| func (f Foo) bar() {} + +[#1 Leading delimiter] = 0:12-0:13 + >-< +0| func (f Foo) bar() {} + +[#1 Domain] = 0:0-0:21 + >---------------------< +0| func (f Foo) bar() {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:6-0:7 + >-< +0| func (f Foo) bar() {} + +[#2 Removal] = 0:6-0:8 + >--< +0| func (f Foo) bar() {} + +[#2 Trailing delimiter] = 0:7-0:8 + >-< +0| func (f Foo) bar() {} + +[#2 Domain] = 0:6-0:11 + >-----< +0| func (f Foo) bar() {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable.scope b/data/fixtures/scopes/go/name/name.variable.scope new file mode 100644 index 0000000000..78abad522f --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable.scope @@ -0,0 +1,24 @@ +var foo int +--- + +[Content] = 0:4-0:7 + >---< +0| var foo int + +[Removal] = 0:4-0:8 + >----< +0| var foo int + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo int + +[Trailing delimiter] = 0:7-0:8 + >-< +0| var foo int + +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable2.scope b/data/fixtures/scopes/go/name/name.variable2.scope new file mode 100644 index 0000000000..11adc00523 --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable2.scope @@ -0,0 +1,24 @@ +var foo int = 0 +--- + +[Content] = 0:4-0:7 + >---< +0| var foo int = 0 + +[Removal] = 0:4-0:8 + >----< +0| var foo int = 0 + +[Leading delimiter] = 0:3-0:4 + >-< +0| var foo int = 0 + +[Trailing delimiter] = 0:7-0:8 + >-< +0| var foo int = 0 + +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/name/name.variable3.scope b/data/fixtures/scopes/go/name/name.variable3.scope new file mode 100644 index 0000000000..cda5dd235d --- /dev/null +++ b/data/fixtures/scopes/go/name/name.variable3.scope @@ -0,0 +1,20 @@ +foo := 0 +--- + +[Content] = 0:0-0:3 + >---< +0| foo := 0 + +[Removal] = 0:0-0:4 + >----< +0| foo := 0 + +[Trailing delimiter] = 0:3-0:4 + >-< +0| foo := 0 + +[Domain] = 0:0-0:8 + >--------< +0| foo := 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/namedFunction.iteration.class.scope b/data/fixtures/scopes/go/namedFunction.iteration.class.scope new file mode 100644 index 0000000000..90d5342216 --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction.iteration.class.scope @@ -0,0 +1,13 @@ +type Foo struct { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:19 + >-------------------< +0| type Foo struct { } + + +[#2 Content] = +[#2 Domain] = 0:17-0:18 + >-< +0| type Foo struct { } diff --git a/data/fixtures/scopes/go/namedFunction.iteration.document.scope b/data/fixtures/scopes/go/namedFunction.iteration.document.scope new file mode 100644 index 0000000000..46eb837954 --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction.iteration.document.scope @@ -0,0 +1,12 @@ + +func foo() {} + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| func foo() {} +2| + < diff --git a/data/fixtures/scopes/go/namedFunction.method.scope b/data/fixtures/scopes/go/namedFunction.method.scope new file mode 100644 index 0000000000..73fd0487bb --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction.method.scope @@ -0,0 +1,10 @@ +func (f Foo) bar() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| func (f Foo) bar() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/namedFunction.scope b/data/fixtures/scopes/go/namedFunction.scope new file mode 100644 index 0000000000..73d215f7eb --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction.scope @@ -0,0 +1,10 @@ +func foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| func foo() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/namedFunction2.scope b/data/fixtures/scopes/go/namedFunction2.scope new file mode 100644 index 0000000000..44b4235299 --- /dev/null +++ b/data/fixtures/scopes/go/namedFunction2.scope @@ -0,0 +1,10 @@ +foo = func() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| foo = func() {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/go/statement/statement.assignment.scope b/data/fixtures/scopes/go/statement/statement.assignment.scope new file mode 100644 index 0000000000..acdb2b1498 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.assignment.scope @@ -0,0 +1,10 @@ +foo = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.break.scope b/data/fixtures/scopes/go/statement/statement.break.scope new file mode 100644 index 0000000000..c21b362a89 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.break.scope @@ -0,0 +1,33 @@ +for { + break +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----- +0| for { +1| break +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| break + +[#2 Removal] = 1:0-2:0 + >--------- +1| break +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| break + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.class.scope b/data/fixtures/scopes/go/statement/statement.class.scope new file mode 100644 index 0000000000..1523b81a2d --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.class.scope @@ -0,0 +1,10 @@ +type Foo struct {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| type Foo struct {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.continue.scope b/data/fixtures/scopes/go/statement/statement.continue.scope new file mode 100644 index 0000000000..2f62d1e9b8 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.continue.scope @@ -0,0 +1,33 @@ +for { + continue +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----- +0| for { +1| continue +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| continue + +[#2 Removal] = 1:0-2:0 + >------------ +1| continue +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| continue + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.field.class.scope b/data/fixtures/scopes/go/statement/statement.field.class.scope new file mode 100644 index 0000000000..c0765a0205 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.field.class.scope @@ -0,0 +1,33 @@ +type Foo struct { + bar int +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------------- +0| type Foo struct { +1| bar int +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:11 + >-------< +1| bar int + +[#2 Removal] = 1:0-2:0 + >----------- +1| bar int +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar int + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.field.interface.scope b/data/fixtures/scopes/go/statement/statement.field.interface.scope new file mode 100644 index 0000000000..51ef08b513 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.field.interface.scope @@ -0,0 +1,33 @@ +type Foo interface { + bar() +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >-------------------- +0| type Foo interface { +1| bar() +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| bar() + +[#2 Removal] = 1:0-2:0 + >--------- +1| bar() +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| bar() + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.for.scope b/data/fixtures/scopes/go/statement/statement.for.scope new file mode 100644 index 0000000000..32136c937a --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.for.scope @@ -0,0 +1,10 @@ +for i := 0; i < size; i++ {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:28 + >----------------------------< +0| for i := 0; i < size; i++ {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.foreach.scope b/data/fixtures/scopes/go/statement/statement.foreach.scope new file mode 100644 index 0000000000..00f8d55fd2 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for _, v := range values {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:27 + >---------------------------< +0| for _, v := range values {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.function.scope b/data/fixtures/scopes/go/statement/statement.function.scope new file mode 100644 index 0000000000..118724d315 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.function.scope @@ -0,0 +1,10 @@ +func foo() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| func foo() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.if.scope b/data/fixtures/scopes/go/statement/statement.if.scope new file mode 100644 index 0000000000..8f864e71e7 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.if.scope @@ -0,0 +1,17 @@ +if true { +} else if false { +} else { +} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-3:1 + >--------- +0| if true { +1| } else if false { +2| } else { +3| } + -< + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.interface.scope b/data/fixtures/scopes/go/statement/statement.interface.scope new file mode 100644 index 0000000000..0f4fc4f519 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.interface.scope @@ -0,0 +1,10 @@ +type Foo interface {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| type Foo interface {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.iteration.block.scope b/data/fixtures/scopes/go/statement/statement.iteration.block.scope new file mode 100644 index 0000000000..eb1487158f --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.block.scope @@ -0,0 +1,13 @@ +func foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| func foo() { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| func foo() { } diff --git a/data/fixtures/scopes/go/statement/statement.iteration.block2.scope b/data/fixtures/scopes/go/statement/statement.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/go/statement/statement.iteration.block3.scope b/data/fixtures/scopes/go/statement/statement.iteration.block3.scope new file mode 100644 index 0000000000..ff81219a4b --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.block3.scope @@ -0,0 +1,13 @@ +for { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| for { } + + +[#2 Content] = +[#2 Domain] = 0:5-0:6 + >-< +0| for { } diff --git a/data/fixtures/scopes/go/statement/statement.iteration.class.scope b/data/fixtures/scopes/go/statement/statement.iteration.class.scope new file mode 100644 index 0000000000..90d5342216 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.class.scope @@ -0,0 +1,13 @@ +type Foo struct { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:19 + >-------------------< +0| type Foo struct { } + + +[#2 Content] = +[#2 Domain] = 0:17-0:18 + >-< +0| type Foo struct { } diff --git a/data/fixtures/scopes/go/statement/statement.iteration.document.scope b/data/fixtures/scopes/go/statement/statement.iteration.document.scope new file mode 100644 index 0000000000..f70d9ac2c1 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.document.scope @@ -0,0 +1,12 @@ + +var foo int + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| var foo int +2| + < diff --git a/data/fixtures/scopes/go/statement/statement.iteration.interface.scope b/data/fixtures/scopes/go/statement/statement.iteration.interface.scope new file mode 100644 index 0000000000..6e6f9959f7 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.iteration.interface.scope @@ -0,0 +1,13 @@ +type Foo interface { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:22 + >----------------------< +0| type Foo interface { } + + +[#2 Content] = +[#2 Domain] = 0:20-0:21 + >-< +0| type Foo interface { } diff --git a/data/fixtures/scopes/go/statement/statement.method.scope b/data/fixtures/scopes/go/statement/statement.method.scope new file mode 100644 index 0000000000..535aba2bc3 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.method.scope @@ -0,0 +1,10 @@ +func (f Foo) bar() {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| func (f Foo) bar() {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.return.scope b/data/fixtures/scopes/go/statement/statement.return.scope new file mode 100644 index 0000000000..3129c896a0 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.return.scope @@ -0,0 +1,33 @@ +func foo() int { + return 0 +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >---------------- +0| func foo() int { +1| return 0 +2| } + -< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:4-1:12 + >--------< +1| return 0 + +[#2 Removal] = 1:0-2:0 + >------------ +1| return 0 +2| } + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.switch.scope b/data/fixtures/scopes/go/statement/statement.switch.scope new file mode 100644 index 0000000000..6a32cbcf3f --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.switch.scope @@ -0,0 +1,10 @@ +switch foo {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| switch foo {} + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.variable.scope b/data/fixtures/scopes/go/statement/statement.variable.scope new file mode 100644 index 0000000000..d557d3cb76 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.variable.scope @@ -0,0 +1,10 @@ +var foo int +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.variable2.scope b/data/fixtures/scopes/go/statement/statement.variable2.scope new file mode 100644 index 0000000000..1bf83fb616 --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.variable2.scope @@ -0,0 +1,10 @@ +var foo int = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/statement/statement.variable3.scope b/data/fixtures/scopes/go/statement/statement.variable3.scope new file mode 100644 index 0000000000..b3f49c96dd --- /dev/null +++ b/data/fixtures/scopes/go/statement/statement.variable3.scope @@ -0,0 +1,10 @@ +foo := 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:8 + >--------< +0| foo := 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/go/textFragment.comment.block.scope b/data/fixtures/scopes/go/textFragment.comment.block.scope new file mode 100644 index 0000000000..af33f95d00 --- /dev/null +++ b/data/fixtures/scopes/go/textFragment.comment.block.scope @@ -0,0 +1,10 @@ +/* Hello world */ +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| /* Hello world */ + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.alias.scope b/data/fixtures/scopes/go/type/type.alias.scope new file mode 100644 index 0000000000..708ceef5d0 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.alias.scope @@ -0,0 +1,10 @@ +type Foo = Bar +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:14 + >--------------< +0| type Foo = Bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.argument.formal.iteration.scope b/data/fixtures/scopes/go/type/type.argument.formal.iteration.scope new file mode 100644 index 0000000000..da67ab7983 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.argument.formal.iteration.scope @@ -0,0 +1,13 @@ +func foo(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| func foo(aaa int, bbb string) {} + + +[#2 Content] = +[#2 Domain] = 0:9-0:28 + >-------------------< +0| func foo(aaa int, bbb string) {} diff --git a/data/fixtures/scopes/go/type/type.argument.formal.method.iteration.scope b/data/fixtures/scopes/go/type/type.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..a86e6ecf9b --- /dev/null +++ b/data/fixtures/scopes/go/type/type.argument.formal.method.iteration.scope @@ -0,0 +1,13 @@ +func (f Foo) bar(aaa int, bbb string) {} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:40 + >----------------------------------------< +0| func (f Foo) bar(aaa int, bbb string) {} + + +[#2 Content] = +[#2 Domain] = 0:17-0:36 + >-------------------< +0| func (f Foo) bar(aaa int, bbb string) {} diff --git a/data/fixtures/scopes/go/type/type.argument.formal.method.scope b/data/fixtures/scopes/go/type/type.argument.formal.method.scope new file mode 100644 index 0000000000..35e1edc541 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.argument.formal.method.scope @@ -0,0 +1,39 @@ +func (f Foo) bar(aaa int) {} +--- + +[#1 Content] = 0:8-0:11 + >---< +0| func (f Foo) bar(aaa int) {} + +[#1 Removal] = 0:7-0:11 + >----< +0| func (f Foo) bar(aaa int) {} + +[#1 Leading delimiter] = 0:7-0:8 + >-< +0| func (f Foo) bar(aaa int) {} + +[#1 Domain] = 0:6-0:11 + >-----< +0| func (f Foo) bar(aaa int) {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:21-0:24 + >---< +0| func (f Foo) bar(aaa int) {} + +[#2 Removal] = 0:20-0:24 + >----< +0| func (f Foo) bar(aaa int) {} + +[#2 Leading delimiter] = 0:20-0:21 + >-< +0| func (f Foo) bar(aaa int) {} + +[#2 Domain] = 0:17-0:24 + >-------< +0| func (f Foo) bar(aaa int) {} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.argument.formal.scope b/data/fixtures/scopes/go/type/type.argument.formal.scope new file mode 100644 index 0000000000..b9950be308 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.argument.formal.scope @@ -0,0 +1,20 @@ +func foo(aaa int) {} +--- + +[Content] = 0:13-0:16 + >---< +0| func foo(aaa int) {} + +[Removal] = 0:12-0:16 + >----< +0| func foo(aaa int) {} + +[Leading delimiter] = 0:12-0:13 + >-< +0| func foo(aaa int) {} + +[Domain] = 0:9-0:16 + >-------< +0| func foo(aaa int) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.class.scope b/data/fixtures/scopes/go/type/type.class.scope new file mode 100644 index 0000000000..9b7da6b68b --- /dev/null +++ b/data/fixtures/scopes/go/type/type.class.scope @@ -0,0 +1,10 @@ +type Foo struct {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| type Foo struct {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.field.class.scope b/data/fixtures/scopes/go/type/type.field.class.scope new file mode 100644 index 0000000000..9b82fdda48 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.field.class.scope @@ -0,0 +1,34 @@ +type Foo struct { + bar int +} +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:1 + >----------------- +0| type Foo struct { +1| bar int +2| } + -< + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 1:8-1:11 + >---< +1| bar int + +[#2 Removal] = 1:7-1:11 + >----< +1| bar int + +[#2 Leading delimiter] = 1:7-1:8 + >-< +1| bar int + +[#2 Domain] = 1:4-1:11 + >-------< +1| bar int + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.interface.scope b/data/fixtures/scopes/go/type/type.interface.scope new file mode 100644 index 0000000000..095a526dd9 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.interface.scope @@ -0,0 +1,10 @@ +type Foo interface {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| type Foo interface {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.iteration.block.scope b/data/fixtures/scopes/go/type/type.iteration.block.scope new file mode 100644 index 0000000000..eb1487158f --- /dev/null +++ b/data/fixtures/scopes/go/type/type.iteration.block.scope @@ -0,0 +1,13 @@ +func foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| func foo() { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| func foo() { } diff --git a/data/fixtures/scopes/go/type/type.iteration.block2.scope b/data/fixtures/scopes/go/type/type.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/go/type/type.iteration.block3.scope b/data/fixtures/scopes/go/type/type.iteration.block3.scope new file mode 100644 index 0000000000..ff81219a4b --- /dev/null +++ b/data/fixtures/scopes/go/type/type.iteration.block3.scope @@ -0,0 +1,13 @@ +for { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| for { } + + +[#2 Content] = +[#2 Domain] = 0:5-0:6 + >-< +0| for { } diff --git a/data/fixtures/scopes/go/type/type.iteration.class.scope b/data/fixtures/scopes/go/type/type.iteration.class.scope new file mode 100644 index 0000000000..90d5342216 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.iteration.class.scope @@ -0,0 +1,13 @@ +type Foo struct { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:19 + >-------------------< +0| type Foo struct { } + + +[#2 Content] = +[#2 Domain] = 0:17-0:18 + >-< +0| type Foo struct { } diff --git a/data/fixtures/scopes/go/type/type.iteration.document.scope b/data/fixtures/scopes/go/type/type.iteration.document.scope new file mode 100644 index 0000000000..f70d9ac2c1 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.iteration.document.scope @@ -0,0 +1,12 @@ + +var foo int + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| var foo int +2| + < diff --git a/data/fixtures/scopes/go/type/type.return.scope b/data/fixtures/scopes/go/type/type.return.scope new file mode 100644 index 0000000000..beacc79b8d --- /dev/null +++ b/data/fixtures/scopes/go/type/type.return.scope @@ -0,0 +1,24 @@ +func foo() int {} +--- + +[Content] = 0:11-0:14 + >---< +0| func foo() int {} + +[Removal] = 0:11-0:15 + >----< +0| func foo() int {} + +[Leading delimiter] = 0:10-0:11 + >-< +0| func foo() int {} + +[Trailing delimiter] = 0:14-0:15 + >-< +0| func foo() int {} + +[Domain] = 0:0-0:17 + >-----------------< +0| func foo() int {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.typeArgument.iteration.scope b/data/fixtures/scopes/go/type/type.typeArgument.iteration.scope new file mode 100644 index 0000000000..821fe1b1b4 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.typeArgument.iteration.scope @@ -0,0 +1,13 @@ +var foo Bar[int, string] +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:24 + >------------------------< +0| var foo Bar[int, string] + + +[#2 Content] = +[#2 Domain] = 0:12-0:23 + >-----------< +0| var foo Bar[int, string] diff --git a/data/fixtures/scopes/go/type/type.typeArgument.scope b/data/fixtures/scopes/go/type/type.typeArgument.scope new file mode 100644 index 0000000000..d16d866169 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.typeArgument.scope @@ -0,0 +1,45 @@ +var foo Bar[int, string] +--- + +[#1 Content] = 0:8-0:24 + >----------------< +0| var foo Bar[int, string] + +[#1 Removal] = 0:7-0:24 + >-----------------< +0| var foo Bar[int, string] + +[#1 Leading delimiter] = 0:7-0:8 + >-< +0| var foo Bar[int, string] + +[#1 Domain] = 0:0-0:24 + >------------------------< +0| var foo Bar[int, string] + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:12-0:15 + >---< +0| var foo Bar[int, string] + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Domain] = 0:17-0:23 + >------< +0| var foo Bar[int, string] + +[#3 Removal] = 0:16-0:23 + >-------< +0| var foo Bar[int, string] + +[#3 Leading delimiter] = 0:16-0:17 + >-< +0| var foo Bar[int, string] + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.variable.scope b/data/fixtures/scopes/go/type/type.variable.scope new file mode 100644 index 0000000000..44a666889c --- /dev/null +++ b/data/fixtures/scopes/go/type/type.variable.scope @@ -0,0 +1,20 @@ +var foo int +--- + +[Content] = 0:8-0:11 + >---< +0| var foo int + +[Removal] = 0:7-0:11 + >----< +0| var foo int + +[Leading delimiter] = 0:7-0:8 + >-< +0| var foo int + +[Domain] = 0:0-0:11 + >-----------< +0| var foo int + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/type/type.variable2.scope b/data/fixtures/scopes/go/type/type.variable2.scope new file mode 100644 index 0000000000..7913b77ea5 --- /dev/null +++ b/data/fixtures/scopes/go/type/type.variable2.scope @@ -0,0 +1,24 @@ +var foo int = 0 +--- + +[Content] = 0:8-0:11 + >---< +0| var foo int = 0 + +[Removal] = 0:8-0:12 + >----< +0| var foo int = 0 + +[Leading delimiter] = 0:7-0:8 + >-< +0| var foo int = 0 + +[Trailing delimiter] = 0:11-0:12 + >-< +0| var foo int = 0 + +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.assignment.scope b/data/fixtures/scopes/go/value/value.assignment.scope new file mode 100644 index 0000000000..6e89de0927 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.assignment.scope @@ -0,0 +1,20 @@ +foo = 0 +--- + +[Content] = 0:6-0:7 + >-< +0| foo = 0 + +[Removal] = 0:3-0:7 + >----< +0| foo = 0 + +[Leading delimiter] = 0:3-0:6 + >---< +0| foo = 0 + +[Domain] = 0:0-0:7 + >-------< +0| foo = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.foreach.scope b/data/fixtures/scopes/go/value/value.foreach.scope new file mode 100644 index 0000000000..bba422d7d5 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.foreach.scope @@ -0,0 +1,24 @@ +for i, v := range values {} +--- + +[Content] = 0:18-0:24 + >------< +0| for i, v := range values {} + +[Removal] = 0:18-0:25 + >-------< +0| for i, v := range values {} + +[Leading delimiter] = 0:17-0:18 + >-< +0| for i, v := range values {} + +[Trailing delimiter] = 0:24-0:25 + >-< +0| for i, v := range values {} + +[Domain] = 0:0-0:27 + >---------------------------< +0| for i, v := range values {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.iteration.block.scope b/data/fixtures/scopes/go/value/value.iteration.block.scope new file mode 100644 index 0000000000..eb1487158f --- /dev/null +++ b/data/fixtures/scopes/go/value/value.iteration.block.scope @@ -0,0 +1,13 @@ +func foo() { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:14 + >--------------< +0| func foo() { } + + +[#2 Content] = +[#2 Domain] = 0:12-0:13 + >-< +0| func foo() { } diff --git a/data/fixtures/scopes/go/value/value.iteration.block2.scope b/data/fixtures/scopes/go/value/value.iteration.block2.scope new file mode 100644 index 0000000000..dfc0523a61 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.iteration.block2.scope @@ -0,0 +1,13 @@ +if true { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:11 + >-----------< +0| if true { } + + +[#2 Content] = +[#2 Domain] = 0:9-0:10 + >-< +0| if true { } diff --git a/data/fixtures/scopes/go/value/value.iteration.block3.scope b/data/fixtures/scopes/go/value/value.iteration.block3.scope new file mode 100644 index 0000000000..ff81219a4b --- /dev/null +++ b/data/fixtures/scopes/go/value/value.iteration.block3.scope @@ -0,0 +1,13 @@ +for { } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| for { } + + +[#2 Content] = +[#2 Domain] = 0:5-0:6 + >-< +0| for { } diff --git a/data/fixtures/scopes/go/value/value.iteration.document.scope b/data/fixtures/scopes/go/value/value.iteration.document.scope new file mode 100644 index 0000000000..e51a745f22 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.iteration.document.scope @@ -0,0 +1,12 @@ + +foo := 1 + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo := 1 +2| + < diff --git a/data/fixtures/scopes/go/value/value.mapPair.iteration.scope b/data/fixtures/scopes/go/value/value.mapPair.iteration.scope new file mode 100644 index 0000000000..75828c2c40 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.mapPair.iteration.scope @@ -0,0 +1,13 @@ +map[string]int{"aaa": 1, "bbb": 2} +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:34 + >----------------------------------< +0| map[string]int{"aaa": 1, "bbb": 2} + + +[#2 Content] = +[#2 Domain] = 0:15-0:33 + >------------------< +0| map[string]int{"aaa": 1, "bbb": 2} diff --git a/data/fixtures/scopes/go/value/value.mapPair.scope b/data/fixtures/scopes/go/value/value.mapPair.scope new file mode 100644 index 0000000000..70069978be --- /dev/null +++ b/data/fixtures/scopes/go/value/value.mapPair.scope @@ -0,0 +1,39 @@ +map[string]int{"aaa": 1, "bbb": 2} +--- + +[#1 Content] = 0:22-0:23 + >-< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Removal] = 0:21-0:23 + >--< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Leading delimiter] = 0:21-0:22 + >-< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Domain] = 0:15-0:23 + >--------< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:32-0:33 + >-< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Removal] = 0:31-0:33 + >--< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Leading delimiter] = 0:31-0:32 + >-< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Domain] = 0:25-0:33 + >--------< +0| map[string]int{"aaa": 1, "bbb": 2} + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.return.scope b/data/fixtures/scopes/go/value/value.return.scope new file mode 100644 index 0000000000..701e78f3df --- /dev/null +++ b/data/fixtures/scopes/go/value/value.return.scope @@ -0,0 +1,22 @@ +func foo() int { + return 0 +} +--- + +[Content] = 1:11-1:12 + >-< +1| return 0 + +[Removal] = 1:10-1:12 + >--< +1| return 0 + +[Leading delimiter] = 1:10-1:11 + >-< +1| return 0 + +[Domain] = 1:4-1:12 + >--------< +1| return 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.switch.scope b/data/fixtures/scopes/go/value/value.switch.scope new file mode 100644 index 0000000000..b27bac7781 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.switch.scope @@ -0,0 +1,24 @@ +switch foo {} +--- + +[Content] = 0:7-0:10 + >---< +0| switch foo {} + +[Removal] = 0:7-0:11 + >----< +0| switch foo {} + +[Leading delimiter] = 0:6-0:7 + >-< +0| switch foo {} + +[Trailing delimiter] = 0:10-0:11 + >-< +0| switch foo {} + +[Domain] = 0:0-0:13 + >-------------< +0| switch foo {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.switch2.scope b/data/fixtures/scopes/go/value/value.switch2.scope new file mode 100644 index 0000000000..484e73f3db --- /dev/null +++ b/data/fixtures/scopes/go/value/value.switch2.scope @@ -0,0 +1,24 @@ +switch v := x.(type) {} +--- + +[Content] = 0:7-0:20 + >-------------< +0| switch v := x.(type) {} + +[Removal] = 0:7-0:21 + >--------------< +0| switch v := x.(type) {} + +[Leading delimiter] = 0:6-0:7 + >-< +0| switch v := x.(type) {} + +[Trailing delimiter] = 0:20-0:21 + >-< +0| switch v := x.(type) {} + +[Domain] = 0:0-0:23 + >-----------------------< +0| switch v := x.(type) {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.typeAlias.scope b/data/fixtures/scopes/go/value/value.typeAlias.scope new file mode 100644 index 0000000000..a6264cfd05 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.typeAlias.scope @@ -0,0 +1,20 @@ +type Foo = Bar +--- + +[Content] = 0:11-0:14 + >---< +0| type Foo = Bar + +[Removal] = 0:8-0:14 + >------< +0| type Foo = Bar + +[Leading delimiter] = 0:8-0:11 + >---< +0| type Foo = Bar + +[Domain] = 0:0-0:14 + >--------------< +0| type Foo = Bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.variable.scope b/data/fixtures/scopes/go/value/value.variable.scope new file mode 100644 index 0000000000..fb52bff040 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.variable.scope @@ -0,0 +1,20 @@ +var foo int = 0 +--- + +[Content] = 0:14-0:15 + >-< +0| var foo int = 0 + +[Removal] = 0:11-0:15 + >----< +0| var foo int = 0 + +[Leading delimiter] = 0:11-0:14 + >---< +0| var foo int = 0 + +[Domain] = 0:0-0:15 + >---------------< +0| var foo int = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.variable2.scope b/data/fixtures/scopes/go/value/value.variable2.scope new file mode 100644 index 0000000000..06dc0be9f8 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.variable2.scope @@ -0,0 +1,20 @@ +var foo = 0 +--- + +[Content] = 0:10-0:11 + >-< +0| var foo = 0 + +[Removal] = 0:7-0:11 + >----< +0| var foo = 0 + +[Leading delimiter] = 0:7-0:10 + >---< +0| var foo = 0 + +[Domain] = 0:0-0:11 + >-----------< +0| var foo = 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/go/value/value.variable3.scope b/data/fixtures/scopes/go/value/value.variable3.scope new file mode 100644 index 0000000000..048f1900d1 --- /dev/null +++ b/data/fixtures/scopes/go/value/value.variable3.scope @@ -0,0 +1,20 @@ +foo := 0 +--- + +[Content] = 0:7-0:8 + >-< +0| foo := 0 + +[Removal] = 0:3-0:8 + >-----< +0| foo := 0 + +[Leading delimiter] = 0:3-0:7 + >----< +0| foo := 0 + +[Domain] = 0:0-0:8 + >--------< +0| foo := 0 + +[Insertion delimiter] = " " diff --git a/data/scopeSupportFacetInfos.md b/data/scopeSupportFacetInfos.md index 7418dff4b3..199fc5284b 100644 --- a/data/scopeSupportFacetInfos.md +++ b/data/scopeSupportFacetInfos.md @@ -86,7 +86,7 @@ ### class -- `class` A class in an object-oriented language +- `class` A class/struct in an object-oriented language - `class.iteration.block` Iteration scope for classes: statement blocks (body of functions/if-statements/for-loops/etc). - `class.iteration.document` Iteration scope for classes: the entire document including leading and trailing empty lines. @@ -301,13 +301,13 @@ - `statement.assignment` An assignment statement - `statement.break` A break statement -- `statement.class` A class declaration +- `statement.class` A class/struct declaration - `statement.command` A command statement, eg Talon spoken command or bash - `statement.constructor` A constructor declaration - `statement.continue` A continue statement - `statement.doWhile` A do-while loop statement - `statement.enum` An enum declaration -- `statement.field.class` A field declaration in a class +- `statement.field.class` A field declaration in a class/struct - `statement.field.interface` A field declaration in a interface - `statement.for` A for loop statement - `statement.foreach` A for-each loop statement diff --git a/packages/common/src/scopeSupportFacets/go.ts b/packages/common/src/scopeSupportFacets/go.ts index 835ea8a95e..335c004ea9 100644 --- a/packages/common/src/scopeSupportFacets/go.ts +++ b/packages/common/src/scopeSupportFacets/go.ts @@ -1,18 +1,320 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const goScopeSupport: LanguageScopeSupportFacetMap = { disqualifyDelimiter: supported, + list: supported, + map: supported, + + ifStatement: supported, + + class: supported, + "class.iteration.block": supported, + "class.iteration.document": supported, + + "statement.class": supported, + "statement.interface": supported, + "statement.field.class": supported, + "statement.field.interface": supported, + "statement.function": supported, + "statement.method": supported, + "statement.if": supported, + "statement.switch": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.break": supported, + "statement.continue": supported, + "statement.iteration.document": supported, + "statement.iteration.class": supported, + "statement.iteration.interface": supported, + "statement.iteration.block": supported, + + namedFunction: supported, + "namedFunction.method": supported, + "namedFunction.iteration.class": supported, + "namedFunction.iteration.document": supported, + anonymousFunction: supported, + + functionCall: supported, + "functionCall.method": supported, + "functionCall.chain": supported, + functionCallee: supported, + "functionCallee.method": supported, + "functionCallee.chain": supported, + + "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, + "argument.actual.iteration": supported, + "argument.actual.method.singleLine": supported, + "argument.actual.method.multiLine": supported, + "argument.actual.method.iteration": supported, + "argument.formal.singleLine": supported, + "argument.formal.multiLine": supported, + "argument.formal.iteration": supported, + "argument.formal.method.singleLine": supported, + "argument.formal.method.multiLine": supported, + "argument.formal.method.iteration": supported, + "argument.formal.lambda.singleLine": supported, + "argument.formal.lambda.multiLine": supported, + "argument.formal.lambda.iteration": supported, + + "argumentList.actual.empty": supported, + "argumentList.actual.singleLine": supported, + "argumentList.actual.multiLine": supported, + "argumentList.actual.method.empty": supported, + "argumentList.actual.method.singleLine": supported, + "argumentList.actual.method.multiLine": supported, + "argumentList.formal.empty": supported, + "argumentList.formal.singleLine": supported, + "argumentList.formal.multiLine": supported, + "argumentList.formal.lambda.empty": supported, + "argumentList.formal.lambda.singleLine": supported, + "argumentList.formal.lambda.multiLine": supported, + "argumentList.formal.method.empty": supported, + "argumentList.formal.method.singleLine": supported, + "argumentList.formal.method.multiLine": supported, + "comment.line": supported, + "comment.block": supported, "string.singleLine": supported, "string.multiLine": supported, + "textFragment.comment.line": supported, + "textFragment.comment.block": supported, "textFragment.string.singleLine": supported, "textFragment.string.multiLine": supported, - "textFragment.comment.line": supported, + + "branch.if": supported, + "branch.if.elif.else": supported, + "branch.if.else": supported, + "branch.if.iteration": supported, + "branch.switchCase": supported, + "branch.switchCase.iteration": supported, + + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, + "collectionItem.unenclosed.iteration": supported, + + "condition.if": supported, + "condition.for": supported, + "condition.switchCase": supported, + "condition.switchCase.iteration": supported, + + "name.assignment": supported, + "name.variable": supported, + "name.foreach": supported, + "name.function": supported, + "name.method": supported, + "name.class": supported, + "name.interface": supported, + "name.field.class": supported, + "name.field.interface": supported, + "name.argument.formal": supported, + "name.argument.formal.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.iteration.block": supported, + "name.iteration.class": supported, + "name.iteration.document": supported, + "name.iteration.interface": supported, + + "key.mapPair": supported, + "key.mapPair.iteration": supported, + + "value.assignment": supported, + "value.variable": supported, + "value.mapPair": supported, + "value.mapPair.iteration": supported, + "value.foreach": supported, + "value.return": supported, + "value.switch": supported, + "value.typeAlias": supported, + "value.iteration.block": supported, + "value.iteration.document": supported, + + "type.variable": supported, + "type.argument.formal": supported, + "type.argument.formal.iteration": supported, + "type.argument.formal.method": supported, + "type.argument.formal.method.iteration": supported, + "type.return": supported, + "type.class": supported, + "type.interface": supported, + "type.field.class": supported, + "type.alias": supported, + "type.typeArgument": supported, + "type.typeArgument.iteration": supported, + "type.iteration.block": supported, + "type.iteration.class": supported, + "type.iteration.document": supported, + + "interior.class": supported, + "interior.interface": supported, + "interior.function": supported, + "interior.method": supported, + "interior.lambda": supported, + "interior.if": supported, + "interior.switch": supported, + "interior.switchCase": supported, + "interior.for": supported, + "interior.foreach": supported, + + /* UNSUPPORTED */ + + fieldAccess: unsupported, + + /* NOT APPLICABLE */ + + // Element and tags + element: notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + + // Attributes + attribute: notApplicable, + "key.attribute": notApplicable, + "value.attribute": notApplicable, + + // Section + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + + // Command + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + + // Class field values + "value.field.class": notApplicable, + "value.iteration.class": notApplicable, + + // Enum + "statement.enum": notApplicable, + "name.enum": notApplicable, + "name.field.enum": notApplicable, + "name.iteration.enum": notApplicable, + "type.enum": notApplicable, + "interior.enum": notApplicable, + "value.field.enum": notApplicable, + "value.iteration.enum": notApplicable, + + // Constructors + "statement.constructor": notApplicable, + "namedFunction.constructor": notApplicable, + "argument.actual.constructor.singleLine": notApplicable, + "argument.actual.constructor.multiLine": notApplicable, + "argument.actual.constructor.iteration": notApplicable, + "argument.formal.constructor.singleLine": notApplicable, + "argument.formal.constructor.multiLine": notApplicable, + "argument.formal.constructor.iteration": notApplicable, + "argumentList.actual.constructor.empty": notApplicable, + "argumentList.actual.constructor.singleLine": notApplicable, + "argumentList.actual.constructor.multiLine": notApplicable, + "argumentList.formal.constructor.empty": notApplicable, + "argumentList.formal.constructor.singleLine": notApplicable, + "argumentList.formal.constructor.multiLine": notApplicable, + "functionCall.constructor": notApplicable, + "functionCallee.constructor": notApplicable, + "name.constructor": notApplicable, + "name.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "type.argument.formal.constructor": notApplicable, + "type.argument.formal.constructor.iteration": notApplicable, + "value.argument.formal.constructor": notApplicable, + "value.argument.formal.constructor.iteration": notApplicable, + "interior.constructor": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "name.namespace": notApplicable, + "interior.namespace": notApplicable, + + // Try / catch + "statement.try": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "interior.try": notApplicable, + "argument.catch": notApplicable, + "name.argument.catch": notApplicable, + "type.argument.catch": notApplicable, + + // Loop types + "statement.while": notApplicable, + "condition.while": notApplicable, + "interior.while": notApplicable, + "statement.doWhile": notApplicable, + "condition.doWhile": notApplicable, + "interior.doWhile": notApplicable, + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + + // Resource syntax + "statement.resource": notApplicable, + "name.resource": notApplicable, + "name.resource.iteration": notApplicable, + "value.resource": notApplicable, + "value.resource.iteration": notApplicable, + "type.resource": notApplicable, + "type.resource.iteration": notApplicable, + "interior.resource": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Keyword arguments + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Default parameter values + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + + // Yield + "statement.yield": notApplicable, + "value.yield": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Interface field types + "type.field.interface": notApplicable, + "type.iteration.interface": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, + "name.assignment.pattern": notApplicable, + "name.variable.pattern": notApplicable, + "value.variable.pattern": notApplicable, + "value.return.lambda": notApplicable, + "type.foreach": notApplicable, + "type.cast": notApplicable, + regularExpression: notApplicable, + selector: notApplicable, + unit: notApplicable, + pairDelimiter: notApplicable, + environment: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts index 224ff19eb9..05ef8f340b 100644 --- a/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts +++ b/packages/common/src/scopeSupportFacets/scopeSupportFacetInfos.ts @@ -71,7 +71,7 @@ export const scopeSupportFacetInfos: Record< }, "statement.class": { - description: "A class declaration", + description: "A class/struct declaration", scopeType: "statement", }, "statement.interface": { @@ -83,7 +83,7 @@ export const scopeSupportFacetInfos: Record< scopeType: "statement", }, "statement.field.class": { - description: "A field declaration in a class", + description: "A field declaration in a class/struct", scopeType: "statement", }, "statement.field.interface": { @@ -181,7 +181,7 @@ export const scopeSupportFacetInfos: Record< "statement.iteration.block": blockIter("statement", "statements"), class: { - description: "A class in an object-oriented language", + description: "A class/struct in an object-oriented language", scopeType: "class", }, "class.iteration.document": documentIter("class", "classes"), diff --git a/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts b/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts index a1678b4378..d2d54ffe3e 100644 --- a/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts +++ b/packages/cursorless-engine/src/languages/TreeSitterQuery/queryPredicateOperators.ts @@ -286,21 +286,23 @@ class GrowToNamedSiblings extends QueryPredicateOperator { */ class TrimEnd extends QueryPredicateOperator { name = "trim-end!" as const; - schema = z.tuple([q.node]); - - run(capture: MutableQueryCapture) { - const { document, range } = capture; - const text = getNode(capture).text; - const whitespaceLength = text.length - text.trimEnd().length; + schema = z.tuple([q.node]).rest(q.node); - if (whitespaceLength > 0) { - setRange( - capture, - new Range( - range.start, - adjustPosition(document, range.end, -whitespaceLength), - ), - ); + run(...captures: MutableQueryCapture[]) { + for (const capture of captures) { + const { document, range } = capture; + const text = getNode(capture).text; + const whitespaceLength = text.length - text.trimEnd().length; + + if (whitespaceLength > 0) { + setRange( + capture, + new Range( + range.start, + adjustPosition(document, range.end, -whitespaceLength), + ), + ); + } } return true; diff --git a/queries/go.scm b/queries/go.scm index 1a57ed82a8..b713a8c86f 100644 --- a/queries/go.scm +++ b/queries/go.scm @@ -4,13 +4,9 @@ ;; curl https://raw.githubusercontent.com/tree-sitter/tree-sitter-go/master/src/node-types.json | jq '[.[] | select(.type == "_statement" or .type == "_simple_statement") | .subtypes[].type]' | grep -v '\"_' | sed -n '1d;p' | sed '$d' | sort ;; and then cleaned up. [ - (assignment_statement) - ;; omit block for now, as it is not clear that it matches Cursorless user expectations - ;; (block) (break_statement) (const_declaration) (continue_statement) - (dec_statement) (defer_statement) (empty_statement) (expression_statement) @@ -19,18 +15,49 @@ (for_statement) (go_statement) (goto_statement) - (if_statement) - (inc_statement) (labeled_statement) (return_statement) (select_statement) (send_statement) - (short_var_declaration) (type_declaration) (type_switch_statement) - (var_declaration) + + ;; Disabled on purpose. We have a better definition of this below. + ;; (if_statement) + ;; omit block for now, as it is not clear that it matches Cursorless user expectations + ;; (block) ] @statement +;; Exclude statements that are part of for clauses +( + [ + (assignment_statement) + (short_var_declaration) + (var_declaration) + (inc_statement) + (dec_statement) + ] @statement + (#not-parent-type? @statement for_clause) +) + +( + (source_file) @statement.iteration @class.iteration @namedFunction.iteration + (#document-range! @statement.iteration @class.iteration @namedFunction.iteration) +) +( + (source_file) @name.iteration @value.iteration @type.iteration + (#document-range! @name.iteration @value.iteration @type.iteration) +) + +(block + "{" @class.iteration.start.endOf @statement.iteration.start.endOf + "}" @class.iteration.end.startOf @statement.iteration.end.startOf +) +(block + "{" @name.iteration.start.endOf @value.iteration.start.endOf @type.iteration.start.endOf + "}" @name.iteration.end.startOf @value.iteration.end.startOf @type.iteration.end.startOf +) + ;;!! { } ;;! ^ (_ @@ -50,155 +77,76 @@ (#character-range! @textFragment 1 -1) ) +;; // Hello world (comment) @comment @textFragment -;; What should map and list refer to in Go programs? -;; -;; The obvious answer is that map should refer to map and struct composite literals, -;; and that list should refer to slice and array composite literals. -;; -;; There are two problems with this answer. -;; -;; * The type of a composite literal is a semantic, not a syntactic property of a program. -;; - What is the type of T{1: 2}? It could be array, map, or slice. -;; - What about T{a: 1}? It could be map or struct. -;; - What about T{1, 2}? It could be struct, array, or slice. -;; Cursorless only has syntactic information available to it. -;; -;; * The user might not know the type either. With a named type, the type definition might be far away. -;; Or it might just be offscreen. Either way, the user needs to be able to make a decision about -;; what scope to use using only locally available, syntactic information. -;; Note that this also means that has-a predicates work better than has-no predicates. -;; The user can locally confirm that there is a keyed element. -;; She cannot confirm locally that there is no keyed element; it might just not be visible. -;; -;; Combining all these constraints suggests the following simple rules: -;; -;; * If there is a keyed element present, then it is a map. -;; * If there is a non-keyed element present, then it is a list. -;; * If there are both or neither, then it is both a map and a list. -;; -;; Conveniently, this is also simple to implement. -;; -;; This guarantees that a user always knows how to refer to any composite literal. -;; There are cases in which being overgenerous in matching is not ideal, -;; but they are rarer, so let's optimize for the common case. -;; Mixed keyed and non-keyed elements are also rare in practice. -;; The main ambiguity is with {}, but there's little we can do about that. -;; -;; Go users also expect that the map and list scopes will include the type definition, -;; as well as any & before the type. (Strictly speaking it is not part of the literal, -;; but that's not how most humans think about it.) -;; -;; If you are considering changing the map and list scopes, take a look at the examples in -;; data/playground/go/maps_and_lists.go, which cover a fairly wide variety of cases. - -;; maps - -;; &T{a: 1} -(unary_expression - operator: "&" - (composite_literal - body: (literal_value - (keyed_element) +;;!! type Foo struct {} +(type_declaration + (type_spec + name: (_) @name + type: (struct_type + (field_declaration_list + "{" @statement.iteration.start.endOf @name.iteration.start.endOf @type.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf @type.iteration.end.startOf + ) ) ) -) @map - -;; T{a: 1} -( - (composite_literal - body: (literal_value - (keyed_element) - ) - ) @map - (#not-parent-type? @map unary_expression) -) +) @class @type @name.domain -;; {a: 1} -( - (literal_value - (keyed_element) - ) @map - (#not-parent-type? @map composite_literal) +(struct_type + (field_declaration_list + "{" @namedFunction.iteration.start.endOf + "}" @namedFunction.iteration.end.startOf + ) ) -;; lists - -;; &T{1} -(unary_expression - operator: "&" - (composite_literal - body: (literal_value - (literal_element) +;;!! type Foo interface {} +(type_declaration + (type_spec + name: (_) @name + type: (interface_type + "{" @statement.iteration.start.endOf @name.iteration.start.endOf + "}" @statement.iteration.end.startOf @name.iteration.end.startOf ) ) -) @list +) @type @name.domain -;; T{1} -( - (composite_literal - body: (literal_value - (literal_element) - ) - ) @list - (#not-parent-type? @list unary_expression) +;;!! type Foo interface { bar() } +(method_spec + name: (_) @name +) @statement @name.domain + +;;!! type Foo struct { bar int } +;;!! type Foo interface { bar() } +(field_declaration + name: (_) @name + type: (_) @type +) @statement @_.domain + +;;!! T{a: 1} +;;! ^^^^^^ +(composite_literal + body: (literal_value + (keyed_element) + ) @map ) -;; {1} -( - (literal_value +;;!! T{1, 2} +;;! ^^^^^^ +(composite_literal + body: (literal_value (literal_element) ) @list - (#not-parent-type? @list composite_literal) -) - -;; empty composite literals - -;; &T{} -(unary_expression - operator: "&" - (composite_literal - body: (literal_value - . - "{" - . - (comment)* - . - "}" - . - ) - ) -) @list @map - -;; T{} -( - (composite_literal - body: (literal_value - . - "{" - . - (comment)* - . - "}" - . - ) - ) @list @map - (#not-parent-type? @list unary_expression) ) -;; {} -( - (literal_value - . +;;!! T{} +;;! ^^ +(composite_literal + body: (literal_value "{" . - (comment)* - . "}" - . ) @list @map - (#not-parent-type? @list composite_literal) ) ;; Functions @@ -209,35 +157,94 @@ ;; func foo() (function_declaration name: (_) @name -) @namedFunction @name.domain +) @namedFunction @statement @name.domain ;; method declaration ;; func (X) foo() {} (method_declaration name: (_) @name -) @namedFunction @name.domain +) @namedFunction @statement @name.domain -;; func literal -(func_literal) @anonymousFunction @namedFunction +;;!! func() {} +(func_literal) @anonymousFunction -;; switch-based branch +;;!! foo = func() {} +(assignment_statement + right: (expression_list + . + (func_literal) + . + ) +) @namedFunction ( [ + ;;!! default: (default_case) - (expression_case) - (type_case) - ] @branch - (#trim-end! @branch) + + ;;!! case 0: + (expression_case + value: (_) @condition + ) + + ;;!! case int: + (type_case + type: (_) @condition + ) + ] @branch @condition.domain + (#trim-end! @branch @condition.domain) (#insertion-delimiter! @branch "\n") ) -[ - (type_switch_statement) - (expression_switch_statement) -] @branch.iteration +;; The parent object has trailing whitespace that we want to exclude. +;; Our trim predicate can't operate on positions only ranges. +(_ + [ + "case" + "default" + ] + ":" @interior.start.endOf + . + (_) @_dummy + (_) @interior.end.endOf + . + (#not-type? @_dummy block) +) +(_ + [ + "case" + "default" + ] + ":" @interior.start.endOf + . + (_) @interior.end.endOf + . + (#not-type? @interior.end.endOf block) +) -;; if-else-based branch +;;!! switch foo {} +(expression_switch_statement + value: (_) @value + "{" @interior.start.endOf @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @interior.end.startOf @branch.iteration.end.startOf @condition.iteration.end.startOf +) @value.domain + +;;!! switch v := x.(type) {} +(type_switch_statement + "switch" + . + _ @value.start + _ @value.end + . + "{" @interior.start.endOf @branch.iteration.start.endOf @condition.iteration.start.endOf + "}" @interior.end.startOf @branch.iteration.end.startOf @condition.iteration.end.startOf +) @value.domain + +;; The outermost if statement +( + (if_statement) @ifStatement @statement @branch.iteration + (#not-parent-type? @ifStatement if_statement) +) ;; first if in an if-else chain ( @@ -266,14 +273,6 @@ (#insertion-delimiter! @branch.start.startOf " ") ) -;; iteration scope is always the outermost if statement -( - (if_statement) @branch.iteration - (#not-parent-type? @branch.iteration if_statement) -) - -(if_statement) @ifStatement - [ (call_expression) (composite_literal) @@ -282,10 +281,18 @@ (call_expression function: (_) @functionCallee ) @_.domain + (composite_literal type: (_) @functionCallee ) @_.domain +(return_statement + (expression_list) @value +) @_.domain + +;;!! map[string]int{"aaa": 1, "bbb": 2} +;;! ^^^^^ ^^^^^ +;;! ^ ^ (keyed_element . (_) @collectionKey @@ -293,21 +300,47 @@ (_) @value ) @_.domain -(return_statement - (expression_list) @value -) @_.domain - -(literal_value) @collectionKey.iteration @value.iteration +;;!! map[string]int{"aaa": 1, "bbb": 2} +;;! ^^^^^^^^^^^^^^^^^^ +(literal_value + "{" @collectionKey.iteration.start.endOf @value.iteration.start.endOf + "}" @collectionKey.iteration.end.startOf @value.iteration.end.startOf +) [ (pointer_type) (qualified_type) - (type_identifier) ] @type +;;!! type Foo = Bar +(type_declaration + (type_alias + name: (_) @name @value.leading.endOf + type: (_) @value + ) +) @type @_.domain + +;;!! var foo Bar[int, string] +;;! ^^^ ^^^^^^ +(generic_type + (type_arguments + (_) @type + ) +) + +;;!! var foo Bar[int, string] +;;! ^^^^^^^^^^^ +(generic_type + (type_arguments + "[" @type.iteration.start.endOf + "]" @type.iteration.end.startOf + ) +) + (function_declaration result: (_) @type ) @_.domain + (method_declaration result: (_) @type ) @_.domain @@ -318,6 +351,7 @@ condition: (_) @condition ) @_.domain (#not-type? @condition parenthesized_expression) + (#not-type? @_.domain for_clause) ) ;;!! if (true) {} @@ -328,6 +362,39 @@ (#child-range! @condition 0 -1 true true) ) +;;!! for i := 0; i < size; i++ {} +;;! ^^^^^^^^ +(for_statement + (for_clause + condition: (_) @condition + ) +) @condition.domain + +;;!! for i, v := range values {} +;;! ^^^^ +;;! ^^^^^^ +(for_statement + (range_clause + left: (_) @name + right: (_) @value + ) +) @_.domain + +;;!! foo, bar := 1, 2 +;;! ^^^ ^^^ ^ ^ +( + (expression_list + (_)? @collectionItem.leading.endOf + . + (_) @collectionItem + . + (_)? @collectionItem.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") +) + +(expression_list) @collectionItem.iteration + ;;!! func add(x int, y int) int {} ( (parameter_list @@ -354,19 +421,79 @@ (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n") ) +;;!! func bar( ) {} +;;! ^ (_ - (parameter_list - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf + parameters: (parameter_list + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) +) @argumentList.domain @argumentOrParameter.iteration.domain + +(_ + parameters: (parameter_list + "(" @name.iteration.start.endOf @type.iteration.start.endOf + ")" @name.iteration.end.startOf @type.iteration.end.startOf ) -) @argumentOrParameter.iteration.domain +) +;;!! foo( ) +;;! ^ (_ (argument_list - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) +) @argumentList.domain @argumentOrParameter.iteration.domain + +;;!! func foo(aaa int) {} +(parameter_declaration + name: (_) @name + type: (_) @type +) @_.domain + +;;!! var foo int = 0 +;;! ^^^ +;;! ^^^ +;;! ^ +(var_declaration + (var_spec + name: (_) @name + type: (_) @type @value.leading.endOf + value: (_)? @value ) -) @argumentOrParameter.iteration.domain +) @_.domain + +;;!! var foo = 0 +;;! ^^^ +;;! ^ +(var_declaration + (var_spec + name: (_) @name @value.leading.endOf + !type + value: (_) @value + ) +) @_.domain + +;;!! foo := 0 +;;! ^^^ +;;! ^ +(short_var_declaration + left: (_) @name @value.leading.endOf + right: (_) @value +) @_.domain + +;;!! foo = 0 +;;! ^^^ +;;! ^ +(assignment_statement + left: (_) @name @value.leading.endOf + right: (_) @value +) @_.domain operator: [ "<-"