slint icon indicating copy to clipboard operation
slint copied to clipboard

Allow renaming symbols

Open PerfectlyFineCode opened this issue 1 year ago • 3 comments

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.

image

PerfectlyFineCode avatar Nov 19 '23 03:11 PerfectlyFineCode

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.

hunger avatar Nov 20 '23 07:11 hunger

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

ogoffart avatar Nov 20 '23 09:11 ogoffart

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.

abique avatar Feb 18 '24 14:02 abique