Commit graph

27 commits

Author SHA1 Message Date
lambdabaa b767744cfc Add optional elementUri field to CompletionSuggestion types in analysis server protocol
This will enable clients such as IntelliJ to display the package which code
completions are being offered from in addition to the keyword or identifier
that they're already getting from analysis server.

R=brianwilkerson@google.com

Change-Id: I30311451ad56b4eddbe73da20641ee0d14849293
Reviewed-on: https://dart-review.googlesource.com/c/88744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-01-09 00:13:39 +00:00
Paul Berry a84863253c Re-apply "Add AnalysisDriver.resetUriResolution() and use it for analysis.reanalyze request."
Original change's description:
> Add AnalysisDriver.resetUriResolution() and use it for analysis.reanalyze request.
>
> This CL changes "analysis.reanalyze" API. We decided to repurpose it. It was not
> used for some time now in IntelliJ, and AFAIK has never been used in VS Code.
>
> R=​brianwilkerson@google.com, paulberry@google.com
>
> Change-Id: I7510b0189197c9f3f848b0fc59a7b2bd22889ac7
> Reviewed-on: https://dart-review.googlesource.com/c/85523
> Reviewed-by: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

Change-Id: I828c9a77f1e28d44c00bfcf39527514e39cccc42
Reviewed-on: https://dart-review.googlesource.com/c/86221
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-12-06 23:14:28 +00:00
Dan Rubel 784ad29470 Update dartfix to check analysis server protocol version
This updates dartfix to more narrowly verify the analysis server
protocol version and print instructions for the user if the protocol
version expected by dartfix is incompatible with the current Dart SDK.
This is necessary because the edit.dartfix protocol is experimental
and will continue to evolve.

Change-Id: Ib31eb594a8a94416cb4fc676e7da9150f8c99b6a
Reviewed-on: https://dart-review.googlesource.com/c/84780
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-19 21:14:28 +00:00
danrubel e39fa29bd6 analysis_server_client API tweaks before publish
* Rename ClientListener to ServerListener
* Change ServerConnectionHandler on --> implements NotificationHandler

Change-Id: I459e4c566971d49790e12b8f1386ae80db33b38b
Reviewed-on: https://dart-review.googlesource.com/c/84560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-15 21:44:03 +00:00
Devon Carew 23980a34a6 Fix a typo.
Change-Id: I3784a67987a5f4d56301c7ced9f9bcc31ff3fd03
Reviewed-on: https://dart-review.googlesource.com/c/84540
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-11-15 18:45:09 +00:00
Dan Rubel bec2daba02 Cleanup analysis_server_client API
This reduces the client functionality and renames some
of the classes and methods in the API.

Specifically:
- rename Server to Client
- rename ServerConnectionHandler to ConnectionHandler
- rename Client.start to Client.startServer
- rename Client.stop to Client.stopServer
- rename Client.kill to Client.killServer
- extract behavior from Client into Listeners
- move some of the listeners into dartfix
- make several Client fields private
Change-Id: Ie71b0ac55b489099a848764251e8369c27f6ea2d
Reviewed-on: https://dart-review.googlesource.com/c/84460
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-15 15:06:55 +00:00
danrubel 552b25084e Generate NotificationHandler dartdoc and add server tests
Change-Id: Iec977015ae89e2a703e9013fb7b6969043554afc
Reviewed-on: https://dart-review.googlesource.com/c/84080
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-10 01:16:14 +00:00
Dan Rubel aa8cc30e5c Update ServerConnectionHandler to check the protocol version
... as well as reworking the example to use notification handlers and
addressing comments in https://dart-review.googlesource.com/c/sdk/+/83520

Change-Id: I27959cba79953d95d1afd851ab6a5f137dff47db
Reviewed-on: https://dart-review.googlesource.com/c/83580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 21:10:06 +00:00
Dan Rubel d502ba6014 Add new analysis_server_client handlers
* Make the NotificationHandler a mixin
  and move it to /lib/handlers

* Add new notification handler mixins
  - AnalysisCompleteHandler
  - ServerConnectedHandler

* Add Server.stop method

.. and address comments in
https://dart-review.googlesource.com/c/sdk/+/83180

Change-Id: I94ba657f20520ae4bb0e479a014c11509eeb9d2c
Reviewed-on: https://dart-review.googlesource.com/c/83520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 21:10:06 +00:00
danrubel 7e6a39fd91 Generate analysis server notification handler
... and generate the analysis server protocol version

Change-Id: I585e50cc854d5ae1aa7440a14f856c983bbfc93a
Reviewed-on: https://dart-review.googlesource.com/c/83180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-06 23:04:53 +00:00
Dan Rubel a074bcf93c Update dartfix package for publication
Updates to dartfix for publication including:
* add changelog, readme, and license
* update pubspec version and executables

along with a collection of smaller changes including:
* test cleanup
* remove duplicate time value from verbose output
* read dartfix pubspec version and pass that to analysis server

