Skip to content

Commit 4285a36

Browse files
ankddevlpil
authored andcommitted
chore: CHANGELOG entry
1 parent 20f4e4f commit 4285a36

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,41 @@
296296
prioritise values which match the expected type of the value being completed.
297297
([Surya Rose](https://github.com/GearsDatapacks))
298298

299+
- The language server nof offers code action to add type annotations to all
300+
functions and constants. For example,
301+
302+
```gleam
303+
pub const answer = 42
304+
305+
pub fn add(x, y) {
306+
x + y
307+
}
308+
309+
pub fn add_one(thing) {
310+
// ^ Triggering "Annotate all top level type definitions" code action here
311+
let result = add(thing, 1)
312+
result
313+
}
314+
```
315+
316+
Triggering the "Annotate all top level type definitions" code action over
317+
the name of function `add_one` would result in following code:
318+
319+
```gleam
320+
pub const answer: Int = 42
321+
322+
pub fn add(x: Int, y: Int) -> Int {
323+
x + y
324+
}
325+
326+
pub fn add_one(thing: Int) -> Int {
327+
let result = add(thing, 1)
328+
result
329+
}
330+
```
331+
332+
([Andrey Kozhev](https://github.com/ankddev))
333+
299334
### Formatter
300335

301336
### Bug fixes

0 commit comments

Comments
 (0)