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

No textDocument/references LSP message is sent to extensions when references-view.find is not used on an identifier #77617

Closed
sean-mcmanus opened this issue Jul 19, 2019 · 11 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jul 19, 2019

  • VSCode Version: 1.36.1
  • OS Version: Windows (others)

Bug: Our C/C++ extension needs to do vscode.commands.executeCommand("references-view.find") in order to re-send reference results after we have already sent our "preview" references from the initial textDocument/references, but VS Code is early aborting the references-view.find if the cursor is not on an identifier (otherwise it works). This breaks out ability to stream/preview references results back to users, which is bad because the final result could take many minutes, but the preview results may be usable and sufficient.

However, I believe we can workaround this via repeatedly trying the command until the users move their cursor on an identifier and updating our progress message to tell users they need to move their cursor to an identifier get the final references results -- it's just a strange thing to have to inform users about.

UPDATE: I got it working – the experience seems acceptable – in the somewhat unusual case where the user moves their cursor to an invalid Find All References location (i.e. not an identifier) then the progress message appends “Move your cursor to any identifier to get results”.

@bobbrow
Copy link
Member

bobbrow commented Jul 19, 2019

Ideally, we could use this for Find all References so we can get partial results streaming without this hack.

(Adding @dbaeumer to the discussion)

@dbaeumer dbaeumer assigned jrieken and unassigned dbaeumer Aug 5, 2019
@dbaeumer
Copy link
Member

dbaeumer commented Aug 5, 2019

@jrieken assigning to you since this is not under the LSP control. We only send a server request if the reference provider is called in the VS Code extension API.

@jrieken
Copy link
Member

jrieken commented Aug 5, 2019

/duplicate of #20010

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 5, 2019
@vscodebot
Copy link

vscodebot bot commented Aug 5, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Aug 5, 2019
@sean-mcmanus
Copy link
Contributor Author

Yeah, this won't be an issue any more after proper streaming is enabled, but I still think this is a VS Code bug with "references-view.find" -- it doesn't repro with Peek References, i.e. editor.action.referenceSearch.trigger.

@jrieken
Copy link
Member

jrieken commented Aug 7, 2019

but I still think this is a VS Code bug with "references-view.find"

Disagree - I think its fair not to try search for references when the cursor is on whitespace. Anyways, while we are the land of hacks and workaround. Why aren't you using the references-view.refresh-command to update/refetch the result list?

@sean-mcmanus
Copy link
Contributor Author

Thanks a lot -- that fixed the issue. I thought I had already tried that and it didn't work, but I was mistaken.

@sean-mcmanus
Copy link
Contributor Author

sean-mcmanus commented Aug 8, 2019

Is there a way to refresh with Peek (editor.action.referenceSearch.trigger) or should I file a feature request for that? When we do that without moving the cursor it causes the Peek UI to disappear if it's visible, so we can't reliably refresh it (and the position moves if the cursor has changed) -- our workaround is to disable the "preview" ability for Peek References.

@jrieken
Copy link
Member

jrieken commented Aug 8, 2019

Is there a way to refresh with Peek (editor.action.referenceSearch.trigger) or should I file a feature request for that?

No and please don't invest energy in workarounds when #20010 is what you need.

@bobbrow
Copy link
Member

bobbrow commented Aug 8, 2019

It looks like #20010 is closed. Is there another issue we should be tracking?

@jrieken
Copy link
Member

jrieken commented Aug 8, 2019

We closed this last year as 'out-of-scope' because it was on our 6-12 months roadmap. The issue can be commented on, and if we agree that's what we need can be re-opened.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants