···1616 incorrect extra patterns in addition to the correct missing patterns.
1717 ([Adi Salimgereyev](https://github.com/abs0luty))
18181919+- Fixed a bug where triggering the "Generate function" code action to generate
2020+ a function in a different module could cause the generated function to appear
2121+ in the middle of an existing function, resulting in invalid code.
2222+2323+ ([Surya Rose](https://github.com/GearsDatapacks))
2424+1925## v1.13.0-rc1 - 2025-09-29
20262127### Compiler
···5208520852095209 if let Some(module) = module {
52105210 if let Some(module) = self.modules.get(module) {
52115211- let insert_at = if module.code.is_empty() {
52125212- 0
52135213- } else {
52145214- (module.code.len() - 1) as u32
52155215- };
52115211+ let insert_at = module.code.len() as u32;
52165212 self.code_action_for_module(
52175213 module,
52185214 Publicity::Public,
···5230522652315227 fn code_action_for_module(
52325228 mut self,
52335233- module: &Module,
52295229+ module: &'a Module,
52345230 publicity: Publicity,
52355231 function_to_generate: FunctionToGenerate<'a>,
52365232 insert_at: u32,
···5272526852735269 let publicity = if publicity.is_public() { "pub " } else { "" };
5274527052715271+ // Make sure we use the line number information of the module we are
52725272+ // editing, which might not be the module where the code action is
52735273+ // triggered.
52745274+ self.edits.line_numbers = &module.ast.type_info.line_numbers;
52755275 self.edits.insert(
52765276 insert_at,
52775277 format!("\n\n{publicity}fn {name}({arguments}) -> {return_type} {{\n todo\n}}"),