Commit graph

139 commits

Author SHA1 Message Date
Brian Wilkerson 7070347bbb Generate single quoted strings where possible
Change-Id: I27546bbfb85f78021e515d00c2531b83b47fc71f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-20 21:52:34 +00:00
Brian Wilkerson fa68a938fe Enable 4 lints in analysis_server_client
Change-Id: I654ab282326f54d40ec5a7d93076584c73c29bf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132458
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-18 22:08:30 +00:00
Brian Wilkerson a0487f0f90 Enable slash_for_doc_comments in analysis_server_client
Change-Id: I2db2a7e3af6841ecc565c57a82bceac7bd892d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132454
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-18 20:04:50 +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 e5705943d8 Enable prefer_conditional_assignment in several packages
Other than the changes to the code generators and the analysis options
files, the changes were all generated by dartfix.

Change-Id: I80055e3992452c5b40eed41ac79807cf5c932976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-06 05:19:19 +00:00
Brian Wilkerson fbadd6a832 Enable prefer_equal_for_default_value in several packages
Other than the changes to the code generators and analysis options files,
all of these changes were produced using dartfix.

Change-Id: I24f47b9f6b929b0b5d5e08da7ef2016f4bdc4108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-05 20:59:19 +00:00
Brian Wilkerson c08cdb5a78 Enable avoid_return_types_on_setters in analysis_server_client
All changes (other than analysis_options.yaml and the change to the generator) made via dartfix.

Change-Id: I7b186371e22048ceddf6fd4407a66aba8b96480c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-02 04:55:38 +00:00
Brian Wilkerson 91d6e1a0a7 Enable annotate_overrides in several packages
Other than analysis_server/test/analysis/notification_overrides_test.dart,
which had a naming conflict, all of the changes were made using dartfix.

Change-Id: I911dd75dcdee00420caa48724125e86d47c8857d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130002
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-01 21:31:40 +00:00
Brian Wilkerson 7d41ae7d15 Enable unnecessary_this in several packages
Change-Id: I743066d66dbf1dff984e8f8bf5b7a472c9bc7ff7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-28 20:43:16 +00:00
Brian Wilkerson e2431d1452 Update the generators to not generate unnecessary uses of "this"
Change-Id: I20d15e3b0f8046065906d96860073ad4cf353868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129815
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-28 16:23:06 +00:00
Brian Wilkerson 278551426e Enable prefer_adjacent_string_concatenation in most of the packages
Change-Id: I4d061710573c63a9db700c6156470705cf4f8548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129762
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-27 17:03:35 +00:00
Brian Wilkerson c547f5d933 Enable prefer_generic_function_type_aliases in most of the packages
Change-Id: I1338e731aa3f42f67fec605b20455a83fd5fce43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-27 00:43:14 +00:00
Brian Wilkerson 1fe55651cb Generate end-of-line doc comments in server and plugin packages
Change-Id: I1d5517932e1c78744cfe43fc6a768a104e527091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129520
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-24 00:34:30 +00:00
Brian Wilkerson d57ce215da Remove unnecessary uses of const in analysis_server_client
Change-Id: Ia2eeb1a7ded3fa3cd0c429581dce9e5e72aaf1f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-19 01:51:43 +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
Brian Wilkerson 2e1dd98e5e Create burndown lists for enabling the pedantic lints
Change-Id: Ie57ea31912ba4d702b82ffd327889044988b1ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-15 21:58:36 +00:00
Brian Wilkerson affd81b143 Remove preview from dartfix api in favor of opening the preview automatically
Change-Id: I7f2dd4c97a99ec9e2d28f2a06778c247150a0632
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128286
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-13 22:42:56 +00:00
Brian Wilkerson 11049992d5 Update the server protocol to not require a port number
Only spec_input.html was changed, the rest of the files were regenerated.

Change-Id: Ib4644f811d86c46da6d01c601107ede8537e39df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128366
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-13 18:45:41 +00:00
Brian Wilkerson afde51a608 Start sending urls for preview mode from server to dartfix
Change-Id: Ice8463ec9a5d3d21b47e6250f24d093a48b11b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127988
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-11 14:26:29 +00:00
Brian Wilkerson 2310768468 Prepare to publish analysis_server_client so that dartfix can use the new API
Change-Id: I677d7158e587b68a29b7cacef9acc9e1cf2597af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127962
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-12-11 14:26:21 +00:00
Brian Wilkerson 4ce13659b4 Update server API to allow URLs to be returned to dartfix
Change-Id: I252ee50b811409aa2eed7d0579c01676160acfca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127940
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-10 19:39:29 +00:00
Konstantin Shcheglov 30690b1526 Issue 39357. Catch FormatError and report FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION.
Bug: https://github.com/dart-lang/sdk/issues/39357
Change-Id: Ia0d5eb7907dbe16ad03dd70a4f3ede226c2edaaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125129
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:41:55 +00:00
Sam Rawlins 7db3b15a48 Update changelog for analysis_server_client 1.1.2
Change-Id: Ic38c7bf0bd4176f569dce201fe3e3ea9c0869438
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-11-01 16:59:32 +00:00
Brian Wilkerson c0163f15a5 Add an optional port to the dartfix request to allow changes to be previewed
Change-Id: I6f7a8f880883195fd6558f5533f82da416c777bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-29 17:16:34 +00:00
Mike Fairhurst a3ca5c3c54 [analysis_server] remove session id from connected params
Change-Id: I313d3f0b0c5df2148a3cbceddd4db54fecdc74a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122082
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-10-25 23:14:53 +00:00
Brian Wilkerson dd83ded1e9 Add output directory field to dartfix API
Change-Id: Ia2dc3e4d3a458f43e9f2b0c1a25418f10931920c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117442
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-09-16 22:51:21 +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
abykov2 e5b0ff494b Adding an offset field to TokenDetails to return token offset as part of listTokenDetails
Closes #38013
https://github.com/dart-lang/sdk/pull/38013

GitOrigin-RevId: f384b20a96950238a50a95420b264100de5bbbe4
Change-Id: Iabca2d4ac89f07424439ab5bba2156860aab2c81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114587
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Alex Bykov <abykov@google.com>
2019-08-27 17:52:38 +00:00
Konstantin Shcheglov 2b31e41564 Remove 'docComplete' and 'docSummary' from AvailableSuggestion.
They contribute to much size of available suggestions, and not
used in IntelliJ.

R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/dart-lang/sdk/issues/37816
Change-Id: I9c28020dc528980ee9efef3820c2acf679405ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-22 20:16:46 +00:00
Devon Carew f53388b50d [analyzer] enable implicit-casts: false for several projects
Change-Id: Idd7ed77756d93a94f637dcc4abd7e0403a2f6d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112703
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-13 16:26:41 +00:00
danrubel 1c5911982e add includePedanticFixes flag to dartfix protocol
Change-Id: I43c40eacf038beed6245ec873e746dcbb1ed80df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-05 20:18:05 +00:00
Konstantin Shcheglov cdf6103b38 Support for free-form 'expression' in FlutterWidgetPropertyValue.
Also add ENUM_LIKE property editor, that is like ENUM, but allows
such free-form expressions.

R=brianwilkerson@google.com

Change-Id: I3910b6bea98110c192b6cc9fb716b73270e1d97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111985
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-05 18:43:29 +00:00
Konstantin Shcheglov 202379aaee Implement getWidgetDescription and setPropertyValue in Flutter domain.
R=brianwilkerson@google.com

Change-Id: I45fdb0121bdd067856e5c9e72466d9a5c1a00e55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109313
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-16 21:32:37 +00:00
Konstantin Shcheglov 65f8cd4365 Start implementing widget properties.
Only self properties for now.

No compound properties.

No virtual Container properties.

R=brianwilkerson@google.com

Change-Id: Icd61f45ecc95c45037c3998a927eb267fd13c4cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-15 21:06:56 +00:00
Konstantin Shcheglov f0b119c1b4 Add nameLocation/valueLocation to FlutterOutlineAttribute.
R=brianwilkerson@google.com

Change-Id: Ib73c5a01013516232f78f1ffa89bff005976e632
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109060
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-15 14:50:59 +00:00
Konstantin Shcheglov a917043332 APIs for editing Flutter widget properties.
Change-Id: I602ea1a873f17a9bf47f1a77fb3af5b206464d6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-07-11 20:38:24 +00:00
Konstantin Shcheglov ad6b1ebbd6 Support for 'double' fields in protocol.
R=brianwilkerson@google.com

Change-Id: If8dacd4578e01380f4d9e4ce1f809b9485bffc7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-09 18:09:47 +00:00
Konstantin Shcheglov 8a1dcdae68 Graduate 'flutter' domain from experimental, remove unused methods and fields.
We could also remove FlutterCorrections, because right now we don't
use it, but we will restore it soon as we get new Flutter domain
methods.

R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I084fe5acbe5d854673c7247d734aeca1f8d721af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-08 22:03:24 +00:00
Brian Wilkerson c41e9ae0e8 Fix wording in spec
Change-Id: I468d0afa21102fc6fe6f30aa1c7bd0d1c46d8f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-10 17:24:35 +00:00
Brian Wilkerson 065c42705c Added an errors field to allow permissive mode to display the exceptions that are being ignored
Change-Id: Id8fd27a7882c6dd20854d055477af25d17de3582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-06-07 19:32:35 +00:00
Konstantin Shcheglov 37b714401d Add AvailableSuggestion.declaringLibraryUri
We need this to support existingImports filtering, because filtering
is done on suggestion basis, not on the whole suggestion set basic,
because of re-exports.

R=brianwilkerson@google.com

Change-Id: Id97cb122fa6e3c5c62e367098e1917eba997a76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104808
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 01:20:51 +00:00
Konstantin Shcheglov 519ddc1ac4 Document that AVAILABLE_SUGGESTION_SETS also turns on existingImports.
R=brianwilkerson@google.com

Change-Id: I053c68eb541358f0bbd891ca16f1c5628e701096
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 17:27:03 +00:00
Jaime Wren 03e415a4e8 Update the hover 'containingLibraryName' to not include the 'file:///' prefix.
This is a follow up on a comment in the previous change https://dart-review.googlesource.com/c/sdk/+/103481/.

Change-Id: I0f377d6c7d68d55464a4e111a6a65715a82e0591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103546
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-24 21:54:56 +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
Jaime Wren cd2188f2f5 DAS change in hover behavior- the containingLibraryName now returns the URI of the containing library instead of the (possibly non-existent) library name
Change-Id: Ief2a7615b92ca635c696d48f907677bae538577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103481
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 19:06:19 +00:00
Jaime Wren 8de23bbbff Update the Dart Analaysis Server protocol to 1.26.1 to mark that the MOVE_FILE refactoring is now enabled. The functionality landed May 3rd, 2019 with https://dart-review.googlesource.com/c/sdk/+/101320
Change-Id: I7f33b73304a72db1375a6a21132dc8207cc784c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101630
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-05-07 22:15:56 +00:00
Konstantin Shcheglov 7e28fc2cd6 Increment Analysis Server version to 1.26.0
R=brianwilkerson@google.com

Change-Id: I3121d8262bab8748fdd64a58178b7020607a2252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-04 21:02:33 +00:00
Brian Wilkerson 7e5810ab30 Add an offset to the protocol used for import-on-paste
Change-Id: I87c50b2fee7643733b38a368b2c231e5fb7cddda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98681
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-04 16:18:43 +00:00
Brian Wilkerson da15746f4c Update the production of training data
Change-Id: Ib9634c5e5bdd8c0097f55a9cf71054e2a2b6a5fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98287
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-03 22:36:01 +00:00
Brian Wilkerson 3a3731665f Initial implementation of server support for training data
Change-Id: I4943b8c30575e78c1028d9d0be174f535db99303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97841
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-26 20:32:20 +00:00
Konstantin Shcheglov 4b609422e9 Make AVAILABLE_SUGGESTION_SETS and related APIs non-experimental.
R=brianwilkerson@google.com

Change-Id: I1facae905319f050636126b021f56f353f81d6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-07 21:29:36 +00:00
lambdabaa 1c27b817fc New protocol to inspect analysis server state at code completion time
This change adds a new, experimental completion domain request
`completion.listTokenDetails`. Its purpose is to allow
other programs to observe and make smarter decisions contingent
upon analyzer's internal knowledge of a Dart program.

