-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Message: An error occurred while handling textDocument/references request Code: -32001 #60005
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
Comments
I'm also seeing this on Flutter 3.29.0-0.2.pre, with Dart SDK version: 3.7.0-323.1.beta, from the Flutter beta channel. |
I don't suppose either of you have a code sample that triggers this? @scheglov the exception is occurring on the assertion that https://github.com/dart-lang/sdk/blob/3.6.1/pkg/analyzer/lib/src/dart/analysis/search.dart#L761 It's not clear to me in what situations |
I have a part of my repo that runs into this problem (right click on I suppose there could be a security risk in running the LSP on untrusted code, but is there a way to test it in a Docker container, or in a VM? |
@DanTup I made a simple demo with the leaf-node/dart_lsp_test@4598d2c If you right-click on https://github.com/leaf-node/dart_lsp_test/blob/main/lib/foo_cubit.dart#L5 The error is reproduced. |
@leaf-node thanks! Although I don't seem able to reproduce it. I checked out that commit from your repository and I can fetch references fine (I'm using Flutter stable 3.27.3 which I think matches you): references.mp4Does it repro for you in a clean clone of that repository? If not, could you try copying your |
@DanTup Oops, it looks like I gave you the wrong line to test. If you right click on |
Oh, I should also mention that if you view the "Output" tab in VSCodium, you can select from the drop-down on the right to show "LSP" logs once an error occurs. |
@leaf-node thanks, I can repro now. I tried but failed to reduce the example to something smaller by removing some of the additional layers. I'll wait for @scheglov's input, as he might have a better idea of why this element might not have a source (I wonder if it's related to the callable classes - though I retained them as I tried to reduce the code, but the issue stopped occurring). |
We probably don't have a source because the formal parameter element is synthetic. |
We need to fix the case where the exception is being thrown, and we need to do so in a way that allows us to find all of the references to a parameter, even when the formal parameter element is synthetic. Those might have to be done in two steps, depending on how long it will take to fix the exception. |
Thanks for looking into this. I should note that the LSP server continues to work for other queries before and after this error, so just this specific type of query is not working. 🙂 |
https://dart-review.googlesource.com/c/sdk/+/411600 will fix the crash, though still leaves navigation through these parameters not working (no results will be returned). I'm not sure about the best way to fix this though (my feeling was that |
Issue for the underlying problem: #60200 |
In VSCodium version 1.96.4.25026-el9 and VSCodium Insiders version 1.97.0.25026-el9 on OpenSUSE Tumbleweed, with Dart 3.6.1 installed by Flutter 3.27.3, I am no longer able to find references to Dart code that exists in other files. The LSP log in VSCodium shows the following after trying to search for a variable reference:
I see that the LSP is running in my process list:
In the
helix
editor, version 25.1 (dabfb6ce), I see the following when I try to lookup a reference that exists outside of the file currently in view:As an example, this error occurs when finding references (by right clicking) for
allowClickAccept
in the following project, file and line number: https://github.com/okcode-studio/open_alert_viewer/blob/main/lib/ui/settings/cubit/account_settings_cubit.dart#L157, but I'm seeing this in other files and for other references too.I have tried clearing my
~/.dart*
,~/.pub-cache
,~/.cache
and rangit clean -fxd
in my Flutter checkout, but the problem persists.This issue started probably within the last few hours or so, even before updating VSCodium from 1.95 to the most recent version, 1.96. Testing VSCodium Insiders did not resolve the issue either.
The text was updated successfully, but these errors were encountered: