slint-ui / slint

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

The live preview on rust template project crashes the language server #6829

Closed SidneyCogdill closed 3 days ago

SidneyCogdill commented 3 days ago

Bug Description

https://github.com/user-attachments/assets/19b276b5-0fe4-4db0-b591-22a1c3deda0d

Reproducible steps:

  1. Download the rust template project on https://docs.slint.dev/latest/docs/slint/src/quickstart/getting_started
  2. Extract it and open it with VS Code (assuming the rust-analyzer and slint extensions are already installed)
  3. Open ui/app-window.slint file, click on the Show Preview button on top of AppWindow
  4. In the Live-Preview window, click on the Interact button, then click on Increase value button
  5. Now toggle the Edit mode on
  6. Slint LSP crashes
thread 'main' panicked at D:\a\slint\slint\internal\core\model.rs:928:38:
already borrowed: BorrowMutError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Info  - 1:25:41 PM] Connection to server got closed. Server will restart.
true
The Slint Language Server crashed. This is a bug. Please open an issue on https://github.com/slint-ui/slint/issues

Reproducible Code (if applicable)

https://github.com/slint-ui/slint-rust-template/archive/refs/heads/main.zip

Environment Details

Product Impact

I didn't expect LSP to crash on a hello world project provided by the slint tutorial, so I guess that's a blocker issue.

ogoffart commented 3 days ago

Thanks for filing a bug report. It looks like this is a duplicate of issue https://github.com/slint-ui/slint/issues/6529 and https://github.com/slint-ui/slint/issues/3214, it should be fixed in the master branch already. I'm going to close this issue as duplicate, but thanks anyway for reporting.