slint icon indicating copy to clipboard operation
slint copied to clipboard

Slint lsp allows to remove items referenced elsewhere

Open qarmin opened this issue 1 year ago • 3 comments

Slint nightly LSP plugin 17.03.2024

  • Select any item
  • remove it
  • repeat steps
  • after some time, compilation should fail and "delete" button, should remove random parts of code

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

qarmin avatar Mar 17 '24 11:03 qarmin

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.

hunger avatar Mar 18 '24 08:03 hunger

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.)

ogoffart avatar Mar 18 '24 09:03 ogoffart

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.

hunger avatar May 02 '24 09:05 hunger