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
Danny Tuppeny
ff61ff7d33
[analyzer] Call toJson() on items in Lists when generating LSP json
...
Change-Id: I9f5876dc577499ae609079eaecae6a3eb47535d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188288
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2021-03-02 15:24:38 +00:00
Danny Tuppeny
4525525a9d
[Analyzer] Handle parsing v3.16 LSP Spec
...
Change-Id: I6afd5c32673ba580cdf6691bdfa521766f65c3b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158392
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-12-09 20:29:30 +00:00
Brian Wilkerson
8fee2b96af
Rename the tool/completion_metrics directory
...
The directory contains tools related to code completion that are not
used to measure completion metrics, so the old name was too specific.
Change-Id: Ie8745901655df6e7b29da645b3b0a48011ca9f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-11-30 23:57:44 +00:00
Danny Tuppeny
5aa25f039c
[Analyzer] Handle literal types in LSP spec correctly
...
This ensures canParse() methods correctly handle literal types from the LSP spec instead of allowing any literal of the same type to pass.
Change-Id: I4876f4adc8de1d9138e0f62868aa6a8a010b9102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162753
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <danny@tuppeny.com >
2020-09-16 15:22:58 +00:00
Danny Tuppeny
6762f2294c
Tweak parser to handle LSP 3.16 spec
...
Change-Id: I53ef27f4b9dc9c4f6a8ff54e116dd3d2a9faf65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156506
Commit-Queue: Danny Tuppeny <danny@tuppeny.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-30 15:49:28 +00:00
Danny Tuppeny
c4a2efd6e7
Switch all generated LSP classes to use named constructor arguments
...
Change-Id: I111b58fa5d04314247d5f92650491cdeef6bd4a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <danny@tuppeny.com >
2020-07-09 17:18:07 +00:00
Danny Tuppeny
6db0396c83
Regenerate code from v3.15 LSP spec
...
Commit v3.15 of LSP spec + regen generated code
Change-Id: Ic0823063791900f347e1ff1f2242a6e4e6ed8ca6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153778
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-09 17:18:07 +00:00
Danny Tuppeny
d86fa966a9
Tweaks to be able to parse v3.15 spec
...
Change-Id: Ifdb8696246b6893b743754dab5344d5939550a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153776
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-09 17:18:07 +00:00
Brian Wilkerson
bd3b3299cb
Correct an abbreviation
...
Change-Id: I7424cd587c87f1256237de1cf913b9b0b31104f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151341
Reviewed-by: Jaime Wren <jwren@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-06-15 22:16:52 +00:00
Danny Tuppeny
16ef3ee562
Fix LSP equality checks for lists/maps within unions
...
Change-Id: I7ec8b591375dfb4d75f802839b89c1288cd4cfef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151236
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-06-15 18:09:02 +00:00
Danny Tuppeny
3b243a0c30
Recurse through lists/maps when generating hash codes in LSP types
...
Change-Id: I06117fe33c7bfb8553e9930afbf7e3bdc86c6032
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151230
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-06-15 18:09:02 +00:00
Danny Tuppeny
fad05e89dc
Require exact type matches for equality in LSP classes
...
Change-Id: Ia3f502a315e2c6fbc62eb6fbe3785dad86c782cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142992
Commit-Queue: Danny Tuppeny <danny@tuppeny.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-04-14 15:47:01 +00:00
Danny Tuppeny
2fbe4d9194
Resolve type aliases when generating LSP equals methods
...
Change-Id: Iccecfa8dc8d77cb0d4358db1f7fa54607ffaa428
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142991
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-04-14 15:47:01 +00:00
Brian Wilkerson
8969b1839c
Enable omit_local_variable_types in analysis_server
...
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-03-30 03:58:44 +00:00
Jaime Wren
dd95365f76
Optimization for the MeanReciprocalRankComputer. This change doesn't have the object hold onto the list of ranks for the entire duration of a run, but has a running sum instead (similar to ArithmeticMeanComputer).
...
This would have been an over-optimization originally, but at this point, we have 10 of these computer objects in completion_metrics.dart, and we are running this algorithm with up to 1.2 million ranks.
(Assuming that an int takes 4 bytes which I believe is true...) On a recent run of Brians, 29.4 MB of data was the running total of all the ranks. With this change, the same data will be stored with 10 doubles and 10 ints.
Change-Id: If97ca18e78782c02a3ca0a3ed9d6a9725f5a05ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
2020-03-21 19:50:36 +00:00
Brian Wilkerson
486467c02d
Bulk sort of a subset of the files in analysis_server
...
Change-Id: Id811d37ad565c6f3c0ed508ae2b42e22469cbd3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139830
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-03-17 19:13:14 +00:00
Jaime Wren
4590cd86c1
Add some missing tests for the new class ArithmeticMeanComputer in pkg/analysis_server/tool/completion_metrics/completion_metrics.dart
...
Change-Id: Icff02abe7912e7d9b36a63181aa0a2f84b78aab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139742
Commit-Queue: Jaime Wren <jwren@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Jaime Wren <jwren@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-03-16 22:11:41 +00:00
Jaime Wren
699f4b7395
Add additional metrics into the completion metrics algorithm, MRR broken apart by type member completions, and non-type member completions
...
Change-Id: I5fd0c6b0ac1f9f0450ba630964e335488046a698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138912
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
2020-03-10 19:48:21 +00:00
Jaime Wren
005c5d7b52
Add an additional MMR "Max Rank 5" metric to the output of the completion_metrics.dart
...
Change-Id: I00ff65853eaef85bd33d76e930d7ba1d39783a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jaime Wren <jwren@google.com >
2020-03-09 21:54:20 +00:00
Jaime Wren
a8a4497cc6
Some tests for the utilities in metrics_util.dart, part of the completion metrics.
...
Change-Id: I2cccfe899d38ce5518a32c8a26fd4d3511cf91d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134569
Commit-Queue: Jaime Wren <jwren@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-02-06 21:33:35 +00:00
Brian Wilkerson
0d3571b52f
Add return types to more methods in analysis_server
...
Change-Id: Ib61c92d65e6170a1b5cd3e3d24affb3a3fa16bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-01-29 20:18:20 +00:00
Brian Wilkerson
5584c96fde
Enable prefer_single_quotes in analysis_server
...
All of the changes except in the analysis options file are from dartfix.
Change-Id: Icd9bf02ad07f71d1fc365979c7dfe18a792dc595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132624
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-01-21 17:52:52 +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
4043a6fce3
Remove unnecessary uses of new in analysis_server
...
Other than analysis_options.yaml, all of the changes were from running
dartfix.
Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-12-18 19:01:51 +00:00
Danny Tuppeny
ca3320e3bd
Tweak LSP JSON validation error messages
...
Change-Id: I732d0020a68256632ee8ba823a0a31eb4a5360d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105586
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-06-11 19:07:29 +00:00
Danny Tuppeny
530a2f5681
Make a null LSP error reporter to avoid so many null checks
...
Change-Id: I08f9259ba5aca52c61dd6820a3cc54bf40a30c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105584
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-06-11 19:07:29 +00:00
Danny Tuppeny
9fb2842fce
Improve the error messages reported in LSP when params are not valid
...
Change-Id: I305955a22d687e8338138db48dff4e32589bbc6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-06-11 19:07:29 +00:00
Danny Tuppeny
a779db0813
Update LSP spec to latest
...
Change-Id: I6f7ff3c6707f992aa618ad172e81857153b75795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102360
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-05-13 15:11:15 +00:00
Brian Wilkerson
3019a8873a
Check for completeness of test_all in analysis server and analyzer plugin
...
Change-Id: Ia25b1f93d5f2f3942f0c76d74556228a41410182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97352
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-03-21 13:24:03 +00:00
Danny Tuppeny
01cc5a6305
Ensure unknown fields in LSP payloads are ignored
...
Change-Id: I3f4a2763b2a8714a80108a895c1887b5a36d2a3d
Reviewed-on: https://dart-review.googlesource.com/c/94500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-02-27 15:00:17 +00:00
Danny Tuppeny
8fb52650e5
Ensure LSP canParse type-checks optional values
...
Previously we were only outputting the validation code if the value was required. This changes it to also validate in the case it's not required, but only if it's not-null.
Without this change, the test that parses `'overwrite': 1` fails (a boolean is expected), but with it, it passes.
Change-Id: Ic4afe1f6a8f78add2385831907b226022b7ecaec
Reviewed-on: https://dart-review.googlesource.com/c/94293
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-02-27 08:12:02 +00:00
Danny Tuppeny
d1876531f2
Fix LSP canParse to allow nulls where the spec allows
...
Change-Id: I8a34fbf03e45c85a70d44a54b1715b87f84f9c3b
Reviewed-on: https://dart-review.googlesource.com/c/94290
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-02-27 08:12:02 +00:00
Danny Tuppeny
a52ac7d27b
Correct LSP canParse functions for classes containing restricted enums
...
This fixes a mistake where enum classes were resolved to their base types (string, num) before being output in canParse methods of their containing class. This meant for "restricted" enum types (those that should not allow any value), canParse would incorrectly return true for out-of-bound values as long as they were the correct type.
Change-Id: I44e37a60b49287cf7202d5a578ee9c08cf898078
Reviewed-on: https://dart-review.googlesource.com/c/94280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-02-26 07:38:12 +00:00
Danny Tuppeny
bfe15d87d8
Fix LSP exceptions serializing ResponseErrors with Uris
...
The ResponseError.data field was typed `dynamic` (as in the LSP spec) but this allows us to accidentally put non-serializable classes in it which will result in server errors when we try to send them back.
This change forces them to Strings and it's up to the code constructing the error to convert any additional data to a string first.
In order to catch this in tests, the mocks now force serialisation of all types flowing from the server to the client (this already happened for client to server).
Change-Id: I5d7f322e1a4296b1479468e36d81daebdbb4ab52
Reviewed-on: https://dart-review.googlesource.com/c/89511
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-01-16 16:57:43 +00:00
Danny Tuppeny
8cddcd20cd
Handle deserialising sub-classes in the super-classes fromJson
...
Change-Id: Ib9048cf674ad77711401e77e20e6dd8bc7e28e00
Reviewed-on: https://dart-review.googlesource.com/c/89363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-01-14 18:35:27 +00:00
Danny Tuppeny
4f160558b3
Extract inline interfaces from results definitions in LSP spec
...
Change-Id: I8661c7af628f0e3125db0613149bbcbc9f27bbe6
Reviewed-on: https://dart-review.googlesource.com/c/89301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-01-14 15:04:13 +00:00
Brian Wilkerson
47e988b781
Clean up the remaining copyright notices in analysis_server
...
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-01-11 15:38:56 +00:00
Danny Tuppeny
44449e29d2
Add a custom toJson snippet for LSP ResponseMessage for null handling
...
This adds some custom code for serialising ResponseMessage to ensure that only one of result or error are ever specified, as required by JSON RPC.
Change-Id: I2736b83755553a906264b1e5251d1a535dc289fb
Reviewed-on: https://dart-review.googlesource.com/c/88953
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2019-01-10 14:46:30 +00:00
Danny Tuppeny
666eee40c7
Updates to pase tuples in LSP spec
...
Change-Id: Ia1ce7579e954a8000b3460445859a2d221cf1a8c
Reviewed-on: https://dart-review.googlesource.com/c/87441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2018-12-17 17:58:17 +00:00
Danny Tuppeny
2dbf91ff13
Add support for parsing Maps from the LSP spec
...
Change-Id: Ieafcacb3ba2f6be8d3232025d22fa5ec94de5352
Reviewed-on: https://dart-review.googlesource.com/c/85768
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-12-04 14:27:19 +00:00
Danny Tuppeny
0a7cf2a513
Allow nulls for union values where the field can be null or undefined
...
Change-Id: If0fea932c1534e8a6a151e67b16ad78cb14ec98d
Reviewed-on: https://dart-review.googlesource.com/c/85743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2018-12-03 16:34:16 +00:00
Danny Tuppeny
be6593e5c6
Reduce params type from Either2<List<dynamic>, dynamic> to just dynamic
...
Nothing in the LSP spec supports arrays as params (let alone a union of a single item or array).
Since the new type is dynamic, this should be non-breaking even if LSP changes (though we'll want to put it back if we need to write a handler for something that accepts a union like this).
Change-Id: Id1af1d438fede94906ae76eaa8b9a959b0b62ccf
Reviewed-on: https://dart-review.googlesource.com/c/85396
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-11-28 08:20:07 +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
8fa1e010c4
Validate paths and offsets for all requests
...
Change-Id: I72ede118b825debc6a16ec227b5116aa2fc73a8e
Reviewed-on: https://dart-review.googlesource.com/c/85162
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-11-26 11:39:30 +00:00
Danny Tuppeny
4a1983a1a8
Fix some TODOs and remove redundant test
...
Change-Id: Id2f45d5bb139ff3828de5fa916a863401bb156ed
Reviewed-on: https://dart-review.googlesource.com/c/85173
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-11-26 10:26:00 +00:00
Danny Tuppeny
3cedae6f09
Change diagnostic.code to a simple String
...
Change-Id: Ieb23cda7c6f2c1dffb2e07e47dfe29ddc78f41de
Reviewed-on: https://dart-review.googlesource.com/c/85174
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2018-11-22 17:54:12 +00:00
Danny Tuppeny
937e950fd2
Parse inline interfaces into types
...
Change-Id: I33c6d12d760b0e44505a34ad1b4cb77ffa0db0f3
Reviewed-on: https://dart-review.googlesource.com/c/84039
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2018-11-13 08:08:52 +00:00
Danny Tuppeny
d5e853e0ce
Improve parsing of LSP spec
...
Change-Id: Ica48b57c890105df346c5a133fe0389bd92dbb6e
Reviewed-on: https://dart-review.googlesource.com/c/83388
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-11-08 15:31:26 +00:00
Danny Tuppeny
8852d36315
Add --lsp flag to analysis server and add basic Initialize handler
...
Change-Id: Iaf6c2a7cd56dea27233c4be1df2da900653e1822
Reviewed-on: https://dart-review.googlesource.com/c/81275
Commit-Queue: Danny Tuppeny <dantup@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-10-31 20:00:51 +00:00