Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Author : OwOSwordsman <owoswordsman@gmail.com>
# An unofficial GitHub theme, generated using colors from: https://primer.style/primitives/colors
# Credit goes to the original VSCode theme: https://github.com/primer/github-vscode-theme
# Only the Light and Dark variants were specifically tested

inherits = "github_dark"

[palette]
"accent.emphasis" = "#1f6feb"
"accent.fg" = "#58a6ff"
"accent.muted" = "#388bfd66"
"accent.subtle" = "#388bfd26"
"attention.emphasis" = "#9e6a03"
"attention.fg" = "#d29922"
"attention.muted" = "#bb800966"
"attention.subtle" = "#bb800926"
"border.default" = "#30363d"
"border.muted" = "#21262d"
"border.subtle" = "#f0f6fc1a"
"canvas.default" = "#0d1117"
"canvas.inset" = "#010409"
"canvas.overlay" = "#161b22"
"canvas.subtle" = "#161b22"
"closed.emphasis" = "#6e7681"
"closed.fg" = "#8b949e"
"closed.muted" = "#6e768166"
"closed.subtle" = "#6e76811a"
"danger.emphasis" = "#b76100"
"danger.fg" = "#d47616"
"danger.muted" = "#d4761666"
"danger.subtle" = "#d4761626"
"done.emphasis" = "#8957e5"
"done.fg" = "#a371f7"
"done.muted" = "#a371f766"
"done.subtle" = "#a371f726"
"fg.default" = "#c9d1d9"
"fg.muted" = "#8b949e"
"fg.onEmphasis" = "#ffffff"
"fg.subtle" = "#6e7681"
"neutral.emphasis" = "#6e7681"
"neutral.emphasisPlus" = "#6e7681"
"neutral.muted" = "#6e768166"
"neutral.subtle" = "#6e76811a"
"open.emphasis" = "#b76100"
"open.fg" = "#ec8e2c"
"open.muted" = "#d4761666"
"open.subtle" = "#d4761626"
"scale.black" = "#010409"
"scale.blue.0" = "#cae8ff"
"scale.blue.1" = "#a5d6ff"
"scale.blue.2" = "#79c0ff"
"scale.blue.3" = "#58a6ff"
"scale.blue.4" = "#388bfd"
"scale.blue.5" = "#1f6feb"
"scale.blue.6" = "#1158c7"
"scale.blue.7" = "#0d419d"
"scale.blue.8" = "#0c2d6b"
"scale.blue.9" = "#051d4d"
"scale.coral.0" = "#ffddd2"
"scale.coral.1" = "#ffc2b2"
"scale.coral.2" = "#ffa28b"
"scale.coral.3" = "#f78166"
"scale.coral.4" = "#ea6045"
"scale.coral.5" = "#cf462d"
"scale.coral.6" = "#ac3220"
"scale.coral.7" = "#872012"
"scale.coral.8" = "#640d04"
"scale.coral.9" = "#460701"
"scale.gray.0" = "#f0f6fc"
"scale.gray.1" = "#c9d1d9"
"scale.gray.2" = "#b1bac4"
"scale.gray.3" = "#8b949e"
"scale.gray.4" = "#6e7681"
"scale.gray.5" = "#484f58"
"scale.gray.6" = "#30363d"
"scale.gray.7" = "#21262d"
"scale.gray.8" = "#161b22"
"scale.gray.9" = "#0d1117"
"scale.green.0" = "#cae8ff"
"scale.green.1" = "#a5d6ff"
"scale.green.2" = "#79c0ff"
"scale.green.3" = "#58a6ff"
"scale.green.4" = "#388bfd"
"scale.green.5" = "#1f6feb"
"scale.green.6" = "#1158c7"
"scale.green.7" = "#0d419d"
"scale.green.8" = "#0c2d6b"
"scale.green.9" = "#051d4d"
"scale.orange.0" = "#ffe2bb"
"scale.orange.1" = "#ffc981"
"scale.orange.2" = "#fdac54"
"scale.orange.3" = "#ec8e2c"
"scale.orange.4" = "#d47616"
"scale.orange.5" = "#b76100"
"scale.orange.6" = "#914d04"
"scale.orange.7" = "#6c3906"
"scale.orange.8" = "#4e2906"
"scale.orange.9" = "#331c04"
"scale.pink.0" = "#ffdaec"
"scale.pink.1" = "#ffbedd"
"scale.pink.2" = "#ff9bce"
"scale.pink.3" = "#f778ba"
"scale.pink.4" = "#db61a2"
"scale.pink.5" = "#bf4b8a"
"scale.pink.6" = "#9e3670"
"scale.pink.7" = "#7d2457"
"scale.pink.8" = "#5e103e"
"scale.pink.9" = "#42062a"
"scale.purple.0" = "#eddeff"
"scale.purple.1" = "#e2c5ff"
"scale.purple.2" = "#d2a8ff"
"scale.purple.3" = "#bc8cff"
"scale.purple.4" = "#a371f7"
"scale.purple.5" = "#8957e5"
"scale.purple.6" = "#6e40c9"
"scale.purple.7" = "#553098"
"scale.purple.8" = "#3c1e70"
"scale.purple.9" = "#271052"
"scale.red.0" = "#ffe2bb"
"scale.red.1" = "#ffc981"
"scale.red.2" = "#fdac54"
"scale.red.3" = "#ec8e2c"
"scale.red.4" = "#d47616"
"scale.red.5" = "#b76100"
"scale.red.6" = "#914d04"
"scale.red.7" = "#6c3906"
"scale.red.8" = "#4e2906"
"scale.red.9" = "#331c04"
"scale.white" = "#ffffff"
"scale.yellow.0" = "#f8e3a1"
"scale.yellow.1" = "#f2cc60"
"scale.yellow.2" = "#e3b341"
"scale.yellow.3" = "#d29922"
"scale.yellow.4" = "#bb8009"
"scale.yellow.5" = "#9e6a03"
"scale.yellow.6" = "#845306"
"scale.yellow.7" = "#693e00"
"scale.yellow.8" = "#4b2900"
"scale.yellow.9" = "#341a00"
"severe.emphasis" = "#b76100"
"severe.fg" = "#d47616"
"severe.muted" = "#d4761666"
"severe.subtle" = "#d4761626"
"sponsors.emphasis" = "#bf4b8a"
"sponsors.fg" = "#db61a2"
"sponsors.muted" = "#db61a266"
"sponsors.subtle" = "#db61a226"
"success.emphasis" = "#1f6feb"
"success.fg" = "#58a6ff"
"success.muted" = "#388bfd66"
"success.subtle" = "#388bfd26"
::*; use crate::tests::{check_assist, check_assist_not_applicable}; #[test] fn applies_on_empty_function() { check_assist(unnecessary_async, "pub async f$0n f() {}", "pub fn f() {}") } #[test] fn applies_and_removes_whitespace() { check_assist(unnecessary_async, "pub async f$0n f() {}", "pub fn f() {}") } #[test] fn does_not_apply_on_non_async_function() { check_assist_not_applicable(unnecessary_async, "pub f$0n f() {}") } #[test] fn applies_on_function_with_a_non_await_expr() { check_assist(unnecessary_async, "pub async f$0n f() { f2() }", "pub fn f() { f2() }") } #[test] fn does_not_apply_on_function_with_an_await_expr() { check_assist_not_applicable(unnecessary_async, "pub async f$0n f() { f2().await }") } #[test] fn applies_and_removes_await_on_reference() { check_assist( unnecessary_async, r#" pub async fn f4() { } pub async f$0n f2() { } pub async fn f() { f2().await } pub async fn f3() { f2().await }"#, r#" pub async fn f4() { } pub fn f2() { } pub async fn f() { f2() } pub async fn f3() { f2() }"#, ) } #[test] fn applies_and_removes_await_from_within_module() { check_assist( unnecessary_async, r#" pub async fn f4() { } mod a { pub async f$0n f2() { } } pub async fn f() { a::f2().await } pub async fn f3() { a::f2().await }"#, r#" pub async fn f4() { } mod a { pub fn f2() { } } pub async fn f() { a::f2() } pub async fn f3() { a::f2() }"#, ) } #[test] fn applies_and_removes_await_on_inner_await() { check_assist( unnecessary_async, // Ensure that it is the first await on the 3rd line that is removed r#" pub async fn f() { f2().await } pub async f$0n f2() -> i32 { 1 } pub async fn f3() { f4(f2().await).await } pub async fn f4(i: i32) { }"#, r#" pub async fn f() { f2() } pub fn f2() -> i32 { 1 } pub async fn f3() { f4(f2()).await } pub async fn f4(i: i32) { }"#, ) } #[test] fn applies_and_removes_await_on_outer_await() { check_assist( unnecessary_async, // Ensure that it is the second await on the 3rd line that is removed r#" pub async fn f() { f2().await } pub async f$0n f2(i: i32) { } pub async fn f3() { f2(f4().await).await } pub async fn f4() -> i32 { 1 }"#, r#" pub async fn f() { f2() } pub fn f2(i: i32) { } pub async fn f3() { f2(f4().await) } pub async fn f4() -> i32 { 1 }"#, ) } #[test] fn applies_on_method_call() { check_assist( unnecessary_async, r#" pub struct S { } impl S { pub async f$0n f2(&self) { } } pub async fn f(s: &S) { s.f2().await }"#, r#" pub struct S { } impl S { pub fn f2(&self) { } } pub async fn f(s: &S) { s.f2() }"#, ) } #[test] fn does_not_apply_on_function_with_a_nested_await_expr() { check_assist_not_applicable( unnecessary_async, "async f$0n f() { if true { loop { f2().await } } }", ) } #[test] fn does_not_apply_when_not_on_prototype() { check_assist_not_applicable(unnecessary_async, "pub async fn f() { $0f2() }") } }