-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace doesn't work on Theia but others like add labels or remove does #18868
Comments
@hsnoil could you provide more info on
As you claim the problem is there but it is realllly hard to track down when I can't check what is happening on the editor side. |
@alibektas - What information do you need? Also, I didn't actually need debug=2, just needed to compile rowan in debug mode to see the error. |
Ok I thought you built theia with extra envs. Then let me see what I can do 👍 |
That panic is expected, we can't currently upgrade rowan because we use the mutable API wrong (which in itself isn't a big issue but now it triggers an assert). You shouldn't hit that though unless you explicitly bump the rowan version in rust-analyzer as we have locked the version. So that panic is unrelated to the issue here |
Comparing the LSP traces between Code and Theia might be helpful ( |
I see, if I relock the version then yes no error happens, but it still doesn't work all the same. Just it gives no error of it not working. I tried setting verbose and RA_LOG_FILE and RA_LOG to debug, it doesn't even get that far and it gave on highlighting |
That sounds like an issue with our debugging infra. You can skip |
As for the Rust Analyzer Language Server Trace Theia - nonworking
VSCodium - working
|
I've been looking around and so far the only difference I have found was that in Despite their input being:
For the time being though, at the very least
should be changed to something like this:
so that at least when it fails it gives an error message instead of simply not working. |
I found a workaround to make it work on Theia.
https://github.com/rust-lang/rust-analyzer/blob/master/editors/code/src/snippets.ts |
@ChayimFriedman2 - Theia 1.79 fixes the issue so now it should work on Theia. So only related issue remaining is
in rust analyzer should return an error if it fails instead of doing nothing. As I showed above maybe something like:
Not sure if this should be under this issue or another issue created for it. |
Discussed in #18839
Originally posted by hsnoil January 6, 2025
When using theia, and you have something like this it doesn't work.
But if you were to just add like add_label_to_loop, it works:
Another interesting case is this one:
If you do "split import" or "remove whole use item" they work but remove all unused imports doesn't.
From the looks of it, replacing with
syntax::ted::replace
is the issue. Replacing, adding and deleting works unless it touches that function.Is this an issue with Theia or an underlying issue with how rowan's splice_children works? I know it works with vscode, but sometime things are done in workaround manners (like match arms in analyzer plugin has a bunch of FIXME there)
For now I opened a ticket with Theia:
eclipse-theia/theia#13922
But it has been a while and likely it being rust and not javascript, if someone isn't explicitly familiar with rust I can understand the hesitation to go through it all. Anyone have any idea what the issue can be?
Edit:
I compiled it with with debug=2 and I got this error:
The text was updated successfully, but these errors were encountered: