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.16k stars 535 forks source link

Slint lsp allows to remove items referenced elsewhere #4872

Open qarmin opened 3 months ago

qarmin commented 3 months ago

Slint nightly LSP plugin 17.03.2024

https://github.com/slint-ui/slint/assets/41945903/1ad58b7e-aa6b-436d-b5c1-645fd0595e17

UI files - https://github.com/qarmin/czkawka/tree/7.0.0/krokiet/ui

hunger commented 3 months ago

This ends up removing a named Element that is referenced elsewhere in the code. That's why it starts to fail compiling. I am not sure what I can do about that at this time. Remove the referencing code as well?

It should obviously not continue to delete things after it error-ed out.

ogoffart commented 3 months ago

Remove the referencing code as well?

I don't think that's a good idea to remove the referencing code.

I think we should just not allow deleting them, and maybe showing a notification popup why we can't delete it.

(It should be easy to detect if the id is used. Similar to the code that renames ids.)

hunger commented 2 months ago

The part where you can cause more deletions while the compilation has failed is fixed.

The part where you can delete elements that are used elsewhere is still open.