File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments