-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Returning empty array for onReferences() throws a TypeError #92072
Comments
@sgranade Doesn't sound like a bug with your language server to me. What do you see in your VS Code's "References" view? Do you at least get a |
Yeah, I get a "No results found." message like I should. |
To me neither. I check the LSP code and a empty [] is converted into an empty []. Even Moving to https://github.com/microsoft/vscode-references-view |
@jrieken I cannot move to the issue to https://github.com/microsoft/vscode-references-view. Any idea what could cause the exception in the references view code. I did a quick check of the code but couldn't detect a code path that would cause this. |
🤷♂ idk - the viewlet should be able to handle the empty case, e.g that's what you get when search for references on a keyword or string. Are those steps above all it takes to reproduce? Can someone create a repo with just vscode.d.ts API being used? |
I tried this in my testbed and both returning |
I swear it (didn't) work earlier on the minimum version I posted. Let me go back to my full extension and trim back until I confirm. |
OK, let me know as soon as you have found out something. |
I've put together a test repo that reproduces the issue. You'll need to compile the extension, debug it, open a .txt file, place the cursor in the middle of a word, and press |
I can reproduce this: @jrieken OK to move to VS Code or is there a special repository for the references view? |
@sgranade thanks for the repro case! |
@jrieken I checked an the LSP clients returns an empty array as well in this case. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@dbaeumer I think this was closed in error. |
references viewlet issues are in the "main" repo |
@jrieken. Thanks. Moving. |
Thanks for the good repo. |
In my language server implementation, if I return an empty Locations array, null, or undefined from a call to onReferences(), then a TypeError is raised.
This results in the following:
Is this an issue with the language server implementation or a VS Code issue?
Setup:
The text was updated successfully, but these errors were encountered: