Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Allow renaming when errors are present

author
Gears
committer
Louis Pilfold
date (Jan 19, 2026, 11:22 AM UTC) commit b8e73a7b parent 4e824237 change-id vxnuylzq
+63 -2
+4
CHANGELOG.md
··· 111 111 ``` 112 112 113 113 ([Andrey Kozhev](https://github.com/ankddev)) 114 + 115 + - Fixed a bug where renaming would not work properly if there was an error in 116 + target file. 117 + ([Surya Rose](https://github.com/GearsDatapacks))
+7 -2
compiler-core/src/build/package_compiler.rs
··· 607 607 let _ = incomplete_modules.insert(name.clone()); 608 608 // Register the partially type checked module data so that it can be 609 609 // used in the language server. 610 - modules.push(Module { 610 + let mut module = Module { 611 611 dependencies, 612 612 origin, 613 613 extra, ··· 616 616 code, 617 617 ast, 618 618 input_path: path, 619 - }); 619 + }; 620 + module.attach_doc_and_module_comments(); 621 + 622 + let _ = module_types.insert(module.ast.name.clone(), module.ast.type_info.clone()); 623 + 624 + modules.push(module); 620 625 // WARNING: This cannot be used for code generation as the code has errors. 621 626 return Outcome::PartialFailure(modules, error); 622 627 }
+4
language-server/src/rename.rs
··· 141 141 } 142 142 143 143 match renamed.target_kind { 144 + // When renaming an unqualified import, instead of renaming the original 145 + // value, we simply want to alias it in the current module. 146 + // It's an unqualified import if we are referencing it using unqualified 147 + // syntax, and it is from a different module. 144 148 RenameTarget::Unqualified if renamed.module_name != &current_module.name => { 145 149 return alias_references_in_module( 146 150 params,
+18
language-server/src/tests/rename.rs
··· 1750 1750 find_position_of("nested") 1751 1751 ); 1752 1752 } 1753 + 1754 + #[test] 1755 + fn rename_works_when_error_is_present() { 1756 + assert_rename!( 1757 + r#" 1758 + fn wibble() { 1759 + "test string" 1760 + } 1761 + 1762 + pub fn main() { 1763 + 1 + "1" 1764 + echo wibble() 1765 + } 1766 + "#, 1767 + "wobble", 1768 + find_position_of("wibble") 1769 + ); 1770 + }
+30
language-server/src/tests/snapshots/gleam_language_server__tests__rename__rename_works_when_error_is_present.snap
··· 1 + --- 2 + source: language-server/src/tests/rename.rs 3 + expression: "\nfn wibble() {\n \"test string\"\n}\n\npub fn main() {\n 1 + \"1\"\n echo wibble()\n}\n " 4 + --- 5 + ----- BEFORE RENAME 6 + -- app.gleam 7 + 8 + fn wibble() { 9 + ↑▔▔▔▔▔ 10 + "test string" 11 + } 12 + 13 + pub fn main() { 14 + 1 + "1" 15 + echo wibble() 16 + } 17 + 18 + 19 + 20 + ----- AFTER RENAME 21 + -- app.gleam 22 + 23 + fn wobble() { 24 + "test string" 25 + } 26 + 27 + pub fn main() { 28 + 1 + "1" 29 + echo wobble() 30 + }