d3c06c4822
This fixes https://github.com/dart-lang/sdk/issues/55889 which is repeat of https://github.com/Dart-Code/Dart-Code/issues/3929 (but semantic tokens was not fixed with that CL). The issue was when the server was initialized with no roots (for example an empty workspace) and then a new file opened with requests being sent immediately before the roots were updated. The fix changes from directly calling `server.getResolvedUnit` to instead using `requireResolvedUnit` which handles this situation by waiting for any in-progress context changes and retries. Fixes https://github.com/dart-lang/sdk/issues/55889 Change-Id: Id078947e5c6665b2afb9e31adc244f16987870f0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369464 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com>
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.