This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.
Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When the server fails to start up (writing to stderr) the tests currently would just hang waiting for responses to messages. This will just throw the message as an exception, failing the test with a more useful message, for example:
```
00:07 +0 -1: ServerTest | test_exit_afterShutdown [E]
Analysis Server wrote to stderr:
file:///Users/dantup/Dev/Google/dart-sdk/sdk/third_party/pkg/linter/lib/src/analyzer.dart:106:27: Error: The method 'registerDefault' isn't defined for the class 'Registry'.
- 'Registry' is from 'package:analyzer/src/lint/registry.dart' ('file:///Users/dantup/Dev/Google/dart-sdk/sdk/pkg/analyzer/lib/src/lint/registry.dart').
Try correcting the name to the name of an existing method, or defining a method named 'registerDefault'.
Registry.ruleRegistry.registerDefault(lint);
^^^^^^^^^^^^^^^
```
Change-Id: If64b68b17a0d379f8879891f0346704d4ad360e8
Remove unused imports
Change-Id: I745499f7b038c81320c127410967d939c7756e51
Reviewed-on: https://dart-review.googlesource.com/c/94222
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
This tests we can spawn the diagnostic server on-demand. The test was previously marked failing because it needed to be a real inrtegration test.
Change-Id: I52638682d7fb1807584601f7ff933f30b1bd6d70
Reviewed-on: https://dart-review.googlesource.com/c/93949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
This splits the helper functions out of the abstract base test, which will allow them to be reused in integration tests that have their own transport (real stdio to a process).
Change-Id: I7777dc873582b4bacd91d998fed740ada47bd2b0
Reviewed-on: https://dart-review.googlesource.com/c/90062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This adds a new type of error for when a client request to edit a document
is not valid because the document offsets don't match up. In this instance,
the client/server are out of sync and we shouldn't try to continue as we
may produce edits that ruin the users work. The server checks errors being
sent to the client and if it sees this type of error will switch to a state
that requests all messages, send a logMessage and then shut down after a few
seconds.
The LSP spec has been updated to suggest that clients automatically restart
servers if they quit unexpectedly (though advising not to do it forever in
the case of a crash at startup).
Change-Id: I7beafc87a082b971600135a4cc76eae53f5d9443
Reviewed-on: https://dart-review.googlesource.com/c/87841
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Don't send raw errors in showMessage, send a generic message and put the rest in a log (this is to stop dart exceptions being shown unexpectedly in error popups in the editor).
Change-Id: Ie919d0efe098dfde5de1e25cb8718d37b22f9673
Reviewed-on: https://dart-review.googlesource.com/c/84906
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>