Files
sdk/pkg/analysis_server
Danny Tuppeny 803537682f [analysis_server] Provide LSP ClientCapabilities to LSP handlers reflecting the calling client instead of always the server
Prior to this change, all LSP handlers would ask the server for the client capabilities when they would affect their output. For callers over DTD, this could result in the same requests getting different results depending on the capabilities of the editor.

This change adds LspClientCapabilities to the MessageInfo that goes along with each message (usually a request) and then passes in the servers clientCapabilities for requests originating from the editor client, and a fixed set of capabilities for requests that come from DTD.

Most handlers will now use the callers capabilities, however there are a few handlers that build edits to send to the editor (instead of _returning_ the edits), which will use the editors capabilities.

This is essentially a no-op for now, because we're just providing the same capabilities via a different route - but when we come to supporting LSP handlers over DTD (that are affected by client capabilities), they will get consisted results based on our fixed set of capabilities (which as of yet is probably incomplete and may be updated a little as that progresses).

Change-Id: I5bcef8c3ebb7b94c83d85e56a303333d302abdee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-09-04 17:04:46 +00:00
..

analysis_server

A long-running process that provides analysis results to other tools.

The analysis server is designed to provide on-going analysis of one or more code bases as those code bases are changing.

Using the server

The analysis server is not intended to be used stand-alone, and therefore does not have a human-friendly user interface.

Clients (typically tools, such as an editor) are expected to run the analysis server in a separate process and communicate with it using a JSON protocol. The original protocol is specified in the file analysis_server/doc/api.html and Language Server Protocol support is documented in tool/lsp_spec/README.md.

Features and bugs

Please file feature requests and bugs at the issue tracker.