Skip to content

Commit 9b32040

Browse files
lua
1 parent 0e1dbeb commit 9b32040

File tree

9 files changed

+276
-106
lines changed

9 files changed

+276
-106
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
if true then
2+
a = 1
3+
elseif false then
4+
a = 2
5+
else
6+
a = 3
7+
end
8+
---
9+
10+
[#1 Content] =
11+
[#1 Domain] = 0:0-1:9
12+
>------------
13+
0| if true then
14+
1| a = 1
15+
---------<
16+
17+
[#1 Removal] = 0:0-2:4
18+
>------------
19+
0| if true then
20+
1| a = 1
21+
2| elseif false then
22+
----<
23+
24+
[#1 Insertion delimiter] = "\n"
25+
26+
27+
[#2 Content] =
28+
[#2 Domain] = 2:0-3:9
29+
>-----------------
30+
2| elseif false then
31+
3| a = 2
32+
---------<
33+
34+
[#2 Removal] = 2:0-4:0
35+
>-----------------
36+
2| elseif false then
37+
3| a = 2
38+
4| else
39+
<
40+
41+
[#2 Insertion delimiter] = "\n"
42+
43+
44+
[#3 Content] =
45+
[#3 Domain] = 4:0-5:9
46+
>----
47+
4| else
48+
5| a = 3
49+
---------<
50+
51+
[#3 Removal] = 4:0-6:0
52+
>----
53+
4| else
54+
5| a = 3
55+
6| end
56+
<
57+
58+
[#3 Insertion delimiter] = "\n"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
if true then
2+
a = 1
3+
else
4+
a = 2
5+
end
6+
---
7+
8+
[#1 Content] =
9+
[#1 Domain] = 0:0-1:9
10+
>------------
11+
0| if true then
12+
1| a = 1
13+
---------<
14+
15+
[#1 Removal] = 0:0-2:0
16+
>------------
17+
0| if true then
18+
1| a = 1
19+
2| else
20+
<
21+
22+
[#1 Insertion delimiter] = "\n"
23+
24+
25+
[#2 Content] =
26+
[#2 Domain] = 2:0-3:9
27+
>----
28+
2| else
29+
3| a = 2
30+
---------<
31+
32+
[#2 Removal] = 2:0-4:0
33+
>----
34+
2| else
35+
3| a = 2
36+
4| end
37+
<
38+
39+
[#2 Insertion delimiter] = "\n"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if true then
2+
a = 1
3+
elseif false then
4+
a = 2
5+
else
6+
a = 3
7+
end
8+
---
9+
10+
[Range] =
11+
[Domain] = 0:0-6:3
12+
>------------
13+
0| if true then
14+
1| a = 1
15+
2| elseif false then
16+
3| a = 2
17+
4| else
18+
5| a = 3
19+
6| end
20+
---<
Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,20 @@
1-
if x < y then
2-
print("x is less than y")
3-
elseif x > y then
4-
print("x is greater than y")
5-
else
6-
print("x is equal to y")
1+
if true then
2+
a = 1
73
end
84
---
95

10-
[#1 Content] =
11-
[#1 Domain] = 0:0-1:29
12-
>-------------
13-
0| if x < y then
14-
1| print("x is less than y")
15-
-----------------------------<
16-
17-
[#1 Removal] = 0:0-2:0
18-
>-------------
19-
0| if x < y then
20-
1| print("x is less than y")
21-
2| elseif x > y then
22-
<
23-
24-
[#1 Insertion delimiter] = "\n"
25-
26-
27-
[#2 Content] =
28-
[#2 Domain] = 2:0-3:32
29-
>-----------------
30-
2| elseif x > y then
31-
3| print("x is greater than y")
32-
--------------------------------<
33-
34-
[#2 Removal] = 2:0-4:0
35-
>-----------------
36-
2| elseif x > y then
37-
3| print("x is greater than y")
38-
4| else
39-
<
40-
41-
[#2 Insertion delimiter] = "\n"
42-
43-
44-
[#3 Content] =
45-
[#3 Domain] = 4:0-5:28
46-
>----
47-
4| else
48-
5| print("x is equal to y")
49-
----------------------------<
50-
51-
[#3 Removal] = 4:0-6:0
52-
>----
53-
4| else
54-
5| print("x is equal to y")
55-
6| end
56-
<
57-
58-
[#3 Insertion delimiter] = "\n"
6+
[Content] =
7+
[Domain] = 0:0-1:9
8+
>------------
9+
0| if true then
10+
1| a = 1
11+
---------<
12+
13+
[Removal] = 0:0-2:3
14+
>------------
15+
0| if true then
16+
1| a = 1
17+
2| end
18+
---<
19+
20+
[Insertion delimiter] = "\n"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
if true then
2+
a = 1
3+
elseif false then
4+
a = 1
5+
else
6+
a = 1
7+
end
8+
---
9+
10+
[#1 Content] = 0:3-0:7
11+
>----<
12+
0| if true then
13+
14+
[#1 Removal] = 0:3-0:8
15+
>-----<
16+
0| if true then
17+
18+
[#1 Leading delimiter] = 0:2-0:3
19+
>-<
20+
0| if true then
21+
22+
[#1 Trailing delimiter] = 0:7-0:8
23+
>-<
24+
0| if true then
25+
26+
[#1 Domain] = 0:0-6:3
27+
>------------
28+
0| if true then
29+
1| a = 1
30+
2| elseif false then
31+
3| a = 1
32+
4| else
33+
5| a = 1
34+
6| end
35+
---<
36+
37+
[#1 Insertion delimiter] = " "
38+
39+
40+
[#2 Content] = 2:7-2:12
41+
>-----<
42+
2| elseif false then
43+
44+
[#2 Removal] = 2:7-2:13
45+
>------<
46+
2| elseif false then
47+
48+
[#2 Leading delimiter] = 2:6-2:7
49+
>-<
50+
2| elseif false then
51+
52+
[#2 Trailing delimiter] = 2:12-2:13
53+
>-<
54+
2| elseif false then
55+
56+
[#2 Domain] = 2:0-3:9
57+
>-----------------
58+
2| elseif false then
59+
3| a = 1
60+
---------<
61+
62+
[#2 Insertion delimiter] = " "
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
if true then
2+
a = 1
3+
elseif false then
4+
a = 1
5+
else
6+
a = 1
7+
end
8+
---
9+
10+
[Content] =
11+
[Removal] =
12+
[Domain] = 0:0-6:3
13+
>------------
14+
0| if true then
15+
1| a = 1
16+
2| elseif false then
17+
3| a = 1
18+
4| else
19+
5| a = 1
20+
6| end
21+
---<
22+
23+
[Insertion delimiter] = "\n"

packages/common/src/scopeSupportFacets/lua.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";
44
const { supported, notApplicable } = ScopeSupportFacetLevel;
55

66
export const luaScopeSupport: LanguageScopeSupportFacetMap = {
7-
"key.attribute": notApplicable,
87
tags: notApplicable,
8+
functionCallee: supported,
9+
map: supported,
10+
ifStatement: supported,
11+
namedFunction: supported,
12+
disqualifyDelimiter: supported,
13+
14+
"key.attribute": notApplicable,
15+
916
"name.assignment": supported,
1017
"name.variable": supported,
18+
1119
"value.assignment": supported,
1220
"value.variable": supported,
13-
functionCallee: supported,
14-
map: supported,
21+
1522
"branch.if": supported,
1623
"branch.if.elif.else": supported,
1724
"branch.if.else": supported,
1825
"branch.if.iteration": supported,
19-
namedFunction: supported,
20-
disqualifyDelimiter: supported,
26+
27+
"condition.if": supported,
28+
2129
"interior.function": supported,
2230
"interior.if": supported,
2331
};

0 commit comments

Comments
 (0)