Repository navigation
Implement reference streaming - #20346
Nick Snyder (nicksnyder) wants to merge 1 commit into
Conversation
|
Nick Snyder (@nicksnyder), thanks for your PR! By analyzing the history of the files in this pull request, we identified Johannes Rieken (@jrieken) and alexandrudima to be potential reviewers. |
|
Hi Nick Snyder (@nicksnyder), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
| * This allows RevealedReference to be passed around (i.e. to Controller) | ||
| * and updates to the reference can be seen. | ||
| */ | ||
| type RevealedReference = { ref: OneReference | undefined }; |
There was a problem hiding this comment.
I am unsure if the Controller should own the state of what is expanded & revealed or if the ReferenceWidget should own the state. Currently the ReferenceWidget does not retain a reference to the Controller and I am unfamiliar with the lifecycle, so this implementation has the ReferenceWidget owning this state and passing it through to the controller.
| * signaled by returning `undefined`, `null`, or an empty array. | ||
| */ | ||
| provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>; | ||
| provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken, progress: (locations: Location[]) => void): ProviderResult<Location[]>; |
There was a problem hiding this comment.
Two comments here:
- AFAIK this change is backwards compatible because we are adding the callback as a last parameter. VS Code controls all callers (so we can require it to be passed), but implementors of this function can ignore the progress parameter if they want.
- Unsure if
progressis the right name for this parameter. It is for intermediate results, not for reporting a percent completion. Wasn't sure if I should use the proposedProgress<T>type for this. Thoughts?
|
Hi, I am closing and re-opening this PR to bump the CLA bot. Sorry for the inconvenience! |
|
Hi Nick Snyder (@nicksnyder), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
|
I appreciate the effort but the concerns I have expressed in #20010 still exist and I still believe this should be tackled UX first before talking about APIs |
|
Johannes Rieken (@jrieken) Are you saying that maintaining the users state (e.g. expand/collapse/reveal) is not sufficient? (this PR does maintain that state). Running it locally, the UX proposed by this PR seems very reasonable to me. If you could run my branch locally and tell me concrete problems with the UX of what I proposed, then I can work on it. The demo extension has data streaming in very slowly so I could test each case. More than likely results would stream in much quicker. If you are abstractly worried about jittery UI, I could explore throttling UI updates, but that may actually increase jitter compared to allowing results to stream in one at a time. |
621aa79 to
b6a2d2f
Compare
56f1556 to
10f341a
Compare
0574c7a to
d0a8b03
Compare
d0a8b03 to
e1ca645
Compare
This is a backport of microsoft#20346 to our patch branch. I had to remove references to Map since the version of VS Code in our patch branch doesn't support that type.
This is a backport of microsoft#20346 to our patch branch. I had to remove references to Map since the version of VS Code in our patch branch doesn't support that type.
This is a backport of microsoft#20346 to our patch branch. I had to remove references to Map since the version of VS Code in our patch branch doesn't support that type.
|
Going to close this PR as it is out of date and I have a better proposal partially implemented. Will submit a new PR when it is ready. |
This PR implements the necessary changes in vscode to support streaming the response for "Find all references" requests as described in #20010 (please read this issue for complete context).
Streaming results makes reference requests more responsive for large repos since the user does not have to wait for all results to start seeing some results. If the user interacts with the reference results before they have finished streaming in, their position and state will be preserved.
Before merging: