alpha
Login
or
Join now
nandi.uk
/
gleam
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Fork of daniellemaywood.uk/gleam — Wasm codegen work
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Add tests for renaming from imports
author
Gavin Morrow
committer
Louis Pilfold
date
2 weeks ago
(Jul 9, 2026, 6:07 PM +0100)
commit
7fe81fb7
7fe81fb72be90f7aaf63ca068e6440975fdd2212
parent
a5a3616b
a5a3616bee6408b80ea5d801ac2ca1acfc615896
change-id
mwovoqrp
mwovoqrppxttvnkusypzqtytskzysxln
+765
13 changed files
Expand all
Collapse all
Unified
Split
language-server
src
tests
rename.rs
snapshots
gleam_language_server__tests__rename__rename_constant_from_aliased_import.snap
gleam_language_server__tests__rename__rename_constant_from_aliased_import_to_original_name.snap
gleam_language_server__tests__rename__rename_constant_from_import.snap
gleam_language_server__tests__rename__rename_function_from_aliased_import.snap
gleam_language_server__tests__rename__rename_function_from_aliased_import_to_original_name.snap
gleam_language_server__tests__rename__rename_function_from_import.snap
gleam_language_server__tests__rename__rename_type_from_aliased_import.snap
gleam_language_server__tests__rename__rename_type_from_aliased_import_to_original_name.snap
gleam_language_server__tests__rename__rename_type_from_import.snap
gleam_language_server__tests__rename__rename_type_variant_from_aliased_import.snap
gleam_language_server__tests__rename__rename_type_variant_from_aliased_import_to_original_name.snap
gleam_language_server__tests__rename__rename_type_variant_from_import.snap
+291
language-server/src/tests/rename.rs
View file
Reviewed
···
601
601
}
602
602
603
603
#[test]
604
604
+
fn rename_function_from_import() {
605
605
+
assert_rename!(
606
606
+
(
607
607
+
"mod",
608
608
+
"
609
609
+
pub fn wibble() {
610
610
+
wibble()
611
611
+
}
612
612
+
"
613
613
+
),
614
614
+
"
615
615
+
import mod.{wibble}
616
616
+
617
617
+
pub fn main() {
618
618
+
wibble()
619
619
+
mod.wibble()
620
620
+
}
621
621
+
",
622
622
+
"some_function",
623
623
+
find_position_of("wibble")
624
624
+
);
625
625
+
}
626
626
+
627
627
+
#[test]
628
628
+
fn rename_function_from_aliased_import() {
629
629
+
assert_rename!(
630
630
+
(
631
631
+
"mod",
632
632
+
"
633
633
+
pub fn wibble() {
634
634
+
wibble()
635
635
+
}
636
636
+
"
637
637
+
),
638
638
+
"
639
639
+
import mod.{wibble as wobble}
640
640
+
641
641
+
pub fn main() {
642
642
+
wobble()
643
643
+
mod.wibble()
644
644
+
}
645
645
+
",
646
646
+
"some_function",
647
647
+
find_position_of("wibble")
648
648
+
);
649
649
+
}
650
650
+
651
651
+
#[test]
652
652
+
fn rename_function_from_aliased_import_to_original_name() {
653
653
+
assert_rename!(
654
654
+
(
655
655
+
"mod",
656
656
+
"
657
657
+
pub fn wibble() {
658
658
+
wibble()
659
659
+
}
660
660
+
"
661
661
+
),
662
662
+
"
663
663
+
import mod.{wibble as wobble}
664
664
+
665
665
+
pub fn main() {
666
666
+
wobble()
667
667
+
mod.wibble()
668
668
+
}
669
669
+
",
670
670
+
"wibble",
671
671
+
find_position_of("wibble")
672
672
+
);
673
673
+
}
674
674
+
675
675
+
#[test]
604
676
fn rename_aliased_function() {
605
677
assert_rename!(
606
678
(
···
808
880
}
809
881
810
882
#[test]
883
883
+
fn rename_constant_from_import() {
884
884
+
assert_rename!(
885
885
+
(
886
886
+
"mod",
887
887
+
"
888
888
+
pub const something = 10
889
889
+
890
890
+
fn wibble() {
891
891
+
something
892
892
+
}
893
893
+
"
894
894
+
),
895
895
+
"
896
896
+
import mod.{something}
897
897
+
898
898
+
pub fn main() {
899
899
+
something + mod.something
900
900
+
}
901
901
+
",
902
902
+
"ten",
903
903
+
find_position_of("something")
904
904
+
);
905
905
+
}
906
906
+
907
907
+
#[test]
908
908
+
fn rename_constant_from_aliased_import() {
909
909
+
assert_rename!(
910
910
+
(
911
911
+
"mod",
912
912
+
"
913
913
+
pub const something = 10
914
914
+
915
915
+
fn wibble() {
916
916
+
something
917
917
+
}
918
918
+
"
919
919
+
),
920
920
+
"
921
921
+
import mod.{something as smth}
922
922
+
923
923
+
pub fn main() {
924
924
+
smth + mod.something
925
925
+
}
926
926
+
",
927
927
+
"ten",
928
928
+
find_position_of("something")
929
929
+
);
930
930
+
}
931
931
+
932
932
+
#[test]
933
933
+
fn rename_constant_from_aliased_import_to_original_name() {
934
934
+
assert_rename!(
935
935
+
(
936
936
+
"mod",
937
937
+
"
938
938
+
pub const something = 10
939
939
+
940
940
+
fn wibble() {
941
941
+
something
942
942
+
}
943
943
+
"
944
944
+
),
945
945
+
"
946
946
+
import mod.{something as smth}
947
947
+
948
948
+
pub fn main() {
949
949
+
smth + mod.something
950
950
+
}
951
951
+
",
952
952
+
"something",
953
953
+
find_position_of("something")
954
954
+
);
955
955
+
}
956
956
+
957
957
+
#[test]
811
958
fn rename_aliased_constant() {
812
959
assert_rename!(
813
960
(
···
1014
1161
}
1015
1162
1016
1163
#[test]
1164
1164
+
fn rename_type_variant_from_import() {
1165
1165
+
assert_rename!(
1166
1166
+
(
1167
1167
+
"mod",
1168
1168
+
"
1169
1169
+
pub type Wibble {
1170
1170
+
Constructor(Int)
1171
1171
+
}
1172
1172
+
1173
1173
+
fn wibble() {
1174
1174
+
Constructor(81)
1175
1175
+
}
1176
1176
+
"
1177
1177
+
),
1178
1178
+
"
1179
1179
+
import mod.{Constructor}
1180
1180
+
1181
1181
+
pub fn main() {
1182
1182
+
#(Constructor(75), mod.Constructor(57))
1183
1183
+
}
1184
1184
+
",
1185
1185
+
"Number",
1186
1186
+
find_position_of("Constructor")
1187
1187
+
);
1188
1188
+
}
1189
1189
+
1190
1190
+
#[test]
1191
1191
+
fn rename_type_variant_from_aliased_import() {
1192
1192
+
assert_rename!(
1193
1193
+
(
1194
1194
+
"mod",
1195
1195
+
"
1196
1196
+
pub type Wibble {
1197
1197
+
Constructor(Int)
1198
1198
+
}
1199
1199
+
1200
1200
+
fn wibble() {
1201
1201
+
Constructor(81)
1202
1202
+
}
1203
1203
+
"
1204
1204
+
),
1205
1205
+
"
1206
1206
+
import mod.{Constructor as C}
1207
1207
+
1208
1208
+
pub fn main() {
1209
1209
+
#(C(75), mod.Constructor(57))
1210
1210
+
}
1211
1211
+
",
1212
1212
+
"Number",
1213
1213
+
find_position_of("Constructor")
1214
1214
+
);
1215
1215
+
}
1216
1216
+
1217
1217
+
#[test]
1218
1218
+
fn rename_type_variant_from_aliased_import_to_original_name() {
1219
1219
+
assert_rename!(
1220
1220
+
(
1221
1221
+
"mod",
1222
1222
+
"
1223
1223
+
pub type Wibble {
1224
1224
+
Constructor(Int)
1225
1225
+
}
1226
1226
+
1227
1227
+
fn wibble() {
1228
1228
+
Constructor(81)
1229
1229
+
}
1230
1230
+
"
1231
1231
+
),
1232
1232
+
"
1233
1233
+
import mod.{Constructor as C}
1234
1234
+
1235
1235
+
pub fn main() {
1236
1236
+
#(C(75), mod.Constructor(57))
1237
1237
+
}
1238
1238
+
",
1239
1239
+
"Constructor",
1240
1240
+
find_position_of("Constructor")
1241
1241
+
);
1242
1242
+
}
1243
1243
+
1244
1244
+
#[test]
1017
1245
fn rename_aliased_type_variant() {
1018
1246
assert_rename!(
1019
1247
(
···
1339
1567
",
1340
1568
"SomeType",
1341
1569
find_position_of("Wibble)")
1570
1570
+
);
1571
1571
+
}
1572
1572
+
1573
1573
+
#[test]
1574
1574
+
fn rename_type_from_import() {
1575
1575
+
assert_rename!(
1576
1576
+
(
1577
1577
+
"mod",
1578
1578
+
"
1579
1579
+
pub type Wibble { Constructor }
1580
1580
+
1581
1581
+
fn wibble(w: Wibble) -> Wibble { todo }
1582
1582
+
"
1583
1583
+
),
1584
1584
+
"
1585
1585
+
import mod.{type Wibble}
1586
1586
+
1587
1587
+
pub fn main(w: Wibble) -> mod.Wibble { todo }
1588
1588
+
",
1589
1589
+
"SomeType",
1590
1590
+
find_position_of("Wibble")
1591
1591
+
);
1592
1592
+
}
1593
1593
+
1594
1594
+
#[test]
1595
1595
+
fn rename_type_from_aliased_import() {
1596
1596
+
assert_rename!(
1597
1597
+
(
1598
1598
+
"mod",
1599
1599
+
"
1600
1600
+
pub type Wibble { Constructor }
1601
1601
+
1602
1602
+
fn wibble(w: Wibble) -> Wibble { todo }
1603
1603
+
"
1604
1604
+
),
1605
1605
+
"
1606
1606
+
import mod.{type Wibble as Wobble}
1607
1607
+
1608
1608
+
pub fn main(w: Wobble) -> mod.Wibble { todo }
1609
1609
+
",
1610
1610
+
"SomeType",
1611
1611
+
find_position_of("Wibble")
1612
1612
+
);
1613
1613
+
}
1614
1614
+
1615
1615
+
#[test]
1616
1616
+
fn rename_type_from_aliased_import_to_original_name() {
1617
1617
+
assert_rename!(
1618
1618
+
(
1619
1619
+
"mod",
1620
1620
+
"
1621
1621
+
pub type Wibble { Constructor }
1622
1622
+
1623
1623
+
fn wibble(w: Wibble) -> Wibble { todo }
1624
1624
+
"
1625
1625
+
),
1626
1626
+
"
1627
1627
+
import mod.{type Wibble as Wobble}
1628
1628
+
1629
1629
+
pub fn main(w: Wobble) -> mod.Wibble { todo }
1630
1630
+
",
1631
1631
+
"Wibble",
1632
1632
+
find_position_of("Wibble")
1342
1633
);
1343
1634
}
1344
1635
+41
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_constant_from_aliased_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{something as smth}\n\npub fn main() {\n smth + mod.something\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub const something = 10
9
9
+
10
10
+
fn wibble() {
11
11
+
something
12
12
+
}
13
13
+
14
14
+
15
15
+
-- app.gleam
16
16
+
17
17
+
import mod.{something as smth}
18
18
+
↑▔▔▔▔▔▔▔▔
19
19
+
20
20
+
pub fn main() {
21
21
+
smth + mod.something
22
22
+
}
23
23
+
24
24
+
25
25
+
----- AFTER RENAME
26
26
+
-- mod.gleam
27
27
+
28
28
+
pub const something = 10
29
29
+
30
30
+
fn wibble() {
31
31
+
something
32
32
+
}
33
33
+
34
34
+
35
35
+
-- app.gleam
36
36
+
37
37
+
import mod.{something as ten}
38
38
+
39
39
+
pub fn main() {
40
40
+
ten + mod.something
41
41
+
}
+41
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_constant_from_aliased_import_to_original_name.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{something as smth}\n\npub fn main() {\n smth + mod.something\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub const something = 10
9
9
+
10
10
+
fn wibble() {
11
11
+
something
12
12
+
}
13
13
+
14
14
+
15
15
+
-- app.gleam
16
16
+
17
17
+
import mod.{something as smth}
18
18
+
↑▔▔▔▔▔▔▔▔
19
19
+
20
20
+
pub fn main() {
21
21
+
smth + mod.something
22
22
+
}
23
23
+
24
24
+
25
25
+
----- AFTER RENAME
26
26
+
-- mod.gleam
27
27
+
28
28
+
pub const something = 10
29
29
+
30
30
+
fn wibble() {
31
31
+
something
32
32
+
}
33
33
+
34
34
+
35
35
+
-- app.gleam
36
36
+
37
37
+
import mod.{something}
38
38
+
39
39
+
pub fn main() {
40
40
+
something + mod.something
41
41
+
}
+41
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_constant_from_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{something}\n\npub fn main() {\n something + mod.something\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub const something = 10
9
9
+
10
10
+
fn wibble() {
11
11
+
something
12
12
+
}
13
13
+
14
14
+
15
15
+
-- app.gleam
16
16
+
17
17
+
import mod.{something}
18
18
+
↑▔▔▔▔▔▔▔▔
19
19
+
20
20
+
pub fn main() {
21
21
+
something + mod.something
22
22
+
}
23
23
+
24
24
+
25
25
+
----- AFTER RENAME
26
26
+
-- mod.gleam
27
27
+
28
28
+
pub const something = 10
29
29
+
30
30
+
fn wibble() {
31
31
+
something
32
32
+
}
33
33
+
34
34
+
35
35
+
-- app.gleam
36
36
+
37
37
+
import mod.{something as ten}
38
38
+
39
39
+
pub fn main() {
40
40
+
ten + mod.something
41
41
+
}
+39
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_function_from_aliased_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{wibble as wobble}\n\npub fn main() {\n wobble()\n mod.wibble()\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub fn wibble() {
9
9
+
wibble()
10
10
+
}
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{wibble as wobble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main() {
19
19
+
wobble()
20
20
+
mod.wibble()
21
21
+
}
22
22
+
23
23
+
24
24
+
----- AFTER RENAME
25
25
+
-- mod.gleam
26
26
+
27
27
+
pub fn wibble() {
28
28
+
wibble()
29
29
+
}
30
30
+
31
31
+
32
32
+
-- app.gleam
33
33
+
34
34
+
import mod.{wibble as some_function}
35
35
+
36
36
+
pub fn main() {
37
37
+
some_function()
38
38
+
mod.wibble()
39
39
+
}
+39
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_function_from_aliased_import_to_original_name.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{wibble as wobble}\n\npub fn main() {\n wobble()\n mod.wibble()\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub fn wibble() {
9
9
+
wibble()
10
10
+
}
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{wibble as wobble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main() {
19
19
+
wobble()
20
20
+
mod.wibble()
21
21
+
}
22
22
+
23
23
+
24
24
+
----- AFTER RENAME
25
25
+
-- mod.gleam
26
26
+
27
27
+
pub fn wibble() {
28
28
+
wibble()
29
29
+
}
30
30
+
31
31
+
32
32
+
-- app.gleam
33
33
+
34
34
+
import mod.{wibble}
35
35
+
36
36
+
pub fn main() {
37
37
+
wibble()
38
38
+
mod.wibble()
39
39
+
}
+39
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_function_from_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{wibble}\n\npub fn main() {\n wibble()\n mod.wibble()\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub fn wibble() {
9
9
+
wibble()
10
10
+
}
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{wibble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main() {
19
19
+
wibble()
20
20
+
mod.wibble()
21
21
+
}
22
22
+
23
23
+
24
24
+
----- AFTER RENAME
25
25
+
-- mod.gleam
26
26
+
27
27
+
pub fn wibble() {
28
28
+
wibble()
29
29
+
}
30
30
+
31
31
+
32
32
+
-- app.gleam
33
33
+
34
34
+
import mod.{wibble as some_function}
35
35
+
36
36
+
pub fn main() {
37
37
+
some_function()
38
38
+
mod.wibble()
39
39
+
}
+33
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_from_aliased_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{type Wibble as Wobble}\n\npub fn main(w: Wobble) -> mod.Wibble { todo }\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble { Constructor }
9
9
+
10
10
+
fn wibble(w: Wibble) -> Wibble { todo }
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{type Wibble as Wobble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main(w: Wobble) -> mod.Wibble { todo }
19
19
+
20
20
+
21
21
+
----- AFTER RENAME
22
22
+
-- mod.gleam
23
23
+
24
24
+
pub type Wibble { Constructor }
25
25
+
26
26
+
fn wibble(w: Wibble) -> Wibble { todo }
27
27
+
28
28
+
29
29
+
-- app.gleam
30
30
+
31
31
+
import mod.{type Wibble as SomeType}
32
32
+
33
33
+
pub fn main(w: SomeType) -> mod.Wibble { todo }
+33
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_from_aliased_import_to_original_name.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{type Wibble as Wobble}\n\npub fn main(w: Wobble) -> mod.Wibble { todo }\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble { Constructor }
9
9
+
10
10
+
fn wibble(w: Wibble) -> Wibble { todo }
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{type Wibble as Wobble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main(w: Wobble) -> mod.Wibble { todo }
19
19
+
20
20
+
21
21
+
----- AFTER RENAME
22
22
+
-- mod.gleam
23
23
+
24
24
+
pub type Wibble { Constructor }
25
25
+
26
26
+
fn wibble(w: Wibble) -> Wibble { todo }
27
27
+
28
28
+
29
29
+
-- app.gleam
30
30
+
31
31
+
import mod.{type Wibble}
32
32
+
33
33
+
pub fn main(w: Wibble) -> mod.Wibble { todo }
+33
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_from_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{type Wibble}\n\npub fn main(w: Wibble) -> mod.Wibble { todo }\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble { Constructor }
9
9
+
10
10
+
fn wibble(w: Wibble) -> Wibble { todo }
11
11
+
12
12
+
13
13
+
-- app.gleam
14
14
+
15
15
+
import mod.{type Wibble}
16
16
+
↑▔▔▔▔▔
17
17
+
18
18
+
pub fn main(w: Wibble) -> mod.Wibble { todo }
19
19
+
20
20
+
21
21
+
----- AFTER RENAME
22
22
+
-- mod.gleam
23
23
+
24
24
+
pub type Wibble { Constructor }
25
25
+
26
26
+
fn wibble(w: Wibble) -> Wibble { todo }
27
27
+
28
28
+
29
29
+
-- app.gleam
30
30
+
31
31
+
import mod.{type Wibble as SomeType}
32
32
+
33
33
+
pub fn main(w: SomeType) -> mod.Wibble { todo }
+45
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_variant_from_aliased_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{Constructor as C}\n\npub fn main() {\n #(C(75), mod.Constructor(57))\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble {
9
9
+
Constructor(Int)
10
10
+
}
11
11
+
12
12
+
fn wibble() {
13
13
+
Constructor(81)
14
14
+
}
15
15
+
16
16
+
17
17
+
-- app.gleam
18
18
+
19
19
+
import mod.{Constructor as C}
20
20
+
↑▔▔▔▔▔▔▔▔▔▔
21
21
+
22
22
+
pub fn main() {
23
23
+
#(C(75), mod.Constructor(57))
24
24
+
}
25
25
+
26
26
+
27
27
+
----- AFTER RENAME
28
28
+
-- mod.gleam
29
29
+
30
30
+
pub type Wibble {
31
31
+
Constructor(Int)
32
32
+
}
33
33
+
34
34
+
fn wibble() {
35
35
+
Constructor(81)
36
36
+
}
37
37
+
38
38
+
39
39
+
-- app.gleam
40
40
+
41
41
+
import mod.{Constructor as Number}
42
42
+
43
43
+
pub fn main() {
44
44
+
#(Number(75), mod.Constructor(57))
45
45
+
}
+45
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_variant_from_aliased_import_to_original_name.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{Constructor as C}\n\npub fn main() {\n #(C(75), mod.Constructor(57))\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble {
9
9
+
Constructor(Int)
10
10
+
}
11
11
+
12
12
+
fn wibble() {
13
13
+
Constructor(81)
14
14
+
}
15
15
+
16
16
+
17
17
+
-- app.gleam
18
18
+
19
19
+
import mod.{Constructor as C}
20
20
+
↑▔▔▔▔▔▔▔▔▔▔
21
21
+
22
22
+
pub fn main() {
23
23
+
#(C(75), mod.Constructor(57))
24
24
+
}
25
25
+
26
26
+
27
27
+
----- AFTER RENAME
28
28
+
-- mod.gleam
29
29
+
30
30
+
pub type Wibble {
31
31
+
Constructor(Int)
32
32
+
}
33
33
+
34
34
+
fn wibble() {
35
35
+
Constructor(81)
36
36
+
}
37
37
+
38
38
+
39
39
+
-- app.gleam
40
40
+
41
41
+
import mod.{Constructor}
42
42
+
43
43
+
pub fn main() {
44
44
+
#(Constructor(75), mod.Constructor(57))
45
45
+
}
+45
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_type_variant_from_import.snap
View file
Reviewed
···
1
1
+
---
2
2
+
source: language-server/src/tests/rename.rs
3
3
+
expression: "\nimport mod.{Constructor}\n\npub fn main() {\n #(Constructor(75), mod.Constructor(57))\n}\n"
4
4
+
---
5
5
+
----- BEFORE RENAME
6
6
+
-- mod.gleam
7
7
+
8
8
+
pub type Wibble {
9
9
+
Constructor(Int)
10
10
+
}
11
11
+
12
12
+
fn wibble() {
13
13
+
Constructor(81)
14
14
+
}
15
15
+
16
16
+
17
17
+
-- app.gleam
18
18
+
19
19
+
import mod.{Constructor}
20
20
+
↑▔▔▔▔▔▔▔▔▔▔
21
21
+
22
22
+
pub fn main() {
23
23
+
#(Constructor(75), mod.Constructor(57))
24
24
+
}
25
25
+
26
26
+
27
27
+
----- AFTER RENAME
28
28
+
-- mod.gleam
29
29
+
30
30
+
pub type Wibble {
31
31
+
Constructor(Int)
32
32
+
}
33
33
+
34
34
+
fn wibble() {
35
35
+
Constructor(81)
36
36
+
}
37
37
+
38
38
+
39
39
+
-- app.gleam
40
40
+
41
41
+
import mod.{Constructor as Number}
42
42
+
43
43
+
pub fn main() {
44
44
+
#(Number(75), mod.Constructor(57))
45
45
+
}