slint
slint copied to clipboard
Allow renaming symbols
OS: Windows 11 Programming Language: Rust
When I try to rename a symbol in Visual Studio Code I get 'This element can't be renamed'. It would help a lot if such a feature could get implemented as Visual Studio Code also renames all calls when a certain symbol has been renamed.
That would be cool indeed, but is probably tricky to implement: It needs the slint language server to cooperate with the rust, C++ and JS/TS language servers.
element id can already be renamed. Renaming properties, callback and such, even element, should be possible, but then we need to build an index of usages. And that's only renaming within the .slint files. Making it works to rename the usage in Rust/C++ might not be possible
In the long run, I think it is important to be able to perform a refactoring from slint, on anything which will also refactor the rust code.
I think you can delegate the rust code refactoring to rust analyzer or something similar. Maybe you can even embed some parts of rust analyzer within slint lsp?
Maybe it is an expensive challenge, but it is part of making a DSL a good experience.