dart-sdk/pkg/analysis_server_client
Danny Tuppeny 76dc2c4cfa [analysis_server] Change LSP-over-Legacy to be wrapped with the original protocol
Originally we didn't use the LSP Request/Response classes, and just exposed the handlers through the legacy request/response.

However there were some mismatches (such as legacy protocol always returns Map<String, Object?> but some LSP requests return Lists, LSP using int|String IDs, and LSP having numeric error codes that don't match legacy string error codes).

This change uses LSP's request and Response by wrapping them inside a standard (legacy) handler. The LSP-over-Legacy handler has become a standard handler, and the params contain an "lspMessage" field that holds an LSP message, and the result contains an "lspResponse" field that contains an LSP response.

If an LSP handler returns an error, it will be returned as an error inside the LSP response, which will be in a _successful_ legacy request (since that's how we can return an LSP response - as the result).

Change-Id: I67973590ab32f3543d1a6e1b7279974e5e8832bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315201
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 14:32:18 +00:00
..
example Migrate more of analysis_server_client 2021-04-02 23:36:52 +00:00
lib [analysis_server] Change LSP-over-Legacy to be wrapped with the original protocol 2023-08-06 14:32:18 +00:00
test Use utf8.encode() instead of longer const Utf8Encoder.convert() 2023-07-24 09:28:38 +00:00
analysis_options.yaml [analyzer] use package:lints for pkg/analysis_server_client, pkg/analyzer_plugin 2022-07-06 19:54:00 +00:00
CHANGELOG.md [pkg/analysis_server_client] deprecate the package and rev the version 2022-11-07 17:01:02 +00:00
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
pubspec.yaml Update SDK constraints for SDK packages. 2023-03-09 19:52:47 +00:00
README.md [pkg/analysis_server_client] add 'publish_to: none' to the pubspec 2022-11-08 20:00:46 +00:00

package:analysis_server_client is a client wrapper over the Analysis Server.

Update: this package has been discontinued

This package has been discontinued and will not receive further updates.

People who need similar functionality could:

  • continue to use the last published version; it should continue to be able to talk to the analysis server for the foreseeable future
  • fork the package and maintain that fork (we don't expect that the analysis server protocol will evolve significantly)
  • see if their use case could instead be satisfied by talking to the analysis server over the LSP protocol (dart language-server --protocol=lsp)

We welcome feedback about this at #50262; that would also be a good place to discuss alternatives.

Overview

  • Instances of Server manage a connection to an analysis server process, and facilitate communication to and from the server.

  • The Protocol library provides constants and classes to build requests for the server and decode responses and notifications from the server.

Example

The example uses the Server to launch the analysis server, analyze all *.dart files in the specified directory, display the results, and shutdown the analysis server.

References

For more about the analysis server, see the Analysis Server page.