File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 128
128
129
129
### Language server
130
130
131
+ - The "pattern match on variable" can now be triggered on lists. For example:
132
+
133
+ ``` gleam
134
+ pub fn is_empty(list: List(a)) -> Bool {
135
+ // ^^^^ Triggering the action over here
136
+ }
137
+ ```
138
+
139
+ Triggering the action over the ` list ` argument would result in the following
140
+ code:
141
+
142
+ ``` gleam
143
+ pub fn is_empty(list: List(a)) -> Bool {
144
+ case list {
145
+ [] -> todo
146
+ [first, ..rest] -> todo
147
+ }
148
+ }
149
+ ```
150
+
151
+ ([ Giacomo Cavalieri] ( https://github.com/giacomocavalieri ) )
152
+
153
+ - The "pattern match on variable" can now be triggered on variables introduced
154
+ by other patterns. For example:
155
+
156
+ ``` gleam
157
+ pub fn main() {
158
+ let User(name:, role:) = find_user("lucy")
159
+ // ^^^^ Triggering the action over
160
+ }
161
+ ```
162
+
163
+ Triggering the action over another variable like ` role ` would result in the
164
+ following code:
165
+
166
+ ``` gleam
167
+ pub fn main() {
168
+ let User(name:, role:) = find_user("lucy")
169
+ case role {
170
+ Admin -> todo
171
+ Member -> todo
172
+ }
173
+ }
174
+ ```
175
+
176
+ ([ Giacomo Cavalieri] ( https://github.com/giacomocavalieri ) )
177
+
131
178
- The language server now offers a quick fix to remove ` opaque ` from a private
132
179
type:
133
180
You can’t perform that action at this time.
0 commit comments