Commit Graph

14 Commits

Author SHA1 Message Date
Danny Tuppeny e4362612b0 Add support for dynamic registration for LSP
Change-Id: I55c7b2f7d683acab0f6aa4bdbcba3b155d2de32c


Change-Id: I6a0b13856053bd86e77637b9664c7fe41194c5f3


Change-Id: I7472cf93efc29585ccbcbd1e6c7b9f703872b3c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103532
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-27 17:36:20 +00:00
Danny Tuppeny 4fc86d726f Fix some lints in LSP tests
Change-Id: Iff7e69d5d452a7bd405b727ab4966e1d71a89bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103531
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 17:54:03 +00:00
Danny Tuppeny be6bbfc06b Remove redundant error notifications from LSP server
Change-Id: Ie2b4ac3c348835ad817cb34f24cc9b4108f1076d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101989
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-09 18:09:31 +00:00
Danny Tuppeny 15f1fc212c Add a flag to allow only analyzing project folders that contain open files
Change-Id: I7239043292315871d77739858b8342c434ac837c
Reviewed-on: https://dart-review.googlesource.com/c/93430
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-04 10:29:16 +00:00
Danny Tuppeny f484e1b05e Call canParse() for all LSP requests before passing to handlers
Any requests with params that don't pass canParse() will result in an InvalidParams error being returned without the handler being invoked.

Change-Id: Ic3e84b9259a467179baa2309fb58ee207f1225fa
Reviewed-on: https://dart-review.googlesource.com/c/94298
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny 26d91cf4b6 If LSP initialize fails in tests, throw
Previously if a test didn't expect initialize to error (and didn't check for it), the test failure would be hard to diagnose. With this, if you don't explicitly opt-in to allowing failure, an error during initialize will just throw and fail the test.

Change-Id: I01283a70b3571415ec16f2fc4d781c08a953a6a1
Reviewed-on: https://dart-review.googlesource.com/c/94291
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny 0adc9a4853 Split helpers out of LSP base test into a mixin
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>
2019-01-21 16:06:28 +00:00
Danny Tuppeny e7b783ba5d Fix bug with deprecated rootPath + add tests
Change-Id: I53d0a9b9a367839cc4ecf463017463f343947dfc
Reviewed-on: https://dart-review.googlesource.com/c/88826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-09 16:04:12 +00:00
Danny Tuppeny 7d0823a97c Advertise the commands/code actions we support to the client
Change-Id: I08064742f6591a702955408f023b2534bd7a2887
Reviewed-on: https://dart-review.googlesource.com/c/86883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-12-11 15:13:57 +00:00
Danny Tuppeny 6ae01bacbe Tweak LSP test names
Change-Id: I74470c606e30775eb4efe3185551f6527268e9a1
Reviewed-on: https://dart-review.googlesource.com/c/85381
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-27 09:29:06 +00:00
Danny Tuppeny 285f7ddb1b Switch to using constants for LSP method names
Change-Id: I4fd1b4e192ec1d0e53a4b3d81e5fdb8c1bb40208
Reviewed-on: https://dart-review.googlesource.com/c/85380
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-26 17:01:29 +00:00
Danny Tuppeny 6f2fad87d9 Improve handling of errors
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>
2018-11-21 08:26:30 +00:00
Danny Tuppeny 257a6c8d2b Don't send error responses to $/ notifications/requests
The LSP spec says requests/notifications starting $/ can be ignored if they are not understood.

Change-Id: I6c0d011057b2f958c38fa2c4e92a1787944cb8d0
Reviewed-on: https://dart-review.googlesource.com/c/84902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-20 15:31:16 +00:00
Danny Tuppeny 90d2c4f406 Split tests out into separate classes
Change-Id: I279b2426d0a6ecc1d9e04677bbb8d93ceb9b2d64
Reviewed-on: https://dart-review.googlesource.com/c/83743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-08 17:11:15 +00:00