eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.29k stars 2.45k forks source link

UI locks up on running rust-analyzer #13835

Closed hsnoil closed 1 week ago

hsnoil commented 2 weeks ago

Bug Description:

When using rust-analyzer(with proper binary) on the appimage, I ran into UI locking up issues on certain code after saving the first time.

I have no issues running this in vscode, but in theia it locks up the HTML UI.

The native UI still works but does not accept commands and I have to kill the theia process

Steps to Reproduce:

  1. Use Theia appimage
  2. Install rust-analyzer plugin (insure you are using proper binary)
  3. Extract the minimum example code: test1.zip
  4. Go to main.rs and then save, once first save is done. Type let and Theia will freeze up before finishing typing with the suggestions menu open

Additional Information

msujew commented 1 week ago

Took a quick look at this. It seems like our problem tree widget runs into an infinite loop here:

https://github.com/eclipse-theia/theia/blob/49b8735733712df2945c5a3f60660688e888cb6a/packages/core/src/browser/tree/tree-widget.tsx#L334-L337

Which then eventually yields a out of memory error. Taking a look at the tree model shows a cyclic reference between tree nodes (which makes them non-tree nodes from a graph perspective). I'll take a further look at this later and see what the root cause is. It's likely based on how we update/modify the problem tree model.

msujew commented 1 week ago

See https://github.com/eclipse-theia/theia/pull/13841 for a fix.