-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer fails on VSCode Extract Method #43459
Comments
Code left me with a |
For LSP, this is currently expected - there's not currently a way for us to trigger a rename from a code action (I have an open issue at microsoft/language-server-protocol#764). Ofc, the error is not expected - I'll take a look. It may be worth enabling the analysis server log so if you see this again (or other issues) you can grab a copy of the LSP traffic without needing to reproduce it. I run with it enabled all the time (it can get big in a long session, but it is overwritten on each session so won't just grow infinitely). |
@timsneath I haven't been able to reproduce this - are you working in a plain Dart app, or Flutter? Is it possible the refactor was initially slow and you may have typed (or tried it a second time) as a result? I've seen some reports of refactoring initially being slow (perhaps due to the server building an index), and wonder whether other actions while it is being processed might result in this (though I'd expect that the refactor should be cancelled and a more specific message explaining that). |
Yes -- I think that's what happened (executed the command twice). But as you say, we shouldn't bail with an exception when that occurs :) |
Great, thanks for confirming - I think I should be able to reproduce that with some forced delays in the server then. I think there are a few things we should do:
|
… arrives See #43459. Change-Id: I52bf26e80b0d6ddb577c89b5a18ff7563e614cb4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165321 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Got some fixes on the way that I think will resolve this:
The middle one resolves the error above, though the first one should actually prevent that situation (as the first refactor would be cancelled when the second is sent). The third one for now is just cosmetic (so you know something is happening), but at some point it will be upgraded to a cancellable progress, so you could cancel it from the client if it's taking long (which hopefully isn't common - but refactors involving unindexed files can sometimes have a delay). |
…uring a refactor See #43459. Change-Id: I2e32ba0ba1020d18ea574caac42e79ec184a5562 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165362 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
See #43459. Change-Id: I055e4f61499675b9e1ec26e25d894b855f3170c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165363 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Those changes (minus the cancellable one) are all merged (though may take a few days to get to Flutter), though I don't have permission to close this (and forgot to but "Fixes" in the commit message) so one of you will have to do it. Thanks! :-) |
facing the same issue, "An error occurred while handling workspace/executeCommand re" was trying to build a notepad app like this |
@mhwsam this issue is quite old - could you file a new issue with details of how to reproduce this (and ideally a log captured by passing |
On attempting to refactor (extract method) from VSCode, I got this error from the analyzer:
Dart version
The text was updated successfully, but these errors were encountered: