Commit Graph

19 Commits

Author SHA1 Message Date
Konstantin Shcheglov dd3759d9cc Revert "Remove ServerService.LOG"
This reverts commit 41397cbb9a.

Reason for revert: Actually, we do use it in google3.

Original change's description:
> Remove ServerService.LOG
>
> It looks that it is not used. We have a way to turn it on in
> DartAnalysisServerService.java in Dart plugin for IntelliJ, but
> setServerLogSubscription is not used in the plugin, marked as to be
> used in the Flutter plugin, but actually is not used there.
>
> Change-Id: If851044385100543ec0ff30e02dee3d99f1558e4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219362
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,jwren@google.com,brianwilkerson@google.com

Change-Id: If5b807bf40adb8527aa801608fac6b1052adf67f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-05 02:18:28 +00:00
Konstantin Shcheglov 41397cbb9a Remove ServerService.LOG
It looks that it is not used. We have a way to turn it on in
DartAnalysisServerService.java in Dart plugin for IntelliJ, but
setServerLogSubscription is not used in the plugin, marked as to be
used in the Flutter plugin, but actually is not used there.

Change-Id: If851044385100543ec0ff30e02dee3d99f1558e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-04 22:56:26 +00:00
Konstantin Shcheglov 48c0eadb86 Migrate more of analysis_server_client
Added a few new methods to the listener, tests.

Change-Id: I477a17da3fd31db04c4960effee076680db62301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193895
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-02 23:36:52 +00:00
Konstantin Shcheglov c2d660d161 Migrate analysis_server and analysis_server_client protocol.
Change-Id: Ie0912627733f0481de0d3239647a4978e5327f12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-02 06:46:41 +00:00
Konstantin Shcheglov 66598d3e82 Switch analysis_server_client to language 2.12, so null safety, but opt-out files.
Protocol files are generated, so should be updated together with
analysis_server protocol files.

Change-Id: I8c3c7a5aecd2f7ff70c531bb794df3aed21888b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-31 03:34:22 +00:00
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
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>
2021-03-30 23:39:37 +00:00
Brian Wilkerson 93313eb244 Enable omit_loval_variable_types in analysis_server_client
Change-Id: I21271bfc6b2b7949fcafc5f91f23f8364697bcfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:59:07 +00:00
Brian Wilkerson d1e11f0881 Enable prefer_final_fields in three packages
Other than the updates to analysis options files, these changes are all
from dartfix.

Change-Id: I517b0601e36d5456960d81be9a429cbacf711141
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131342
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-13 05:32:14 +00:00
Brian Wilkerson 77434dad99 Remove unnecessary uses of new in analysis_server_client
Change-Id: I4aeae0785f95fd66e9fac542bff6ca5ebdfe481c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128846
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 18:53:46 +00:00
Brian Wilkerson c9d89d55a6 Stop generating unnecessary new and const in server generators
This doesn't remove other uses of new or const, only those that are
generated. I'll get the rest in other CLs.

Change-Id: I59c296da3d2da0f45789df156a682b9c37398087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 05:15:25 +00:00
Konstantin Shcheglov a2e9af92d2 Protocol for 'server.log' notification.
R=brianwilkerson@google.com

Change-Id: Ifed9a0f04ee961b217643b7236fce7a0067664cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114607
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-29 22:33:33 +00:00
Konstantin Shcheglov 4979a51a9c Add information about existing imports to completion response.
This adds quite a lot of information though, because we send many
strings.

Before: 20686 characters.
After:  55345 characters.

Theoretically we could do better, and send information about existing
imports only once as well, so when the user continues typing in a
single file, without touching imports, we don't send any new data
about imports (maybe just a confirmation that it is still the same).
But I'm not sure if this is a worthwhile optimization.

Actually, even included suggestion sets have similar property - they
don't change for a given file, unless there are changes to other
libraries which we might want to include.

R=brianwilkerson@google.com

Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 21:35:06 +00:00
lambdabaa d4b8e0696d Add the capability in analysis server protocol for clients to express
interest in receiving not yet imported code completions from specific
packages and libraries.

The design of this interaction aims to avoid forcing analysis server
to send every public symbol from dependent packages at every completion.
Instead, clients express interest in certain packages and/or libraries
and analysis server will notify with the entire set of symbols for
each of them only once. Then it is the client's responsibility to save
these pre-computed completions in memory, and analysis server can
instruct the client on how to union them with the base set of completion
suggestions at code completion time.

Bug: https://github.com/dart-lang/sdk/issues/35680
Change-Id: I42c6fddc5d8daa2b546daa81456c0992e3ef547d
Reviewed-on: https://dart-review.googlesource.com/c/90125
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 19:56:18 +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
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