Bug: 36083
Change-Id: I5ab477221efeac076eccc873a29cf6feae91052e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95100
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-04 20:33:44 +00:00
Konstantin Shcheglov 266ce73e28 Remove CompletionSuggestion.elementUri, replaced with AvailableSuggestionSet.
R=brianwilkerson@google.com

Context: https://github.com/JetBrains/intellij-plugins/pull/633#issuecomment-465725310
Change-Id: I03a1b7e7ec7cc0a5b0797dc960b72ca314a32132
Reviewed-on: https://dart-review.googlesource.com/c/93745
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 21:34:18 +00:00
Konstantin Shcheglov 4c1025493a Enhance available suggestions protocol.
1. Rename includedSuggestionKinds -> includedElementKinds.

2. Add defaultArgumentListString and defaultArgumentListTextRanges.

R=brianwilkerson@google.com

Change-Id: I65c67252f6bad66c0c60a20315fd87affbeb653a
Reviewed-on: https://dart-review.googlesource.com/c/93560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 19:51:11 +00:00
Konstantin Shcheglov 0ef30fb86e Protocol for IncludedSuggestionSet.displayUri.
R=brianwilkerson@google.com

Context: https://github.com/JetBrains/intellij-plugins/pull/633#issuecomment-464746341
Change-Id: I27339f4c9327adb761f2bb0ba326c318ce010383
Reviewed-on: https://dart-review.googlesource.com/c/93487
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 16:42:30 +00:00
Konstantin Shcheglov b9bcfb4529 Change IncludedSuggestionRelevanceTag to using 'relevanceBoost'.
Sometimes there is no difference between 'relevance' and 'relevanceBoost',
for example for enum constants. But for primitive constants, there might
be multiple `double` constants, in different libraries with their own
different relevances. And it would be nice to keep relative relevances
of these libraries in primitive type constants.

R=brianwilkerson@google.com

Change-Id: I3641a4709e09f5c5dd979f5ca8df7b0235c708d2
Reviewed-on: https://dart-review.googlesource.com/c/92623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 20:10:29 +00:00
Konstantin Shcheglov 67c5923cce Enhance protocol to allow changing relevance of individual suggesions.
R=brianwilkerson@google.com

Change-Id: I3f3d256fcdc4d41c527bbc03fb71800583a264f7
Reviewed-on: https://dart-review.googlesource.com/c/92382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
2019-02-08 19:25:05 +00:00
danrubel 6c680a0ebd Update dartfix readme and update version numbers
* Update the readme to discuss required vs suggested fixes
* Remove the out-of-date options section from the readme
* Update dartfix and analysis_server_client versions and changelog

Change-Id: Ida4b30f9f89eb84a2fe856f61562ff73bf6725da
Reviewed-on: https://dart-review.googlesource.com/c/92153
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2019-02-07 01:16:56 +00:00
Konstantin Shcheglov d236dca9d9 Add 'offset' to 'getSuggestionDetails'.
We need it to know if names in the syntactic scope will shadow
the requested name if unprefixed import is used.

R=brianwilkerson@google.com

Change-Id: I1fd28add9241b27795160c4705a80e0f8aa6c647
Reviewed-on: https://dart-review.googlesource.com/c/92022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-05 16:49:55 +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
danrubel db44a727e5 Extend the edit.dartfix protocol
This CL extends the dartfix protocol to allow specifying which
fixes should be applied. In summary:

* includedFixes - list of fix names to be applied
* includeRequiredFixes - bool indicating required fixes should be applied
* excludedFixes - list of fix names that should not be applied

Given that the client can specify the fixes to be included/excluded,
then the dartfix cmdline help text should include the list of known fixes.
Rather than hard code this in the dartfix client, a new edit.getDartfix
request has been added to return the list of known fixes.

Change-Id: I319f6f405a5d29757bf28b70b778a449f901bbef
Reviewed-on: https://dart-review.googlesource.com/c/91700
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 01:53:32 +00:00
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