dart-sdk/third_party/pkg/language_server_protocol
Danny Tuppeny 2b713a9e4e [analysis_server] Add experimental TextDocumentContentProvider support for virtual documents
This adds support for serving the contents of virtual files to the client over a custom LSP protocol (based on the VS Code API of the same name). This is currently a custom Dart protocol but hopefully very close to something that could become standard LSP in future.

If the client advertises support for this feature (currently with an experimental flag "supportsDartTextDocumentContentProviderEXP1") we will return the set of URI schemes we can provide content for (currently "dart-macro-file"). Additionally, we will map internal analyzer macro paths (like `/foo/bar.macro.dart`) onto that scheme (`dart-macro-file://foo/bar.dart`) instead of standard `file://` URIs.

Overlays are not created for these kinds of files (because they would override the server-generated content).

Some language functionality "just works" because we can get resolved ASTs for the macro files (and many LSP features operate on these), but more testing (and tests) are required.

Included are tests for the virtual file methods (and events) and Go-to-Definition. Tests for other features are outstanding.

Change-Id: I2056699652873a12b730f565b823f187f883a1ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-18 17:34:43 +00:00
..
lib [analysis_server] Add experimental TextDocumentContentProvider support for virtual documents 2024-01-18 17:34:43 +00:00
LICENSE [analysis_server] Move language server protocol to third_party 2023-10-10 07:48:30 +00:00
lsp_meta_model.json [analysis_server] Update generated code to match latest spec 2023-12-05 19:58:47 +00:00
OWNERS Add OWNERS for third_party/pkg/language_server_protocol 2023-10-11 14:55:31 +00:00
pubspec.yaml [analysis_server] Move language server protocol to third_party 2023-10-10 07:48:30 +00:00
README.md [analysis_server] Move language server protocol to third_party 2023-10-10 07:48:30 +00:00

The language server protocol

The contents of LICENSE is are downloaded from:

https://microsoft.github.io/language-server-protocol/License-code.txt

The file lsp_meta_model.json is downloaded from:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/metaModel/metaModel.json