diff --git a/data/fixtures/scopes/lua/anonymousFunction.scope b/data/fixtures/scopes/lua/anonymousFunction.scope new file mode 100644 index 0000000000..7714afd2b7 --- /dev/null +++ b/data/fixtures/scopes/lua/anonymousFunction.scope @@ -0,0 +1,17 @@ +f = function() end +--- + +[Content] = +[Domain] = 0:4-0:18 + >--------------< +0| f = function() end + +[Removal] = 0:3-0:18 + >---------------< +0| f = function() end + +[Leading delimiter] = 0:3-0:4 + >-< +0| f = function() end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/argument/argument.actual.iteration.scope b/data/fixtures/scopes/lua/argument/argument.actual.iteration.scope new file mode 100644 index 0000000000..1b28526f67 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.actual.iteration.scope @@ -0,0 +1,10 @@ +foo(aaa, bbb) +--- + +[Content] = 0:4-0:12 + >--------< +0| foo(aaa, bbb) + +[Domain] = 0:0-0:13 + >-------------< +0| foo(aaa, bbb) diff --git a/data/fixtures/scopes/lua/argument/argument.actual.method.iteration.scope b/data/fixtures/scopes/lua/argument/argument.actual.method.iteration.scope new file mode 100644 index 0000000000..abfd34ba15 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.actual.method.iteration.scope @@ -0,0 +1,10 @@ +foo:bar(aaa, bbb) +--- + +[Content] = 0:8-0:16 + >--------< +0| foo:bar(aaa, bbb) + +[Domain] = 0:0-0:17 + >-----------------< +0| foo:bar(aaa, bbb) diff --git a/data/fixtures/scopes/lua/argument/argument.actual.method.multiLine.scope b/data/fixtures/scopes/lua/argument/argument.actual.method.multiLine.scope new file mode 100644 index 0000000000..aa45966b3f --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argument/argument.actual.method.singleLine.scope b/data/fixtures/scopes/lua/argument/argument.actual.method.singleLine.scope new file mode 100644 index 0000000000..597e1e207f --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argument/argument.actual.multiLine.scope b/data/fixtures/scopes/lua/argument/argument.actual.multiLine.scope new file mode 100644 index 0000000000..5ad321caa7 --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argument/argument.actual.singleLine.scope b/data/fixtures/scopes/lua/argument/argument.actual.singleLine.scope new file mode 100644 index 0000000000..b1a9403ff3 --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argument/argument.formal.iteration.scope b/data/fixtures/scopes/lua/argument/argument.formal.iteration.scope new file mode 100644 index 0000000000..b8e726a4fa --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.iteration.scope @@ -0,0 +1,10 @@ +function foo(aaa, bbb) end +--- + +[Content] = 0:13-0:21 + >--------< +0| function foo(aaa, bbb) end + +[Domain] = 0:0-0:26 + >--------------------------< +0| function foo(aaa, bbb) end diff --git a/data/fixtures/scopes/lua/argument/argument.formal.lambda.iteration.scope b/data/fixtures/scopes/lua/argument/argument.formal.lambda.iteration.scope new file mode 100644 index 0000000000..c93a48d4cb --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.lambda.iteration.scope @@ -0,0 +1,10 @@ +f = function(aaa, bbb) end +--- + +[Content] = 0:13-0:21 + >--------< +0| f = function(aaa, bbb) end + +[Domain] = 0:4-0:26 + >----------------------< +0| f = function(aaa, bbb) end diff --git a/data/fixtures/scopes/lua/argument/argument.formal.lambda.multiLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..31d28b9dca --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.lambda.multiLine.scope @@ -0,0 +1,44 @@ +f = function( + aaa, + bbb +) end +--- + +[#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/lua/argument/argument.formal.lambda.singleLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..3a3c3344c9 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.lambda.singleLine.scope @@ -0,0 +1,33 @@ +f = function(aaa, bbb) end +--- + +[#1 Content] = +[#1 Domain] = 0:13-0:16 + >---< +0| f = function(aaa, bbb) end + +[#1 Removal] = 0:13-0:18 + >-----< +0| f = function(aaa, bbb) end + +[#1 Trailing delimiter] = 0:16-0:18 + >--< +0| f = function(aaa, bbb) end + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:18-0:21 + >---< +0| f = function(aaa, bbb) end + +[#2 Removal] = 0:16-0:21 + >-----< +0| f = function(aaa, bbb) end + +[#2 Leading delimiter] = 0:16-0:18 + >--< +0| f = function(aaa, bbb) end + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/argument/argument.formal.method.iteration.scope b/data/fixtures/scopes/lua/argument/argument.formal.method.iteration.scope new file mode 100644 index 0000000000..1bfed3d6d1 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.method.iteration.scope @@ -0,0 +1,10 @@ +function foo:bar(aaa, bbb) end +--- + +[Content] = 0:17-0:25 + >--------< +0| function foo:bar(aaa, bbb) end + +[Domain] = 0:0-0:30 + >------------------------------< +0| function foo:bar(aaa, bbb) end diff --git a/data/fixtures/scopes/lua/argument/argument.formal.method.multiLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.method.multiLine.scope new file mode 100644 index 0000000000..ea3fbf0621 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.method.multiLine.scope @@ -0,0 +1,44 @@ +function foo:bar( + aaa, + bbb +) end +--- + +[#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/lua/argument/argument.formal.method.singleLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.method.singleLine.scope new file mode 100644 index 0000000000..40184262ed --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.method.singleLine.scope @@ -0,0 +1,33 @@ +function foo:bar(aaa, bbb) end +--- + +[#1 Content] = +[#1 Domain] = 0:17-0:20 + >---< +0| function foo:bar(aaa, bbb) end + +[#1 Removal] = 0:17-0:22 + >-----< +0| function foo:bar(aaa, bbb) end + +[#1 Trailing delimiter] = 0:20-0:22 + >--< +0| function foo:bar(aaa, bbb) end + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:22-0:25 + >---< +0| function foo:bar(aaa, bbb) end + +[#2 Removal] = 0:20-0:25 + >-----< +0| function foo:bar(aaa, bbb) end + +[#2 Leading delimiter] = 0:20-0:22 + >--< +0| function foo:bar(aaa, bbb) end + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/argument/argument.formal.multiLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.multiLine.scope new file mode 100644 index 0000000000..f41c6a30a5 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.multiLine.scope @@ -0,0 +1,46 @@ +function foo( + aaa, + bbb +) + return a + b +end +--- + +[#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/lua/argument/argument.formal.singleLine.scope b/data/fixtures/scopes/lua/argument/argument.formal.singleLine.scope new file mode 100644 index 0000000000..06f77dd304 --- /dev/null +++ b/data/fixtures/scopes/lua/argument/argument.formal.singleLine.scope @@ -0,0 +1,33 @@ +function foo(aaa, bbb) end +--- + +[#1 Content] = +[#1 Domain] = 0:13-0:16 + >---< +0| function foo(aaa, bbb) end + +[#1 Removal] = 0:13-0:18 + >-----< +0| function foo(aaa, bbb) end + +[#1 Trailing delimiter] = 0:16-0:18 + >--< +0| function foo(aaa, bbb) end + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:18-0:21 + >---< +0| function foo(aaa, bbb) end + +[#2 Removal] = 0:16-0:21 + >-----< +0| function foo(aaa, bbb) end + +[#2 Leading delimiter] = 0:16-0:18 + >--< +0| function foo(aaa, bbb) end + +[#2 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.actual.empty.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.empty.scope new file mode 100644 index 0000000000..947915ef96 --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argumentList/argumentList.actual.method.empty.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.method.empty.scope new file mode 100644 index 0000000000..5abb12686a --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argumentList/argumentList.actual.method.multiLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.method.multiLine.scope new file mode 100644 index 0000000000..ba147a032f --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.actual.method.multiLine.scope @@ -0,0 +1,33 @@ +foo:bar( + aaa, + bbb +) +--- + +[Content] = 1:4-2:7 + >---- +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/lua/argumentList/argumentList.actual.method.singleLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.method.singleLine.scope new file mode 100644 index 0000000000..f73f859620 --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argumentList/argumentList.actual.multiLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.multiLine.scope new file mode 100644 index 0000000000..642614d02e --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.actual.multiLine.scope @@ -0,0 +1,33 @@ +foo( + aaa, + bbb +) +--- + +[Content] = 1:4-2:7 + >---- +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/lua/argumentList/argumentList.actual.singleLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.actual.singleLine.scope new file mode 100644 index 0000000000..f0de18dd5d --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/argumentList/argumentList.formal.empty.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.empty.scope new file mode 100644 index 0000000000..1a24024f75 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.empty.scope @@ -0,0 +1,13 @@ +function foo() end +--- + +[Content] = +[Removal] = 0:13-0:13 + >< +0| function foo() end + +[Domain] = 0:0-0:18 + >------------------< +0| function foo() end + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.empty.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.empty.scope new file mode 100644 index 0000000000..97f0d10df2 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.empty.scope @@ -0,0 +1,13 @@ +f = function() end +--- + +[Content] = +[Removal] = 0:13-0:13 + >< +0| f = function() end + +[Domain] = 0:4-0:18 + >--------------< +0| f = function() end + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.multiLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.multiLine.scope new file mode 100644 index 0000000000..3249bc440c --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.multiLine.scope @@ -0,0 +1,33 @@ +f = function( + aaa, + bbb +) end +--- + +[Content] = 1:4-2:7 + >---- +1| aaa, +2| bbb + -------< + +[Removal] = 0:13-3:0 + > +0| f = function( +1| aaa, +2| bbb +3| ) end + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:4-3:5 + >--------- +0| f = function( +1| aaa, +2| bbb +3| ) end + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.singleLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.singleLine.scope new file mode 100644 index 0000000000..ad42f647a3 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.lambda.singleLine.scope @@ -0,0 +1,13 @@ +f = function(aaa, bbb) end +--- + +[Content] = +[Removal] = 0:13-0:21 + >--------< +0| f = function(aaa, bbb) end + +[Domain] = 0:4-0:26 + >----------------------< +0| f = function(aaa, bbb) end + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.empty.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.empty.scope new file mode 100644 index 0000000000..ce5a31122e --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.empty.scope @@ -0,0 +1,13 @@ +function foo:bar() end +--- + +[Content] = +[Removal] = 0:17-0:17 + >< +0| function foo:bar() end + +[Domain] = 0:0-0:22 + >----------------------< +0| function foo:bar() end + +[Insertion delimiter] = "" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.multiLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.multiLine.scope new file mode 100644 index 0000000000..b0744cb605 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.multiLine.scope @@ -0,0 +1,33 @@ +function foo:bar( + aaa, + bbb +) end +--- + +[Content] = 1:4-2:7 + >---- +1| aaa, +2| bbb + -------< + +[Removal] = 0:17-3:0 + > +0| function foo:bar( +1| aaa, +2| bbb +3| ) end + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:5 + >----------------- +0| function foo:bar( +1| aaa, +2| bbb +3| ) end + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.singleLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.singleLine.scope new file mode 100644 index 0000000000..86834d52ea --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.method.singleLine.scope @@ -0,0 +1,13 @@ +function foo:bar(aaa, bbb) end +--- + +[Content] = +[Removal] = 0:17-0:25 + >--------< +0| function foo:bar(aaa, bbb) end + +[Domain] = 0:0-0:30 + >------------------------------< +0| function foo:bar(aaa, bbb) end + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.multiLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.multiLine.scope new file mode 100644 index 0000000000..0418d0fb36 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.multiLine.scope @@ -0,0 +1,33 @@ +function foo( + aaa, + bbb +) end +--- + +[Content] = 1:4-2:7 + >---- +1| aaa, +2| bbb + -------< + +[Removal] = 0:13-3:0 + > +0| function foo( +1| aaa, +2| bbb +3| ) end + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:5 + >------------- +0| function foo( +1| aaa, +2| bbb +3| ) end + -----< + +[Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/lua/argumentList/argumentList.formal.singleLine.scope b/data/fixtures/scopes/lua/argumentList/argumentList.formal.singleLine.scope new file mode 100644 index 0000000000..fefd9d8ec0 --- /dev/null +++ b/data/fixtures/scopes/lua/argumentList/argumentList.formal.singleLine.scope @@ -0,0 +1,13 @@ +function foo(aaa, bbb) end +--- + +[Content] = +[Removal] = 0:13-0:21 + >--------< +0| function foo(aaa, bbb) end + +[Domain] = 0:0-0:26 + >--------------------------< +0| function foo(aaa, bbb) end + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/branch.if.elif.else.scope b/data/fixtures/scopes/lua/branch/branch.if.elif.else.scope similarity index 100% rename from data/fixtures/scopes/lua/branch.if.elif.else.scope rename to data/fixtures/scopes/lua/branch/branch.if.elif.else.scope diff --git a/data/fixtures/scopes/lua/branch.if.else.scope b/data/fixtures/scopes/lua/branch/branch.if.else.scope similarity index 100% rename from data/fixtures/scopes/lua/branch.if.else.scope rename to data/fixtures/scopes/lua/branch/branch.if.else.scope diff --git a/data/fixtures/scopes/lua/branch.if.iteration.scope b/data/fixtures/scopes/lua/branch/branch.if.iteration.scope similarity index 100% rename from data/fixtures/scopes/lua/branch.if.iteration.scope rename to data/fixtures/scopes/lua/branch/branch.if.iteration.scope diff --git a/data/fixtures/scopes/lua/branch.if.scope b/data/fixtures/scopes/lua/branch/branch.if.scope similarity index 100% rename from data/fixtures/scopes/lua/branch.if.scope rename to data/fixtures/scopes/lua/branch/branch.if.scope diff --git a/data/fixtures/scopes/lua/collectionItem.unenclosed.iteration.scope b/data/fixtures/scopes/lua/collectionItem.unenclosed.iteration.scope new file mode 100644 index 0000000000..f776cb2a9d --- /dev/null +++ b/data/fixtures/scopes/lua/collectionItem.unenclosed.iteration.scope @@ -0,0 +1,19 @@ +local a, b, c = 1, 2, 3 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:23 + >-----------------------< +0| local a, b, c = 1, 2, 3 + + +[#2 Content] = +[#2 Domain] = 0:6-0:13 + >-------< +0| local a, b, c = 1, 2, 3 + + +[#3 Content] = +[#3 Domain] = 0:16-0:23 + >-------< +0| local a, b, c = 1, 2, 3 diff --git a/data/fixtures/scopes/lua/collectionItem.unenclosed.multiLine.scope b/data/fixtures/scopes/lua/collectionItem.unenclosed.multiLine.scope new file mode 100644 index 0000000000..3af8cd6588 --- /dev/null +++ b/data/fixtures/scopes/lua/collectionItem.unenclosed.multiLine.scope @@ -0,0 +1,154 @@ +local a, + b, + c = + 1, + 2, + 3 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| local a, + +[#1 Removal] = 0:0-0:8 + >--------< +0| local a, + +[#1 Trailing delimiter] = 0:7-0:8 + >-< +0| local a, + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:6-0:7 + >-< +0| local a, + +[#2 Removal] = 0:6-1:2 + >-- +0| local a, +1| b, + --< + +[#2 Trailing delimiter] = 0:7-1:2 + >- +0| local a, +1| b, + --< + +[#2 Insertion delimiter] = ",\n" + + +[#3 Content] = +[#3 Domain] = 1:2-1:3 + >-< +1| b, + +[#3 Removal] = 1:2-2:2 + >-- +1| b, +2| c = + --< + +[#3 Leading delimiter] = 0:7-1:2 + >- +0| local a, +1| b, + --< + +[#3 Trailing delimiter] = 1:3-2:2 + >- +1| b, +2| c = + --< + +[#3 Insertion delimiter] = ",\n" + + +[#4 Content] = +[#4 Domain] = 2:2-2:3 + >-< +2| c = + +[#4 Removal] = 1:3-2:3 + >- +1| b, +2| c = + ---< + +[#4 Leading delimiter] = 1:3-2:2 + >- +1| b, +2| c = + --< + +[#4 Insertion delimiter] = ",\n" + + +[#5 Content] = +[#5 Domain] = 3:2-3:3 + >-< +3| 1, + +[#5 Removal] = 3:2-4:2 + >-- +3| 1, +4| 2, + --< + +[#5 Trailing delimiter] = 3:3-4:2 + >- +3| 1, +4| 2, + --< + +[#5 Insertion delimiter] = ",\n" + + +[#6 Content] = +[#6 Domain] = 4:2-4:3 + >-< +4| 2, + +[#6 Removal] = 4:2-5:2 + >-- +4| 2, +5| 3 + --< + +[#6 Leading delimiter] = 3:3-4:2 + >- +3| 1, +4| 2, + --< + +[#6 Trailing delimiter] = 4:3-5:2 + >- +4| 2, +5| 3 + --< + +[#6 Insertion delimiter] = ",\n" + + +[#7 Content] = +[#7 Domain] = 5:2-5:3 + >-< +5| 3 + +[#7 Removal] = 4:3-5:3 + >- +4| 2, +5| 3 + ---< + +[#7 Leading delimiter] = 4:3-5:2 + >- +4| 2, +5| 3 + --< + +[#7 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/lua/collectionItem.unenclosed.singleLine.scope b/data/fixtures/scopes/lua/collectionItem.unenclosed.singleLine.scope new file mode 100644 index 0000000000..ef42614f45 --- /dev/null +++ b/data/fixtures/scopes/lua/collectionItem.unenclosed.singleLine.scope @@ -0,0 +1,141 @@ +local a, b, c = 1, 2, 3 +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:7 + >-------< +0| local a, b, c = 1, 2, 3 + +[#1 Removal] = 0:0-0:9 + >---------< +0| local a, b, c = 1, 2, 3 + +[#1 Trailing delimiter] = 0:7-0:9 + >--< +0| local a, b, c = 1, 2, 3 + +[#1 Insertion delimiter] = ", " + + +[#2 Content] = +[#2 Domain] = 0:6-0:7 + >-< +0| local a, b, c = 1, 2, 3 + +[#2 Removal] = 0:6-0:9 + >---< +0| local a, b, c = 1, 2, 3 + +[#2 Trailing delimiter] = 0:7-0:9 + >--< +0| local a, b, c = 1, 2, 3 + +[#2 Insertion delimiter] = ", " + + +[#3 Content] = +[#3 Domain] = 0:9-0:10 + >-< +0| local a, b, c = 1, 2, 3 + +[#3 Removal] = 0:9-0:12 + >---< +0| local a, b, c = 1, 2, 3 + +[#3 Leading delimiter] = 0:7-0:9 + >--< +0| local a, b, c = 1, 2, 3 + +[#3 Trailing delimiter] = 0:10-0:12 + >--< +0| local a, b, c = 1, 2, 3 + +[#3 Insertion delimiter] = ", " + + +[#4 Content] = +[#4 Domain] = 0:12-0:13 + >-< +0| local a, b, c = 1, 2, 3 + +[#4 Removal] = 0:10-0:13 + >---< +0| local a, b, c = 1, 2, 3 + +[#4 Leading delimiter] = 0:10-0:12 + >--< +0| local a, b, c = 1, 2, 3 + +[#4 Insertion delimiter] = ", " + + +[#5 Content] = +[#5 Domain] = 0:12-0:17 + >-----< +0| local a, b, c = 1, 2, 3 + +[#5 Removal] = 0:12-0:19 + >-------< +0| local a, b, c = 1, 2, 3 + +[#5 Leading delimiter] = 0:10-0:12 + >--< +0| local a, b, c = 1, 2, 3 + +[#5 Trailing delimiter] = 0:17-0:19 + >--< +0| local a, b, c = 1, 2, 3 + +[#5 Insertion delimiter] = ", " + + +[#6 Content] = +[#6 Domain] = 0:16-0:17 + >-< +0| local a, b, c = 1, 2, 3 + +[#6 Removal] = 0:16-0:19 + >---< +0| local a, b, c = 1, 2, 3 + +[#6 Trailing delimiter] = 0:17-0:19 + >--< +0| local a, b, c = 1, 2, 3 + +[#6 Insertion delimiter] = ", " + + +[#7 Content] = +[#7 Domain] = 0:19-0:20 + >-< +0| local a, b, c = 1, 2, 3 + +[#7 Removal] = 0:19-0:22 + >---< +0| local a, b, c = 1, 2, 3 + +[#7 Leading delimiter] = 0:17-0:19 + >--< +0| local a, b, c = 1, 2, 3 + +[#7 Trailing delimiter] = 0:20-0:22 + >--< +0| local a, b, c = 1, 2, 3 + +[#7 Insertion delimiter] = ", " + + +[#8 Content] = +[#8 Domain] = 0:22-0:23 + >-< +0| local a, b, c = 1, 2, 3 + +[#8 Removal] = 0:20-0:23 + >---< +0| local a, b, c = 1, 2, 3 + +[#8 Leading delimiter] = 0:20-0:22 + >--< +0| local a, b, c = 1, 2, 3 + +[#8 Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/lua/comment.block.scope b/data/fixtures/scopes/lua/comment.block.scope new file mode 100644 index 0000000000..151aa84a24 --- /dev/null +++ b/data/fixtures/scopes/lua/comment.block.scope @@ -0,0 +1,10 @@ +--[[ Hello world ]] +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| --[[ Hello world ]] + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/comment.line.scope b/data/fixtures/scopes/lua/comment.line.scope new file mode 100644 index 0000000000..f444c004b9 --- /dev/null +++ b/data/fixtures/scopes/lua/comment.line.scope @@ -0,0 +1,10 @@ +-- Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| -- Hello world + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/condition.doWhile.scope b/data/fixtures/scopes/lua/condition.doWhile.scope new file mode 100644 index 0000000000..29674a4baa --- /dev/null +++ b/data/fixtures/scopes/lua/condition.doWhile.scope @@ -0,0 +1,20 @@ +repeat until true +--- + +[Content] = 0:13-0:17 + >----< +0| repeat until true + +[Removal] = 0:12-0:17 + >-----< +0| repeat until true + +[Leading delimiter] = 0:12-0:13 + >-< +0| repeat until true + +[Domain] = 0:0-0:17 + >-----------------< +0| repeat until true + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/condition.for.scope b/data/fixtures/scopes/lua/condition.for.scope new file mode 100644 index 0000000000..abf35b7060 --- /dev/null +++ b/data/fixtures/scopes/lua/condition.for.scope @@ -0,0 +1,24 @@ +for i = 1, 3 do end +--- + +[Content] = 0:4-0:12 + >--------< +0| for i = 1, 3 do end + +[Removal] = 0:4-0:13 + >---------< +0| for i = 1, 3 do end + +[Leading delimiter] = 0:3-0:4 + >-< +0| for i = 1, 3 do end + +[Trailing delimiter] = 0:12-0:13 + >-< +0| for i = 1, 3 do end + +[Domain] = 0:0-0:19 + >-------------------< +0| for i = 1, 3 do end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/condition.while.scope b/data/fixtures/scopes/lua/condition.while.scope new file mode 100644 index 0000000000..dddb9659a9 --- /dev/null +++ b/data/fixtures/scopes/lua/condition.while.scope @@ -0,0 +1,24 @@ +while true do end +--- + +[Content] = 0:6-0:10 + >----< +0| while true do end + +[Removal] = 0:6-0:11 + >-----< +0| while true do end + +[Leading delimiter] = 0:5-0:6 + >-< +0| while true do end + +[Trailing delimiter] = 0:10-0:11 + >-< +0| while true do end + +[Domain] = 0:0-0:17 + >-----------------< +0| while true do end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/functionCall.chain.scope b/data/fixtures/scopes/lua/functionCall/functionCall.chain.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCall.chain.scope rename to data/fixtures/scopes/lua/functionCall/functionCall.chain.scope diff --git a/data/fixtures/scopes/lua/functionCall.chain2.scope b/data/fixtures/scopes/lua/functionCall/functionCall.chain2.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCall.chain2.scope rename to data/fixtures/scopes/lua/functionCall/functionCall.chain2.scope diff --git a/data/fixtures/scopes/lua/functionCall.method.scope b/data/fixtures/scopes/lua/functionCall/functionCall.method.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCall.method.scope rename to data/fixtures/scopes/lua/functionCall/functionCall.method.scope diff --git a/data/fixtures/scopes/lua/functionCall.method2.scope b/data/fixtures/scopes/lua/functionCall/functionCall.method2.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCall.method2.scope rename to data/fixtures/scopes/lua/functionCall/functionCall.method2.scope diff --git a/data/fixtures/scopes/lua/functionCall.scope b/data/fixtures/scopes/lua/functionCall/functionCall.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCall.scope rename to data/fixtures/scopes/lua/functionCall/functionCall.scope diff --git a/data/fixtures/scopes/lua/functionCallee.chain.scope b/data/fixtures/scopes/lua/functionCallee/functionCallee.chain.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCallee.chain.scope rename to data/fixtures/scopes/lua/functionCallee/functionCallee.chain.scope diff --git a/data/fixtures/scopes/lua/functionCallee.chain2.scope b/data/fixtures/scopes/lua/functionCallee/functionCallee.chain2.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCallee.chain2.scope rename to data/fixtures/scopes/lua/functionCallee/functionCallee.chain2.scope diff --git a/data/fixtures/scopes/lua/functionCallee.method.scope b/data/fixtures/scopes/lua/functionCallee/functionCallee.method.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCallee.method.scope rename to data/fixtures/scopes/lua/functionCallee/functionCallee.method.scope diff --git a/data/fixtures/scopes/lua/functionCallee.method2.scope b/data/fixtures/scopes/lua/functionCallee/functionCallee.method2.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCallee.method2.scope rename to data/fixtures/scopes/lua/functionCallee/functionCallee.method2.scope diff --git a/data/fixtures/scopes/lua/functionCallee.scope b/data/fixtures/scopes/lua/functionCallee/functionCallee.scope similarity index 100% rename from data/fixtures/scopes/lua/functionCallee.scope rename to data/fixtures/scopes/lua/functionCallee/functionCallee.scope diff --git a/data/fixtures/scopes/lua/interior.function.scope b/data/fixtures/scopes/lua/interior.function.scope deleted file mode 100644 index 1b252dfed5..0000000000 --- a/data/fixtures/scopes/lua/interior.function.scope +++ /dev/null @@ -1,10 +0,0 @@ -function foo() end ---- - -[Content] = -[Removal] = -[Domain] = 0:14-0:15 - >-< -0| function foo() end - -[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.doWhile.scope b/data/fixtures/scopes/lua/interior/interior.doWhile.scope new file mode 100644 index 0000000000..5957f197b1 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.doWhile.scope @@ -0,0 +1,18 @@ +repeat + a = 1 +until true +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:6-2:0 + > +0| repeat +1| a = 1 +2| until true + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.for.scope b/data/fixtures/scopes/lua/interior/interior.for.scope new file mode 100644 index 0000000000..2848244ad7 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.for.scope @@ -0,0 +1,18 @@ +for i = 1, 3 do + a = 1 +end +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:15-2:0 + > +0| for i = 1, 3 do +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.foreach.scope b/data/fixtures/scopes/lua/interior/interior.foreach.scope new file mode 100644 index 0000000000..6fca423156 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.foreach.scope @@ -0,0 +1,18 @@ +for v in values do + a = 1 +end +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:18-2:0 + > +0| for v in values do +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.function.scope b/data/fixtures/scopes/lua/interior/interior.function.scope new file mode 100644 index 0000000000..e838a4a174 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.function.scope @@ -0,0 +1,18 @@ +function foo() + a = 1 +end +--- + +[Content] = 1:4-1:9 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:14-2:0 + > +0| function foo() +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior.if.scope b/data/fixtures/scopes/lua/interior/interior.if.scope similarity index 100% rename from data/fixtures/scopes/lua/interior.if.scope rename to data/fixtures/scopes/lua/interior/interior.if.scope diff --git a/data/fixtures/scopes/lua/interior/interior.lambda.scope b/data/fixtures/scopes/lua/interior/interior.lambda.scope new file mode 100644 index 0000000000..156f909ef2 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.lambda.scope @@ -0,0 +1,18 @@ +f = function() + a = 1 +end +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:14-2:0 + > +0| f = function() +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.method.scope b/data/fixtures/scopes/lua/interior/interior.method.scope new file mode 100644 index 0000000000..785099983b --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.method.scope @@ -0,0 +1,18 @@ +function foo:bar() + a = 1 +end +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:18-2:0 + > +0| function foo:bar() +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/interior/interior.while.scope b/data/fixtures/scopes/lua/interior/interior.while.scope new file mode 100644 index 0000000000..da567e6009 --- /dev/null +++ b/data/fixtures/scopes/lua/interior/interior.while.scope @@ -0,0 +1,18 @@ +while true do + a = 1 +end +--- + +[Content] = 1:2-1:7 + >-----< +1| a = 1 + +[Removal] = +[Domain] = 0:13-2:0 + > +0| while true do +1| a = 1 +2| end + < + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/key.mapPair.iteration.scope b/data/fixtures/scopes/lua/key.mapPair.iteration.scope new file mode 100644 index 0000000000..3788425081 --- /dev/null +++ b/data/fixtures/scopes/lua/key.mapPair.iteration.scope @@ -0,0 +1,7 @@ +{ aaa = 1, bbb = 2 } +--- + +[Content] = +[Domain] = 0:1-0:19 + >------------------< +0| { aaa = 1, bbb = 2 } diff --git a/data/fixtures/scopes/lua/key.mapPair.scope b/data/fixtures/scopes/lua/key.mapPair.scope new file mode 100644 index 0000000000..89cca48434 --- /dev/null +++ b/data/fixtures/scopes/lua/key.mapPair.scope @@ -0,0 +1,39 @@ +{ aaa = 1, bbb = 2 } +--- + +[#1 Content] = 0:2-0:5 + >---< +0| { aaa = 1, bbb = 2 } + +[#1 Removal] = 0:2-0:8 + >------< +0| { aaa = 1, bbb = 2 } + +[#1 Trailing delimiter] = 0:5-0:8 + >---< +0| { aaa = 1, bbb = 2 } + +[#1 Domain] = 0:2-0:9 + >-------< +0| { aaa = 1, bbb = 2 } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:11-0:14 + >---< +0| { aaa = 1, bbb = 2 } + +[#2 Removal] = 0:11-0:17 + >------< +0| { aaa = 1, bbb = 2 } + +[#2 Trailing delimiter] = 0:14-0:17 + >---< +0| { aaa = 1, bbb = 2 } + +[#2 Domain] = 0:11-0:18 + >-------< +0| { aaa = 1, bbb = 2 } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/list.scope b/data/fixtures/scopes/lua/list.scope new file mode 100644 index 0000000000..33d894016e --- /dev/null +++ b/data/fixtures/scopes/lua/list.scope @@ -0,0 +1,10 @@ +{ 1, 2, 3 } +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:11 + >-----------< +0| { 1, 2, 3 } + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.argument.formal.iteration.scope b/data/fixtures/scopes/lua/name/name.argument.formal.iteration.scope new file mode 100644 index 0000000000..7bb9668a82 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.argument.formal.iteration.scope @@ -0,0 +1,13 @@ +function foo(aaa, bbb) end +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:26 + >--------------------------< +0| function foo(aaa, bbb) end + + +[#2 Content] = +[#2 Domain] = 0:13-0:21 + >--------< +0| function foo(aaa, bbb) end diff --git a/data/fixtures/scopes/lua/name/name.argument.formal.method.iteration.scope b/data/fixtures/scopes/lua/name/name.argument.formal.method.iteration.scope new file mode 100644 index 0000000000..d2a38dc7a0 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.argument.formal.method.iteration.scope @@ -0,0 +1,13 @@ +function foo:bar(aaa, bbb) end +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:30 + >------------------------------< +0| function foo:bar(aaa, bbb) end + + +[#2 Content] = +[#2 Domain] = 0:17-0:25 + >--------< +0| function foo:bar(aaa, bbb) end diff --git a/data/fixtures/scopes/lua/name/name.argument.formal.method.scope b/data/fixtures/scopes/lua/name/name.argument.formal.method.scope new file mode 100644 index 0000000000..476b631c01 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.argument.formal.method.scope @@ -0,0 +1,42 @@ +function foo:bar(aaa, bbb) end +--- + +[#1 Content] = +[#1 Removal] = 0:9-0:16 + >-------< +0| function foo:bar(aaa, bbb) end + +[#1 Leading delimiter] = 0:8-0:9 + >-< +0| function foo:bar(aaa, bbb) end + +[#1 Domain] = 0:0-0:30 + >------------------------------< +0| function foo:bar(aaa, bbb) end + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:17-0:20 + >---< +0| function foo:bar(aaa, bbb) end + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Domain] = 0:22-0:25 + >---< +0| function foo:bar(aaa, bbb) end + +[#3 Removal] = 0:21-0:25 + >----< +0| function foo:bar(aaa, bbb) end + +[#3 Leading delimiter] = 0:21-0:22 + >-< +0| function foo:bar(aaa, bbb) end + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.argument.formal.scope b/data/fixtures/scopes/lua/name/name.argument.formal.scope new file mode 100644 index 0000000000..11fb9d76ae --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.argument.formal.scope @@ -0,0 +1,42 @@ +function foo(aaa, bbb) end +--- + +[#1 Content] = +[#1 Removal] = 0:9-0:12 + >---< +0| function foo(aaa, bbb) end + +[#1 Leading delimiter] = 0:8-0:9 + >-< +0| function foo(aaa, bbb) end + +[#1 Domain] = 0:0-0:26 + >--------------------------< +0| function foo(aaa, bbb) end + +[#1 Insertion delimiter] = " " + + +[#2 Content] = +[#2 Removal] = +[#2 Domain] = 0:13-0:16 + >---< +0| function foo(aaa, bbb) end + +[#2 Insertion delimiter] = " " + + +[#3 Content] = +[#3 Domain] = 0:18-0:21 + >---< +0| function foo(aaa, bbb) end + +[#3 Removal] = 0:17-0:21 + >----< +0| function foo(aaa, bbb) end + +[#3 Leading delimiter] = 0:17-0:18 + >-< +0| function foo(aaa, bbb) end + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.assignment.pattern.scope b/data/fixtures/scopes/lua/name/name.assignment.pattern.scope new file mode 100644 index 0000000000..0636e4e0dc --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.assignment.pattern.scope @@ -0,0 +1,24 @@ +local a, b = 1, 2 +--- + +[Content] = 0:6-0:10 + >----< +0| local a, b = 1, 2 + +[Removal] = 0:0-0:13 + >-------------< +0| local a, b = 1, 2 + +[Leading delimiter] = 0:5-0:6 + >-< +0| local a, b = 1, 2 + +[Trailing delimiter] = 0:10-0:11 + >-< +0| local a, b = 1, 2 + +[Domain] = 0:0-0:17 + >-----------------< +0| local a, b = 1, 2 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name.assignment.scope b/data/fixtures/scopes/lua/name/name.assignment.scope similarity index 100% rename from data/fixtures/scopes/lua/name.assignment.scope rename to data/fixtures/scopes/lua/name/name.assignment.scope diff --git a/data/fixtures/scopes/lua/name.assignment2.scope b/data/fixtures/scopes/lua/name/name.assignment2.scope similarity index 100% rename from data/fixtures/scopes/lua/name.assignment2.scope rename to data/fixtures/scopes/lua/name/name.assignment2.scope diff --git a/data/fixtures/scopes/lua/name/name.foreach.scope b/data/fixtures/scopes/lua/name/name.foreach.scope new file mode 100644 index 0000000000..f91477e691 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.foreach.scope @@ -0,0 +1,24 @@ +for v in values do end +--- + +[Content] = 0:4-0:5 + >-< +0| for v in values do end + +[Removal] = 0:4-0:6 + >--< +0| for v in values do end + +[Leading delimiter] = 0:3-0:4 + >-< +0| for v in values do end + +[Trailing delimiter] = 0:5-0:6 + >-< +0| for v in values do end + +[Domain] = 0:0-0:22 + >----------------------< +0| for v in values do end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.function.scope b/data/fixtures/scopes/lua/name/name.function.scope new file mode 100644 index 0000000000..a477fe87ae --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.function.scope @@ -0,0 +1,17 @@ +function foo() end +--- + +[Content] = +[Removal] = 0:9-0:12 + >---< +0| function foo() end + +[Leading delimiter] = 0:8-0:9 + >-< +0| function foo() end + +[Domain] = 0:0-0:18 + >------------------< +0| function foo() end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.iteration.block.scope b/data/fixtures/scopes/lua/name/name.iteration.block.scope new file mode 100644 index 0000000000..9382af767e --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.iteration.block.scope @@ -0,0 +1,18 @@ +function foo() + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >-------------- +0| function foo() +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/name/name.iteration.block2.scope b/data/fixtures/scopes/lua/name/name.iteration.block2.scope new file mode 100644 index 0000000000..c627e87b08 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.iteration.block2.scope @@ -0,0 +1,18 @@ +if true then + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------ +0| if true then +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/name/name.iteration.block3.scope b/data/fixtures/scopes/lua/name/name.iteration.block3.scope new file mode 100644 index 0000000000..4361064ad9 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.iteration.block3.scope @@ -0,0 +1,18 @@ +while true do + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------- +0| while true do +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/name/name.iteration.document.scope b/data/fixtures/scopes/lua/name/name.iteration.document.scope new file mode 100644 index 0000000000..75c1a591fb --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.iteration.document.scope @@ -0,0 +1,12 @@ + +foo = 0 + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo = 0 +2| + < diff --git a/data/fixtures/scopes/lua/name/name.method.scope b/data/fixtures/scopes/lua/name/name.method.scope new file mode 100644 index 0000000000..9d0368d006 --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.method.scope @@ -0,0 +1,17 @@ +function foo:bar() end +--- + +[Content] = +[Removal] = 0:9-0:16 + >-------< +0| function foo:bar() end + +[Leading delimiter] = 0:8-0:9 + >-< +0| function foo:bar() end + +[Domain] = 0:0-0:22 + >----------------------< +0| function foo:bar() end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name/name.variable.pattern.scope b/data/fixtures/scopes/lua/name/name.variable.pattern.scope new file mode 100644 index 0000000000..884844aa5c --- /dev/null +++ b/data/fixtures/scopes/lua/name/name.variable.pattern.scope @@ -0,0 +1,24 @@ +local foo, bar = bar +--- + +[Content] = 0:6-0:14 + >--------< +0| local foo, bar = bar + +[Removal] = 0:0-0:17 + >-----------------< +0| local foo, bar = bar + +[Leading delimiter] = 0:5-0:6 + >-< +0| local foo, bar = bar + +[Trailing delimiter] = 0:14-0:15 + >-< +0| local foo, bar = bar + +[Domain] = 0:0-0:20 + >--------------------< +0| local foo, bar = bar + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/name.variable.scope b/data/fixtures/scopes/lua/name/name.variable.scope similarity index 100% rename from data/fixtures/scopes/lua/name.variable.scope rename to data/fixtures/scopes/lua/name/name.variable.scope diff --git a/data/fixtures/scopes/lua/name.variable2.scope b/data/fixtures/scopes/lua/name/name.variable2.scope similarity index 100% rename from data/fixtures/scopes/lua/name.variable2.scope rename to data/fixtures/scopes/lua/name/name.variable2.scope diff --git a/data/fixtures/scopes/lua/namedFunction.iteration.document.scope b/data/fixtures/scopes/lua/namedFunction.iteration.document.scope new file mode 100644 index 0000000000..d6a2b95773 --- /dev/null +++ b/data/fixtures/scopes/lua/namedFunction.iteration.document.scope @@ -0,0 +1,12 @@ + +function foo() end + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| function foo() end +2| + < diff --git a/data/fixtures/scopes/lua/namedFunction.method.scope b/data/fixtures/scopes/lua/namedFunction.method.scope new file mode 100644 index 0000000000..912b59bb66 --- /dev/null +++ b/data/fixtures/scopes/lua/namedFunction.method.scope @@ -0,0 +1,10 @@ +function foo:bar() end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| function foo:bar() end + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/lua/namedFunction.scope b/data/fixtures/scopes/lua/namedFunction.scope index 51b1d2134a..b8fb7a6173 100644 --- a/data/fixtures/scopes/lua/namedFunction.scope +++ b/data/fixtures/scopes/lua/namedFunction.scope @@ -1,15 +1,10 @@ -function foo() - bar = 0 -end +function foo() end --- [Content] = [Removal] = -[Domain] = 0:0-2:3 - >-------------- -0| function foo() -1| bar = 0 -2| end - ---< +[Domain] = 0:0-0:18 + >------------------< +0| function foo() end [Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/lua/statement/statement.assignment.scope b/data/fixtures/scopes/lua/statement/statement.assignment.scope new file mode 100644 index 0000000000..acdb2b1498 --- /dev/null +++ b/data/fixtures/scopes/lua/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/lua/statement/statement.break.scope b/data/fixtures/scopes/lua/statement/statement.break.scope new file mode 100644 index 0000000000..a13d9919ed --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.break.scope @@ -0,0 +1,33 @@ +while true do + break +end +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:3 + >------------- +0| while true do +1| break +2| end + ---< + +[#1 Insertion delimiter] = "\n" + + +[#2 Content] = +[#2 Domain] = 1:2-1:7 + >-----< +1| break + +[#2 Removal] = 1:0-2:0 + >------- +1| break +2| end + < + +[#2 Leading delimiter] = 1:0-1:2 + >--< +1| break + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.doWhile.scope b/data/fixtures/scopes/lua/statement/statement.doWhile.scope new file mode 100644 index 0000000000..04ecfa43ea --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.doWhile.scope @@ -0,0 +1,10 @@ +repeat until true +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| repeat until true + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.for.scope b/data/fixtures/scopes/lua/statement/statement.for.scope new file mode 100644 index 0000000000..f0ba0b3f78 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.for.scope @@ -0,0 +1,10 @@ +for i = 1, 3 do end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| for i = 1, 3 do end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.foreach.scope b/data/fixtures/scopes/lua/statement/statement.foreach.scope new file mode 100644 index 0000000000..a845f78e8b --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.foreach.scope @@ -0,0 +1,10 @@ +for v in values do end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| for v in values do end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.function.scope b/data/fixtures/scopes/lua/statement/statement.function.scope new file mode 100644 index 0000000000..4209c3b4bf --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.function.scope @@ -0,0 +1,10 @@ +function foo() end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:18 + >------------------< +0| function foo() end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement.if.scope b/data/fixtures/scopes/lua/statement/statement.if.scope similarity index 100% rename from data/fixtures/scopes/lua/statement.if.scope rename to data/fixtures/scopes/lua/statement/statement.if.scope diff --git a/data/fixtures/scopes/lua/statement/statement.iteration.block.scope b/data/fixtures/scopes/lua/statement/statement.iteration.block.scope new file mode 100644 index 0000000000..9382af767e --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.iteration.block.scope @@ -0,0 +1,18 @@ +function foo() + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >-------------- +0| function foo() +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/statement/statement.iteration.block2.scope b/data/fixtures/scopes/lua/statement/statement.iteration.block2.scope new file mode 100644 index 0000000000..c627e87b08 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.iteration.block2.scope @@ -0,0 +1,18 @@ +if true then + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------ +0| if true then +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/statement/statement.iteration.block3.scope b/data/fixtures/scopes/lua/statement/statement.iteration.block3.scope new file mode 100644 index 0000000000..4361064ad9 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.iteration.block3.scope @@ -0,0 +1,18 @@ +while true do + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------- +0| while true do +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/statement/statement.iteration.document.scope b/data/fixtures/scopes/lua/statement/statement.iteration.document.scope new file mode 100644 index 0000000000..75c1a591fb --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.iteration.document.scope @@ -0,0 +1,12 @@ + +foo = 0 + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo = 0 +2| + < diff --git a/data/fixtures/scopes/lua/statement/statement.method.scope b/data/fixtures/scopes/lua/statement/statement.method.scope new file mode 100644 index 0000000000..36af71ba18 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.method.scope @@ -0,0 +1,10 @@ +function foo:bar() end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:22 + >----------------------< +0| function foo:bar() end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.return.scope b/data/fixtures/scopes/lua/statement/statement.return.scope new file mode 100644 index 0000000000..80f16124a6 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.return.scope @@ -0,0 +1,33 @@ +function foo() + return 0 +end +--- + +[#1 Content] = +[#1 Removal] = +[#1 Domain] = 0:0-2:3 + >-------------- +0| function foo() +1| return 0 +2| end + ---< + +[#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| end + < + +[#2 Leading delimiter] = 1:0-1:4 + >----< +1| return 0 + +[#2 Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.variable.scope b/data/fixtures/scopes/lua/statement/statement.variable.scope new file mode 100644 index 0000000000..d585df01cb --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.variable.scope @@ -0,0 +1,10 @@ +local foo = 0 +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:13 + >-------------< +0| local foo = 0 + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/statement/statement.while.scope b/data/fixtures/scopes/lua/statement/statement.while.scope new file mode 100644 index 0000000000..beae88feb2 --- /dev/null +++ b/data/fixtures/scopes/lua/statement/statement.while.scope @@ -0,0 +1,10 @@ +while true do end +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:17 + >-----------------< +0| while true do end + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/lua/string.multiLine.scope b/data/fixtures/scopes/lua/string.multiLine.scope new file mode 100644 index 0000000000..b20b68b711 --- /dev/null +++ b/data/fixtures/scopes/lua/string.multiLine.scope @@ -0,0 +1,22 @@ +foo = [[Hello +world]] +--- + +[Content] = +[Domain] = 0:6-1:7 + >------- +0| foo = [[Hello +1| world]] + -------< + +[Removal] = 0:5-1:7 + >-------- +0| foo = [[Hello +1| world]] + -------< + +[Leading delimiter] = 0:5-0:6 + >-< +0| foo = [[Hello + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/string.singleLine.scope b/data/fixtures/scopes/lua/string.singleLine.scope new file mode 100644 index 0000000000..9859e5fcc8 --- /dev/null +++ b/data/fixtures/scopes/lua/string.singleLine.scope @@ -0,0 +1,17 @@ +foo = "Hello world" +--- + +[Content] = +[Domain] = 0:6-0:19 + >-------------< +0| foo = "Hello world" + +[Removal] = 0:5-0:19 + >--------------< +0| foo = "Hello world" + +[Leading delimiter] = 0:5-0:6 + >-< +0| foo = "Hello world" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/textFragment.comment.block.scope b/data/fixtures/scopes/lua/textFragment.comment.block.scope new file mode 100644 index 0000000000..6295b3fb1c --- /dev/null +++ b/data/fixtures/scopes/lua/textFragment.comment.block.scope @@ -0,0 +1,10 @@ +--[[ Hello world ]] +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:19 + >-------------------< +0| --[[ Hello world ]] + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/textFragment.comment.line.scope b/data/fixtures/scopes/lua/textFragment.comment.line.scope new file mode 100644 index 0000000000..2b0f8e41f4 --- /dev/null +++ b/data/fixtures/scopes/lua/textFragment.comment.line.scope @@ -0,0 +1,10 @@ +-- Hello world +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:15 + >---------------< +0| -- Hello world + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/textFragment.string.multiLine.scope b/data/fixtures/scopes/lua/textFragment.string.multiLine.scope new file mode 100644 index 0000000000..b1f6e2dce5 --- /dev/null +++ b/data/fixtures/scopes/lua/textFragment.string.multiLine.scope @@ -0,0 +1,13 @@ +foo = [[Hello +world]] +--- + +[Content] = +[Removal] = +[Domain] = 0:8-1:5 + >----- +0| foo = [[Hello +1| world]] + -----< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/textFragment.string.singleLine.scope b/data/fixtures/scopes/lua/textFragment.string.singleLine.scope new file mode 100644 index 0000000000..5eeea4b6b4 --- /dev/null +++ b/data/fixtures/scopes/lua/textFragment.string.singleLine.scope @@ -0,0 +1,10 @@ +foo = "Hello world" +--- + +[Content] = +[Removal] = +[Domain] = 0:7-0:18 + >-----------< +0| foo = "Hello world" + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/value.assignment.scope b/data/fixtures/scopes/lua/value/value.assignment.scope similarity index 100% rename from data/fixtures/scopes/lua/value.assignment.scope rename to data/fixtures/scopes/lua/value/value.assignment.scope diff --git a/data/fixtures/scopes/lua/value.assignment2.scope b/data/fixtures/scopes/lua/value/value.assignment2.scope similarity index 100% rename from data/fixtures/scopes/lua/value.assignment2.scope rename to data/fixtures/scopes/lua/value/value.assignment2.scope diff --git a/data/fixtures/scopes/lua/value/value.foreach.scope b/data/fixtures/scopes/lua/value/value.foreach.scope new file mode 100644 index 0000000000..5a595c8af6 --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.foreach.scope @@ -0,0 +1,24 @@ +for v in values do end +--- + +[Content] = 0:9-0:15 + >------< +0| for v in values do end + +[Removal] = 0:9-0:16 + >-------< +0| for v in values do end + +[Leading delimiter] = 0:8-0:9 + >-< +0| for v in values do end + +[Trailing delimiter] = 0:15-0:16 + >-< +0| for v in values do end + +[Domain] = 0:0-0:22 + >----------------------< +0| for v in values do end + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/value/value.iteration.block.scope b/data/fixtures/scopes/lua/value/value.iteration.block.scope new file mode 100644 index 0000000000..9382af767e --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.iteration.block.scope @@ -0,0 +1,18 @@ +function foo() + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >-------------- +0| function foo() +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/value/value.iteration.block2.scope b/data/fixtures/scopes/lua/value/value.iteration.block2.scope new file mode 100644 index 0000000000..c627e87b08 --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.iteration.block2.scope @@ -0,0 +1,18 @@ +if true then + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------ +0| if true then +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/value/value.iteration.block3.scope b/data/fixtures/scopes/lua/value/value.iteration.block3.scope new file mode 100644 index 0000000000..4361064ad9 --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.iteration.block3.scope @@ -0,0 +1,18 @@ +while true do + a = 0 +end +--- + +[#1 Content] = +[#1 Domain] = 0:0-2:3 + >------------- +0| while true do +1| a = 0 +2| end + ---< + + +[#2 Content] = +[#2 Domain] = 1:4-1:9 + >-----< +1| a = 0 diff --git a/data/fixtures/scopes/lua/value/value.iteration.document.scope b/data/fixtures/scopes/lua/value/value.iteration.document.scope new file mode 100644 index 0000000000..75c1a591fb --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.iteration.document.scope @@ -0,0 +1,12 @@ + +foo = 0 + +--- + +[Content] = +[Domain] = 0:0-2:0 + > +0| +1| foo = 0 +2| + < diff --git a/data/fixtures/scopes/lua/value/value.mapPair.iteration.scope b/data/fixtures/scopes/lua/value/value.mapPair.iteration.scope new file mode 100644 index 0000000000..2d135e190f --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.mapPair.iteration.scope @@ -0,0 +1,13 @@ +{ aaa = 1, bbb = 2 } +--- + +[#1 Content] = +[#1 Domain] = 0:0-0:20 + >--------------------< +0| { aaa = 1, bbb = 2 } + + +[#2 Content] = +[#2 Domain] = 0:1-0:19 + >------------------< +0| { aaa = 1, bbb = 2 } diff --git a/data/fixtures/scopes/lua/value/value.mapPair.scope b/data/fixtures/scopes/lua/value/value.mapPair.scope new file mode 100644 index 0000000000..5d472ece27 --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.mapPair.scope @@ -0,0 +1,39 @@ +{ aaa = 1, bbb = 2 } +--- + +[#1 Content] = 0:8-0:9 + >-< +0| { aaa = 1, bbb = 2 } + +[#1 Removal] = 0:5-0:9 + >----< +0| { aaa = 1, bbb = 2 } + +[#1 Leading delimiter] = 0:5-0:8 + >---< +0| { aaa = 1, bbb = 2 } + +[#1 Domain] = 0:2-0:9 + >-------< +0| { aaa = 1, bbb = 2 } + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:17-0:18 + >-< +0| { aaa = 1, bbb = 2 } + +[#2 Removal] = 0:14-0:18 + >----< +0| { aaa = 1, bbb = 2 } + +[#2 Leading delimiter] = 0:14-0:17 + >---< +0| { aaa = 1, bbb = 2 } + +[#2 Domain] = 0:11-0:18 + >-------< +0| { aaa = 1, bbb = 2 } + +[#2 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/value/value.return.scope b/data/fixtures/scopes/lua/value/value.return.scope new file mode 100644 index 0000000000..6f2ce86eb8 --- /dev/null +++ b/data/fixtures/scopes/lua/value/value.return.scope @@ -0,0 +1,22 @@ +function foo() + return 0 +end +--- + +[Content] = 1:9-1:10 + >-< +1| return 0 + +[Removal] = 1:8-1:10 + >--< +1| return 0 + +[Leading delimiter] = 1:8-1:9 + >-< +1| return 0 + +[Domain] = 1:2-1:10 + >--------< +1| return 0 + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/lua/value.variable.scope b/data/fixtures/scopes/lua/value/value.variable.scope similarity index 100% rename from data/fixtures/scopes/lua/value.variable.scope rename to data/fixtures/scopes/lua/value/value.variable.scope diff --git a/data/fixtures/scopes/lua/value.variable2.scope b/data/fixtures/scopes/lua/value/value.variable2.scope similarity index 100% rename from data/fixtures/scopes/lua/value.variable2.scope rename to data/fixtures/scopes/lua/value/value.variable2.scope diff --git a/data/fixtures/scopes/python/value/value.variable.pattern.scope b/data/fixtures/scopes/python/value/value.variable.pattern.scope deleted file mode 100644 index b9c54f457f..0000000000 --- a/data/fixtures/scopes/python/value/value.variable.pattern.scope +++ /dev/null @@ -1,20 +0,0 @@ -foo, bar = bar ---- - -[Content] = 0:11-0:14 - >---< -0| foo, bar = bar - -[Removal] = 0:8-0:14 - >------< -0| foo, bar = bar - -[Leading delimiter] = 0:8-0:11 - >---< -0| foo, bar = bar - -[Domain] = 0:0-0:14 - >--------------< -0| foo, bar = bar - -[Insertion delimiter] = " " diff --git a/packages/common/src/scopeSupportFacets/lua.ts b/packages/common/src/scopeSupportFacets/lua.ts index 2101dc2f5c..523789d289 100644 --- a/packages/common/src/scopeSupportFacets/lua.ts +++ b/packages/common/src/scopeSupportFacets/lua.ts @@ -1,17 +1,18 @@ import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; -const { supported, notApplicable } = ScopeSupportFacetLevel; +const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; export const luaScopeSupport: LanguageScopeSupportFacetMap = { - tags: notApplicable, - map: supported, - namedFunction: supported, disqualifyDelimiter: supported, - + list: supported, + map: supported, ifStatement: supported, + anonymousFunction: supported, - "statement.if": supported, + namedFunction: supported, + "namedFunction.method": supported, + "namedFunction.iteration.document": supported, functionCall: supported, "functionCall.method": supported, @@ -20,21 +21,298 @@ export const luaScopeSupport: LanguageScopeSupportFacetMap = { "functionCallee.method": supported, "functionCallee.chain": supported, - "key.attribute": notApplicable, + "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, "name.assignment": supported, + "name.assignment.pattern": supported, + "name.argument.formal": supported, + "name.argument.formal.iteration": supported, + "name.argument.formal.method": supported, + "name.argument.formal.method.iteration": supported, + "name.foreach": supported, + "name.function": supported, + "name.method": supported, "name.variable": supported, + "name.variable.pattern": supported, + "name.iteration.block": supported, + "name.iteration.document": supported, "value.assignment": supported, + "value.foreach": supported, + "value.return": supported, "value.variable": supported, + "value.iteration.block": supported, + "value.iteration.document": supported, + + "key.mapPair": supported, + "key.mapPair.iteration": supported, + "value.mapPair": supported, + "value.mapPair.iteration": supported, "branch.if": supported, "branch.if.elif.else": supported, "branch.if.else": supported, "branch.if.iteration": supported, + "collectionItem.unenclosed.singleLine": supported, + "collectionItem.unenclosed.multiLine": supported, + "collectionItem.unenclosed.iteration": supported, + + "comment.block": supported, + "comment.line": supported, + "condition.if": supported, + "condition.while": supported, + "condition.doWhile": supported, + "condition.for": supported, + + "statement.function": supported, + "statement.method": supported, + "statement.if": supported, + "statement.while": supported, + "statement.doWhile": supported, + "statement.for": supported, + "statement.foreach": supported, + "statement.variable": supported, + "statement.assignment": supported, + "statement.return": supported, + "statement.break": supported, + "statement.iteration.document": supported, + "statement.iteration.block": supported, + + "string.singleLine": supported, + "string.multiLine": supported, + + "textFragment.comment.block": supported, + "textFragment.comment.line": supported, + "textFragment.string.singleLine": supported, + "textFragment.string.multiLine": supported, "interior.function": supported, + "interior.method": supported, + "interior.lambda": supported, "interior.if": supported, + "interior.while": supported, + "interior.doWhile": supported, + "interior.for": supported, + "interior.foreach": supported, + + /* UNSUPPORTED */ + + fieldAccess: unsupported, + + /* NOT APPLICABLE */ + + // Constructors + "namedFunction.constructor": notApplicable, + "statement.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.argument.formal.constructor": notApplicable, + "name.argument.formal.constructor.iteration": notApplicable, + "name.constructor": 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, + + // Class + class: notApplicable, + "class.iteration.document": notApplicable, + "class.iteration.block": notApplicable, + "statement.class": notApplicable, + "statement.field.class": notApplicable, + "statement.continue": notApplicable, + "name.class": notApplicable, + "name.field.class": notApplicable, + "name.iteration.class": notApplicable, + "type.class": notApplicable, + "type.field.class": notApplicable, + "interior.class": notApplicable, + "statement.iteration.class": notApplicable, + "namedFunction.iteration.class": notApplicable, + + // Interface + "statement.interface": notApplicable, + "statement.field.interface": notApplicable, + "name.interface": notApplicable, + "name.field.interface": notApplicable, + "name.iteration.interface": notApplicable, + "type.interface": notApplicable, + "type.field.interface": notApplicable, + "interior.interface": notApplicable, + "statement.iteration.interface": notApplicable, + + // Enum + "statement.enum": notApplicable, + "name.enum": notApplicable, + "name.field.enum": notApplicable, + "name.iteration.enum": notApplicable, + "type.enum": notApplicable, + "interior.enum": notApplicable, + + // Types and type annotations + "type.argument.formal": notApplicable, + "type.argument.formal.iteration": notApplicable, + "type.argument.formal.method": notApplicable, + "type.argument.formal.method.iteration": notApplicable, + "type.argument.catch": notApplicable, + "type.return": notApplicable, + "type.variable": notApplicable, + "type.typeArgument": notApplicable, + "type.typeArgument.iteration": notApplicable, + "type.alias": notApplicable, + "type.cast": notApplicable, + "type.foreach": notApplicable, + "type.iteration.block": notApplicable, + "type.iteration.class": notApplicable, + "type.iteration.interface": notApplicable, + "type.iteration.document": notApplicable, + + // Element and tags + element: notApplicable, + tags: notApplicable, + startTag: notApplicable, + endTag: notApplicable, + "interior.element": notApplicable, + "textFragment.element": notApplicable, + 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, + + // 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, + + // Keyword argument + "name.argument.actual": notApplicable, + "name.argument.actual.iteration": notApplicable, + "value.argument.actual": notApplicable, + "value.argument.actual.iteration": notApplicable, + + // Default argument value + "value.argument.formal": notApplicable, + "value.argument.formal.iteration": notApplicable, + "value.argument.formal.method": notApplicable, + "value.argument.formal.method.iteration": notApplicable, + "value.typeAlias": notApplicable, + "value.switch": notApplicable, + "value.field.class": notApplicable, + "value.field.enum": notApplicable, + "value.iteration.class": notApplicable, + "value.iteration.enum": notApplicable, + + // Try / catch + "statement.try": notApplicable, + "branch.try": notApplicable, + "branch.try.iteration": notApplicable, + "interior.try": notApplicable, + "argument.catch": notApplicable, + "name.argument.catch": notApplicable, + + // Switch + "statement.switch": notApplicable, + "branch.switchCase": notApplicable, + "branch.switchCase.iteration": notApplicable, + "condition.switchCase": notApplicable, + "condition.switchCase.iteration": notApplicable, + "interior.switch": notApplicable, + "interior.switchCase": notApplicable, + + // Ternary + "branch.ternary": notApplicable, + "branch.ternary.iteration": notApplicable, + "condition.ternary": notApplicable, + + // Loop branches + "branch.loop": notApplicable, + "branch.loop.iteration": notApplicable, + + // Yield + "statement.yield": notApplicable, + "value.yield": notApplicable, + "value.return.lambda": notApplicable, + + // Namespace + "statement.namespace": notApplicable, + "name.namespace": notApplicable, + "interior.namespace": notApplicable, + + // Static + "statement.static": notApplicable, + "interior.static": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, + + // Miscellaneous + "statement.misc": notApplicable, + "value.variable.pattern": notApplicable, + pairDelimiter: notApplicable, + environment: notApplicable, + regularExpression: notApplicable, + selector: notApplicable, + unit: notApplicable, }; diff --git a/packages/common/src/scopeSupportFacets/python.ts b/packages/common/src/scopeSupportFacets/python.ts index c624909643..55d02c0a91 100644 --- a/packages/common/src/scopeSupportFacets/python.ts +++ b/packages/common/src/scopeSupportFacets/python.ts @@ -48,7 +48,6 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { "value.return": supported, "value.return.lambda": supported, "value.variable": supported, - "value.variable.pattern": supported, "value.switch": supported, "value.iteration.block": supported, "value.iteration.class": supported, @@ -304,6 +303,7 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { // Miscellaneous "statement.misc": notApplicable, + "value.variable.pattern": notApplicable, environment: notApplicable, regularExpression: notApplicable, selector: notApplicable, diff --git a/queries/lua.scm b/queries/lua.scm index 3a11e70ec0..60ece77c99 100644 --- a/queries/lua.scm +++ b/queries/lua.scm @@ -24,16 +24,6 @@ ] @statement (#not-parent-type? @statement expression_list) ) -[ - (block) - (chunk) -] @statement.iteration @namedFunction.iteration @functionCall.iteration - -;; Duplicate above due to 3 label node limit -[ - (block) - (chunk) -] @ifStatement.iteration @value.iteration @name.iteration ;; Capture assignment only if without variable prefix ;;!! count = count + 1 @@ -43,6 +33,22 @@ (#not-parent-type? @statement variable_declaration) ) +;; Document iteration scopes + +( + (chunk) @statement.iteration @namedFunction.iteration + (#document-range! @statement.iteration @namedFunction.iteration) +) +( + (chunk) @name.iteration @value.iteration + (#document-range! @name.iteration @value.iteration) +) + +;; Block iteration scopes + +(block) @statement.iteration @namedFunction.iteration +(block) @name.iteration @value.iteration + ;; Conditionals ;;!! if true then end @@ -116,7 +122,9 @@ ;;! ^^^^ (while_statement condition: (_) @condition -) @_.domain + "do" @interior.start.endOf + "end" @interior.end.startOf +) @condition.domain ;;!! repeat ;;!! ... @@ -124,9 +132,30 @@ ;;! ^^^^^ ;;! xxxxx (repeat_statement + "repeat" @interior.start.endOf + "until" @interior.end.startOf condition: (_) @condition +) @condition.domain + +;;!! for i = 1, 3 do end +;;! ^^^^^^^^ +(for_statement + (for_numeric_clause) @condition +) @condition.domain + +;;!! for v in values do end +(for_statement + (for_generic_clause + (variable_list) @name + (expression_list) @value + ) ) @_.domain +(for_statement + "do" @interior.start.endOf + "end" @interior.end.startOf +) + ;; Lists and maps (table_constructor (field @@ -181,47 +210,55 @@ name: (_) @functionCallee ) @_.domain @functionCall -;;!!local sum = add(5, 7) -;;! ^--- -;;! xxx- +;;!! local sum = add(5, 7) +;;! ^--- +;;! xxx- ( (arguments - (_)? @_.leading.endOf + (_)? @argumentOrParameter.leading.endOf . (_) @argumentOrParameter . - (_)? @_.trailing.startOf + (_)? @argumentOrParameter.trailing.startOf ) @_dummy (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n") ) -;;!!local sum = add(5, 7) -;;! **** -(arguments - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf -) - -;;!!function add(5, 7) -;;! ^--- -;;! xxx- +;;!! local sum = add(5, 7) +;;! **** +(function_call + (arguments + "(" @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 + +;;!! function add(5, 7) +;;! ^--- +;;! xxx- ( (parameters - (_)? @_.leading.endOf + (_)? @argumentOrParameter.leading.endOf . - (_) @argumentOrParameter + (_) @argumentOrParameter @name . - (_)? @_.trailing.startOf + (_)? @argumentOrParameter.trailing.startOf ) @_dummy (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n") ) -;;!!function add(5, 7) -;;! **** -(parameters - "(" @argumentOrParameter.iteration.start.endOf - ")" @argumentOrParameter.iteration.end.startOf -) +;;!! function add(5, 7) +;;! **** +(_ + (parameters + "(" @argumentList.removal.start.endOf @argumentOrParameter.iteration.start.endOf @name.iteration.start.endOf + ")" @argumentList.removal.end.startOf @argumentOrParameter.iteration.end.startOf @name.iteration.end.startOf + ) @argumentList + (#empty-single-multi-delimiter! @argumentList @argumentList "" ", " ",\n") + (#child-range! @argumentList 1 -2) +) @argumentList.domain @argumentOrParameter.iteration.domain ;; funk name: ;;!! function add(x, b) return x + y end @@ -315,9 +352,34 @@ local_declaration: (variable_declaration ) ) -;; Structures and object access +;;!! local a, b, c +( + (variable_list + (_)? @collectionItem.leading.endOf + . + (_) @collectionItem + . + (_)? @collectionItem.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") +) + +;;!! = 1, 2, 3 +( + (expression_list + (_)? @collectionItem.leading.endOf + . + (_) @collectionItem + . + (_)? @collectionItem.trailing.startOf + ) @_dummy + (#single-or-multi-line-delimiter! @collectionItem @_dummy ", " ",\n") +) -;; (method_index_expression) @private.fieldAccess +[ + (variable_list) + (expression_list) +] @collectionItem.iteration (binary_expression [