Change-Id: Ifa94df45e6cbcf9a98f7bf393c22e06eaab48c38
Reviewed-on: https://dart-review.googlesource.com/c/82240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-31 17:36:51 +00:00
Dan Rubel c580e8cac6 Cleanup analysis_server_client package
Clients may now optionally add clientId and clientVersion information
when starting the analysis server.

In addition, this CL adds an example of how to use this package
and updates the changelog, readme and pubspec.

Change-Id: I969a13a7d8379d6289fbbbc5f8d1b66315aa6a37
Reviewed-on: https://dart-review.googlesource.com/c/82165
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-31 14:56:10 +00:00
Dan Rubel 6294171508 comment cleanup
Change-Id: I83bf6513b1acd9faedb14f1bf44e32df76dd8528
Reviewed-on: https://dart-review.googlesource.com/c/82164
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-31 14:25:35 +00:00
Dan Rubel 645ec2e8b5 Meld server runner in dart fix with analysis_server_client
Change-Id: I86a2e7b815ff6d3beea2d968c5e34c4e3feae2c3
Reviewed-on: https://dart-review.googlesource.com/c/82080
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-30 20:04:58 +00:00
danrubel 0fe448a996 Revise the analysis server edit.dartfix protocol
This updates the edit.dartfix protocol to separate location from the text
describing the changes so that the dartfix client can choose
what location information to display and how it should be displayed.

Change-Id: Ic56a4cb187538571d60136d6de9265d879fccb53
Reviewed-on: https://dart-review.googlesource.com/c/81780
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-29 01:50:27 +00:00
Dan Rubel b8fd29e0bb Remove dartfix dependencies on analysis server
This replaces dartfix dependencies on ...
* analysis_server
* analyzer (except for testing)
* analyzer_plugins

... with a dependency on analysis_server_client.

Change-Id: If511de69333e925ae082fa06c5114188c3c405b1
Reviewed-on: https://dart-review.googlesource.com/c/81342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-24 19:26:58 +00:00
Dan Rubel 3dc911909b Generate analysis_server_client protocol_generated.dart and related protocol files
Change-Id: I9a9af0ee37eab87a5c3e83cba638d855a2e1121b
Reviewed-on: https://dart-review.googlesource.com/c/81341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-24 17:09:39 +00:00
Dan Rubel 34d0801008 Generate analysis server protocol consts in analysis_server_client
Change-Id: I86c1f7ce98d2c1424c9b77c66fa48c6fa1ba354b
Reviewed-on: https://dart-review.googlesource.com/c/81340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-24 15:37:21 +00:00
Kevin Moore 4d5c5ecdbf Update synced version of pkg:test
Also updated the package references in a number of pubspecs to
more closely align with the package versions that are in the SDK

Change-Id: I061951587befa4211ac7455cf1179911eb07efc0
Reviewed-on: https://dart-review.googlesource.com/c/79920
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-10-16 16:12:38 +00:00
Brian Wilkerson d5ccb53f01 Remove more uses of isInstanceOf
Change-Id: Ib2fc1081b793ac3dbd39889b04c6af3a8f4fac8d
Reviewed-on: https://dart-review.googlesource.com/63684
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-03 20:32:26 +00:00
Brian Wilkerson a6ad152315 Fix constant-related deprecation warnings in analyzer packages
Change-Id: I6e4186d2a877275db2f04881a6aa6d154d4f8693
Reviewed-on: https://dart-review.googlesource.com/55820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-17 21:24:38 +00:00
Brian Wilkerson 824f123a8d Clean up some hints
Change-Id: If20a9f76cfa50f7977182b1a613ed74e508fed97
Reviewed-on: https://dart-review.googlesource.com/48441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-26 17:39:18 +00:00
Brian Wilkerson db6e377e6d Make analysis_server_client Dart 2 safe
Change-Id: Iab06cb5b779599a1a107fa6fdf832345950fa84c
Reviewed-on: https://dart-review.googlesource.com/48322
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-25 15:20:36 +00:00
Brian Wilkerson 602a8c2a7b Clean up usage of deprecated constants
Change-Id: I9005ba6e94529e15d8f7b21322591f4a9dabec47
Reviewed-on: https://dart-review.googlesource.com/45763
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-09 01:02:49 +00:00
Mike Fairhurst e2f4e6c1c9 Update mockito to be compatible with latest analyzer void changes
Change-Id: I94d8a4eae413df7a5daf5e5da0e42d1de74f43e3
Reviewed-on: https://dart-review.googlesource.com/39847
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-07 23:32:41 +00:00
Max Kim bd8d28dddd Test failing fix. Stdin is mocked to avoid the typing issue; not critical for this unit test.
BUG=
R=regis@google.com

Review-Url: https://codereview.chromium.org/2996703002 .
2017-08-08 19:00:37 -07:00
Max Kim 4e42dbc1f9 Add analysis_server_client without analysis_server.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2994723003 .
2017-08-08 14:57:43 -07:00