-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Add streaming support in vscode #105870
Comments
tagging @gundermanc who did the VS side work of updating UI incrementally for VS Search. he can provide more detail info but it does things like
and that gave so far very nice experiences to VS. you can try by "Ctrl+Q" in VS. |
For
Roslyn, for example, uses this guarantee to do a long-running brute-force search through all symbols in the project, evaluating in order of likelihood of a match (recent projects, close-by projects, etc). This means that the majority of the time, the symbol is found instantly, but in some cases you may have to a wait a few seconds for it to be found. GoTo: Symbol and file navigation only box in VS.
Ctrl+Q/VS Search: Search aggregation 'global search' box in VS for menu commands, options, templates, files, and symbols.
Doc with more detailed aggregator architecture for Microsoft internal viewers: https://microsoft-my.sharepoint.com/:w:/p/chgund/EWPw43pfMghFj9LCcj2K8gYBTJKGoz5ETKWKIRraTeaqnA?e=1awZO6 |
another asks from users related to streaming. (microsoft/pylance-release#2236) basically, user has multi-language workspace and do not want one LS to slow down whole "go to symbols" experience. streaming support will improve the experience since it won't let vscode be blocked by any one LS. |
@jrieken while providing full streaming support is a super complex task, would it be feasible to consider it for workspace symbols only, at least as a "first priority"? 🤔 |
I think workspace symbols is the only feature currently that is workspace wide but also, doesnt have any semantic scoping. for example, other workspace wide features such as find all references, rename, peek referenecs, rename files only work on files where there are semantic dependencies (in other words, find all references on python symbol won't search java, ts, and etc files even if they are in same workspace), but workspace symbol will search all of them. so, if we need to choose one, it will be workspace symbol that require streaming at least. |
Sharing some thoughts from the Java team, streaming support is extremely useful for several cases |
It seems there was a confusing with workDoneProgressParams and workDoneProgressOptions. [workDoneProgressParams](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgressParams) is the type used for the token in methods and notifications, it is the token itself, so it has type str | int. This type is correct, this was to explain context. [workDoneProgressOptions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgressOptions) is the type used for registration, it is used to indicate if work done progress are supported, so it is a boolean. This type was wrong. It seems as of today vscode does include workDoneProgress in requests: - microsoft/vscode-languageserver-node#528 (comment) - microsoft/vscode#105870
It seems there was a confusing with WorkDoneProgressParams and WorkDoneProgressOptions. [WorkDoneProgressParams](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgressParams) is the type used for the token in methods and notifications, it is the token itself, so it has type str | int. This type is correct, this was to explain context. [WorkDoneProgressOptions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgressOptions) is the type used for registration, it is used to indicate if work done progress are supported, so it is a boolean. This type was wrong. It seems as of today vscode does include workDoneProgress in requests: - microsoft/vscode-languageserver-node#528 (comment) - microsoft/vscode#105870
In our case |
What is the current status of this request, please? For Hack LSP, we wish to add streaming support to textDocument/references. For some of our large projects, we can compute the first few references within milliseconds but it takes P95=2mins until we've computed the final references. We would love to display the first few references quickly. |
In gopls there's a tension in our completion logic between latency and search depth. Being able to stream results would eliminate that tension. |
Dart has this dilemma too. Users expect code completion to include all symbols including those that have not yet been imported into the current file (they will auto-import when selected), but this full list is much more expensive to compute. The result is that we assign a time budget and stop building completions after that time (because otherwise completion could appear very slow), but this has the result that completion results can appear inconsistent (particularly on slower machines). What I'd really like to do is send all of the locally imported items first (which can be computed very quickly) because most likely the user wants something from that list, but still be able to provide the larger list. Using |
For our internal LSP at Uber we would love to have this as well to avoid delays from the native LSP's, in favor of our much faster cached results. cc @isidorn |
Recently, the Go and Dart LSP teams at Google discussed our wish list for LSP+VS Code features. At the top of this list were:
In combination, we feel those three could help us deliver a much more responsive and rich language experience. Is there anything we can do to help these get prioritized? |
this is a conceptually dup of #20010. creating a new issue since the previous one is closed and that one is using custom streaming support rather than official streaming (partial results) support added to LSP.
Language Server Protocol has added partial results (streaming) supports (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#partialResults) and VS has already added support for it.
As long as I know, the support is added to LSP since it was one of the top complaints from VS users, especially from people who have large codebases.
For example, Finding Symbols from the workspace (WorkspaceSymbol) can easily take several seconds for big codebase and return a lot of results, Streaming takes the same amount of time to get full results, but most of the time, users get what they want before getting full results. so rather than users get the worst-case scenario all the time, streaming reduces the time users have to wait.
VS has FULL SUPPORT for streaming.
(Find all references, Document symbols, document highlights, Pull model diagnostics, workspace symbols and completion)
So they even support partial results (streaming) for document-level features such as "Document Symbol", "Document Highlights" and etc.
but, we (Python LS for vscode - Pylance) are not asking that much, but at least support for workspace-wide features such as "Workspace Symbol", "Find all references", "Call Hierarchy" and etc.
We do understand streaming (partial results) requires an incremental update of UI and that is not easy (flickering, ordering, sizing, grouping, etc issues). I believe VS had that issue as well when they started adding streaming supports (even before LSP), but once it is done, I believe they got a lot better at supporting large codebase.
The text was updated successfully, but these errors were encountered: