slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.08k stars 533 forks source link

Allow renaming symbols #3958

Open PerfectlyFineCode opened 7 months ago

PerfectlyFineCode commented 7 months ago

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

hunger commented 7 months ago

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.

ogoffart commented 7 months ago

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

abique commented 4 months ago

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.