Skip to content

Commit

Permalink
changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocavalieri committed Jan 11, 2025
1 parent ef0737a commit 2c93074
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@

### Language server

- The language server can now generate the definition of functions that do not
exist in the current file. For example if I write the following piece of code:

```gleam
import gleam/io
pub type Pokemon {
Pokemon(pokedex_number: Int, name: String)
}
pub fn main() {
io.println(to_string(pokemon))
// ^ If you put your cursor over this function that is
// not implemented yet
}
```

Triggering the "generate function" code action, the language server will
generate the following function for you:

```gleam
fn to_string(pokemon: Pokemon) -> String {
todo
}
```

([Giacomo Cavalieri](https://github.com/giacomocavalieri))

- The language server can now fill in the labels of any function call, even when
only some of the arguments are provided. For example:

Expand Down
1 change: 0 additions & 1 deletion compiler-core/src/language_server/code_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3843,7 +3843,6 @@ impl<'a> GenerateFunction<'a> {

impl<'ast> ast::visit::Visit<'ast> for GenerateFunction<'ast> {
fn visit_typed_function(&mut self, fun: &'ast ast::TypedFunction) {
println!("{:#?}", fun.body);
self.last_visited_function_end = Some(fun.end_position);
ast::visit::visit_typed_function(self, fun);
}
Expand Down

0 comments on commit 2c93074

Please sign in to comment.