Skip to content
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

"Go to references" errors when there are no references #58

Closed
harrisont opened this issue Apr 26, 2023 · 0 comments
Closed

"Go to references" errors when there are no references #58

harrisont opened this issue Apr 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@harrisont
Copy link
Owner

harrisont commented Apr 26, 2023

Repro

Attempt to "go to references" of the 1 in:

.A = 1

Expected behavior

No references

Actual behavior

Getting references fails:

[Trace - 6:36:33 PM] Sending request 'textDocument/references - (34)'.
[Trace - 6:36:33 PM] Received response 'textDocument/references - (34)' in 60ms. Request failed: Request textDocument/references failed with message: Reduce of empty array with no initial value (-32603).
[Error - 6:36:33 PM] Request textDocument/references failed.
  Message: Request textDocument/references failed with message: Reduce of empty array with no initial value
  Code: -32603 

Internally, the error is:

TypeError: Reduce of empty array with no initial value
 at Array.reduce (<anonymous>)
 at getVariableReferences (server\src\features\referenceProvider.ts:94:10)
 at Object.getReferences (server\src\features\referenceProvider.ts:34:24)
@harrisont harrisont added the bug Something isn't working label Apr 26, 2023
@harrisont harrisont pinned this issue Apr 26, 2023
@harrisont harrisont unpinned this issue Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant