Skip to content

Commit eaa0630

Browse files
giacomocavalierilpil
authored andcommitted
CHANGELOG
1 parent e33c545 commit eaa0630

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,53 @@
128128

129129
### Language server
130130

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+
131178
- The language server now offers a quick fix to remove `opaque` from a private
132179
type:
133180

0 commit comments

Comments
 (0)