Commit Graph

96 Commits

Author SHA1 Message Date
Sam Rawlins 207a47145f Fix overlays in completion_metrics.dart
Overlays were not being removed fully, which lead to crashes as we tried to
change the file contents with an invalid index.

Change-Id: I2c60a101b3a60e90100fbaf1970a3cada0296e41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269180
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-11 00:20:29 +00:00
Konstantin Shcheglov 683e2419da Deprecate 'DartType.element2' use 'element' instead.
Change-Id: I6986a058616db489987789cfab09d53a450e3ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262666
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-05 16:30:09 +00:00
Konstantin Shcheglov fcc9473dab Deprecate CatchClause.exceptionParameter2/stackTraceParameter2
Change-Id: I3f0ae9367f35fe514a125cb0f06ccbdc8fa0dc18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262502
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-10-04 15:58:11 +00:00
Konstantin Shcheglov 745d0ff64a Deprecate 'Element.enclosingElement3', use 'enclosingElement'.
Change-Id: I6f4fd7e8c0f071bde10cb5e57ed6195ae517e575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-26 23:58:14 +00:00
Konstantin Shcheglov 44316060f1 Deprecate 'get declaredElement2', use 'get declaredElement' instead.
Change-Id: Ida7a9c2ac35943aed2d75f81f98ce7056b616aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260741
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-23 20:05:29 +00:00
Sam Rawlins 51114fca8a Unnamed libraries
Fixes https://github.com/dart-lang/language/issues/1073

Spec: https://github.com/dart-lang/language/blob/master/accepted/future-releases/unnamed-libraries/feature-specification.md

This work allows library directives without a name. Every single one would look like this:

```
library;
```

:) it was a little anti-climactic implementing a non-feature like this, but there it is.

The affordance for a library directive without a name is guarded by an experiment flag, `--unnamed-libraries`.

Change-Id: I8612238359e88d6082f7e89d0d0fc624fdb45273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257490
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-09-23 05:37:39 +00:00
Konstantin Shcheglov e03170035a Deprecate 'get name2', use 'get name' instead.
Change-Id: Iee8ef5fb6700d96c857a22a99dc61dac3da88572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-09-22 02:22:47 +00:00
Konstantin Shcheglov 6f0fe880c4 Breaking changes for analyzer version 5.0.0
Reland of https://dart-review.googlesource.com/c/sdk/+/243164

Change-Id: I5167844ea1001f026cf8d9b82465a79f560d188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257267
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-09-07 16:27:18 +00:00
Konstantin Shcheglov ff8024fc78 Revert "Breaking changes for analyzer version 5.0.0"
This reverts commit d8df88cbe4.

Reason for revert: breaks Flutter HHH, requires updates to linter

Original change's description:
> Breaking changes for analyzer version 5.0.0
>
> Change-Id: Id9f27b6c41829249f6b2e7b93ad396643193fc78
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243164
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: I6ca213427189c169ddacbd89f60d463efa2c38f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-31 21:05:19 +00:00
Konstantin Shcheglov d8df88cbe4 Breaking changes for analyzer version 5.0.0
Change-Id: Id9f27b6c41829249f6b2e7b93ad396643193fc78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243164
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-31 05:08:50 +00:00
Konstantin Shcheglov f4c009dc33 Deprecate Declaration.declaredElement, use 'declaredElement2' instead.
This is necessary to separate `ClassElement`, `EnumElement`, and `MixinElement`. And, in the future, augmentations like `ClassAugmentationElement`, etc.

Change-Id: Iecd2f8707212e53ef56f0e101880c7bab9e5d057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254104
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-09 17:26:06 +00:00
Konstantin Shcheglov 5458af8662 Deprecate ClassElement.isEnum/isMixin, use 'is EnumElement' instead.
Change-Id: I493fb048d0f7c8af778a35e4543df206cfd18739
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253680
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-04 19:21:27 +00:00
Konstantin Shcheglov cbfad8f802 Deprecate DartType.element, use specific element accessor for InterfaceType, TypeParameterType.
For `InterfaceType` keep `element2` deprecated and define
`InterfaceElement get element2` instead. Most changes are because
of this.

Change-Id: I13b888610fc707438c3c97b676f1460e7fc2b040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253564
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-04 16:18:06 +00:00
Konstantin Shcheglov 71ef76ddfd Deprecate Element.enclosingElement2, use 'enclosingElement3'.
Change-Id: I0aba589bd42648eb420051cbe04bb3ef435081e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253400
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-02 18:00:14 +00:00
Konstantin Shcheglov 01173e2aa2 Deprecate 'name' in AST, use 'name2' token instead.
Change-Id: I867f009dca12208f835199297d2ea85c203c8556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252566
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-02 16:25:34 +00:00
Konstantin Shcheglov 33b672f789 Use CatchClauseParameter instead of SimpleIdentifier.
Change-Id: Ib254d05954548d4101fef9c2545d18b2611b59dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253100
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-01 17:32:04 +00:00
Konstantin Shcheglov 2f3269faa1 Deprecate 'Element.enclosingElement', switch to enclosingElement2.
We need this for:
1. CompilationUnitElement changes its enclosing element from LibraryElement to LibraryOrAugmentationElement
2. Similarly PrefixElement.

Change-Id: I5e3719b4ef59d03caab1b20c9172a8c0fd786bdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251900
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-07-19 15:44:14 +00:00
Konstantin Shcheglov 33295f8247 Add more await or unawaited() to DAS.
Change-Id: I45b2b988141c235b6fbe50e69fa018627e20e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251146
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-07-12 00:59:01 +00:00
Konstantin Shcheglov 40db70d5fd Deprecate 'Directive.keyword', use specific 'xyzKeyword'.
Change-Id: I66ab521df857de07343205aed6335e6d3566eafb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-07-07 19:55:21 +00:00
Konstantin Shcheglov e5da1f97b9 Remove DocumentationCache, we cache documentation and more in _ElementCompletionData.
Change-Id: I36e0f9cfaf648349f789658bcf80a7aab294c7ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-30 14:52:06 +00:00
Devon Carew 0340696b02 [pkg/analysis_server] remove code referencing itsallwidgets.com
Change-Id: Ic7b93eaaef6cb35395d47af5603e095250048d77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245740
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-05-23 20:54:00 +00:00
Sam Rawlins f397ecb588 Satisfy library_private_types_in_public_api in analyzer
This involves changes of a few flavors:

* Make classes private which were unnecessarily public.
* Make class elements private which were unnecessarily public.
* Comment in places where a "public" API contains a private type,
  but this is because of the signature of a super-member. I think
  these are generally quite safe.

Change-Id: Ied1864202cc256205a3b421ddec5513f0a22a608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243647
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-22 01:45:33 +00:00
Sam Rawlins 84ca405b35 Support overlays in completion_metrics_client.dart
Change-Id: Idedb38193ed80be0fa10e8e6be3fa04f8f30b100
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243649
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-05-04 20:58:54 +00:00
Sam Rawlins 9d456bf516 Basic client completion test
This involves a large refactoring of completion_metrics.dart, extracting
out some common code into completion_metrics_base.dart

The code in completion_metrics.dart and completion_metrics_base.dart is
largely unchanged, but restructured to fit the sub-class structure.

* Rename CompletionMetricsComputer -> CompletionQualityMetricsComputer,
  as this is focused on quality metrics.
* Extract out applyOverlay and removeOverlay methods.
* Extract out computeSuggestionsAndMetrics, code which is run per
  ExpectedCompletion.
* Extract out setupForResolution, for code custom to the quality
  computer.

The meat of this change though is in completion_metrics_client.dart:

* _AnalysisServerClient is code which was extracted from
  package:dartdev/src/analysis_server.dart. It may seem like an odd
  choice when we have package:analysis_server_client, but I think
  dartdev's client is fairly mature in creating a short-lived client,
  and handling crashes, etc. If this should be re-combined with dartdev,
  I think there are open questions about where that should live, and I'd
  like to address that in a follow-up.
* The client does not perform overlays yet.
* The client does not track slowest requests yet.
* The client does not have support for performance metrics which DAS
  tracks itself. Adding this is high priority.

Change-Id: Ib259f78e4646d10b61559bfd5700d98a95d14d43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243522
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-04 01:05:05 +00:00
Sam Rawlins c94b26e5b1 Add comments to completion_metrics.
Change-Id: I0836afe9d94998bbc6fac3358cba40372cabc418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242240
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-23 04:21:10 +00:00
Sam Rawlins 7e95dc1335 completion_metrics: add a 'prefix-length' option
This option allows the completion position to be an offset from the
start of each token, and plays well in each overlay mode. For the
original content:

```dart
void main() {
  foo();
}
```

In OVERLAY_NONE mode, completing on `main`, with `--prefix-length=2`,
we complete at:

```dart
void main() {
       ^
  foo();
}
```

In OVERLAY_REMOVE_TOKEN mode, completing on `main`, with
`--prefix-length=2`, we complete at:

```dart
void ma() {
       ^
  foo();
}

In OVERLAY_REMOVE_REST_OF_FILE mode, completing on `main`, with
`--prefix-length=2`, we complete at:

```dart
void ma
       ^
```

Change-Id: Id2493777cb38f147f7a2c401a9e53e17561516bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-21 21:05:01 +00:00
Sam Rawlins f986ec4ed8 Change 'slowest requests' flag to not group by group; instead use p90
Previously, the 'slowest requests' flag would only track and print the
slowest 5 requests for each category. But this ends up printing many
requests which are not slow at all, and are perfectly reasonable. It is
more interesting to print the slowest results, those in the 90th
percentile.

The limit is set to 100. This is to set a limit on serialization in the
map/reduce system, and a limit on printing to stdout.

Change-Id: I31fde906e227ea195ec25d8c9c2d92569ceb72b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241865
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-21 20:59:18 +00:00
Sam Rawlins c32fe13239 Fix help for completion_metrics
As it is, it is broken if you pass `--help`.

Also, this adds line wrapping for option help text.

Change-Id: Ia1e096eba46b1f4db804f9c1ed771d4e67816ae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242020
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-04-21 20:14:29 +00:00
Sam Rawlins 11a01c8fad Add a progress bar to completion_metrics
Progress bar largely taken from
https://github.com/dart-lang/sdk/blob/main/pkg/nnbd_migration/lib/src/utilities/progress_bar.dart

If there's a good common place (in package:analyzer?) to put this,
I'd be happy to do so.

Change-Id: Ic64ac98d8a8f5ae1cc036932364f37f10b837055
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-19 20:40:19 +00:00
Konstantin Shcheglov 5910da4f02 Use AnalysisContext.applyPendingFileChanges() after changeFile().
Bug: https://github.com/dart-lang/sdk/issues/48789
Change-Id: Ibb1ae34cdaa447385d9b2cd0f3282eb178b1dbf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241208
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-14 18:20:53 +00:00
Sam Rawlins 6660e3c9a0 Add median, p90, and p95 metrics to completion_metrics
This adds a section to the output like this:

```
### Percentile metrics

                   p50  p90  p95  count > 2s
ms per completion    4    6    7           0
```

Bug: https://github.com/dart-lang/sdk/issues/48788
Change-Id: I868580324b3bc83605aa6466ffd5799625d1a9f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240941
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-04-13 20:48:03 +00:00
pq 16b436151a migrate server to recommended lints
See: https://github.com/dart-lang/sdk/issues/48785

Change-Id: I1bec40cc0b52e5df5f07c35ec993e08c56a59cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240907
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-04-12 13:34:12 +00:00
Konstantin Shcheglov 5fa65048c1 Use file_paths.pubspecYaml instead of 'pubspec.yaml' literal.
WDYT ?

Change-Id: I6677b2237e0558c74bb11073dcfb44d7b672323f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 19:03:55 +00:00
Konstantin Shcheglov 60b428e2b1 Deprecate superclass2, mixinTypes2, etc.
Change-Id: Ieaaeab57930cb93f5b6b1323efe63c3395b79993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232742
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-17 02:20:42 +00:00
Konstantin Shcheglov f69d1f887f Use CompletionSuggestionBuilder, and HasCompletionData to store location independent data.
Change-Id: I767bfc1c31b5aebc8f4e27267520f705701e7724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-04 17:33:19 +00:00
Konstantin Shcheglov 985d476218 Use Map.identity() to associate data with CompletionSuggestion(s).
CompletionSuggestion.hashCode is very, very expensive.

With some other changes the difference is 67 vs 47 seconds.

Change-Id: Ie792b5ccbfd32a1896166594fdeeb89193d4d061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-27 22:11:41 +00:00
Brian Wilkerson 9268feca62 Update the completion_metrics tool to support the new protocol
Change-Id: Iaa6ee477e97967c901a1c0442a8a3e8425b89a59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-01-27 21:27:51 +00:00
Konstantin Shcheglov c736694ba2 Decrease relevance of not-yet-imported suggestions.
Change-Id: I00f309bee05f79ae400878a000a197ac1732b97a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-20 22:03:57 +00:00
Sam Rawlins b06b60702b analysis_server: Enforce strict-casts
Bug: https://github.com/dart-lang/sdk/issues/41651
Change-Id: I9be21ab7e8f8b61707a75d7d4b5f9a872ad0fb95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-07 22:45:59 +00:00
Sam Rawlins e774227a81 analysis_server: Remove implicit casts from test and tool
Bug: https://github.com/dart-lang/sdk/issues/41651
Change-Id: I0a165aef2b5d5cd2f97e5728bb6011a8eb70d9a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-06 03:30:26 +00:00
Konstantin Shcheglov 5ffec0e46e Create DartCompletionRequest with values, currently using forResolvedUnit() constructor.
Change-Id: Ie3db8617ed882d9561f9ea49b23dd5f8d3b4cf5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219753
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-09 16:17:55 +00:00
Konstantin Shcheglov bea4742bc1 Don't access ResolvedUnitResult from DartCompletionRequest.
When we resolve partially for completion, there is no fully
resolved unit. But we still know its path, content, element.

Change-Id: I57a21eb764ecd0b4c82ade33ad633bb2cd632b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-05 02:29:06 +00:00
Konstantin Shcheglov 1ab3b36649 Make CompletionPerformance a wrapper around existing OperationPerformance.
Change-Id: I787ba5b47a2660d606dcc6c5015e9c9d83f73b31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218784
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-01 18:49:31 +00:00
Sam Rawlins 8f756bf96b Add CommentReferableExpression, for expressions which can be used in a CommentReference
* Replace `identifier` field with `expression`, which means deprecating
  `identifier`, redirecting users to `expression`. For now, `expression`
  always returns an Identifier. In a future breaking release, it will
  return other CommentReferableExpressions.
* SimpleIdentifier, PrefixedIdentifier, PropertyAccess,
  ConstructorReference, FunctionReference, and TypeLiteral are all
  CommentReferableExpressions, but support is not implemented yet to
  parse CommentReferences with those contained expressions.

Bug: https://github.com/dart-lang/sdk/issues/47444
Change-Id: I1905afecf3878cd7dca6e275ef0a2ab80500eb4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216320
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2021-10-29 16:38:09 +00:00
Konstantin Shcheglov ec1118ead7 Use CompletionBudget.defaultDuration
Change-Id: Ic4da5ac8b5d8dc9911feecdfa4a8ab4e2e4da778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-28 18:17:48 +00:00
Konstantin Shcheglov 294aaab9c1 Use time budget in NotImportedContributor.
Change-Id: Ief0ef8185accd68c7b99132393fa0a4db6be31c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-28 17:37:18 +00:00
Konstantin Shcheglov 931121ee2e Create DartCompletionRequest using factory constructor.
Change-Id: I05d7b444329c0bae6d3cd259ed015746963bf737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218327
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-27 22:10:07 +00:00
Konstantin Shcheglov a156ee2f31 Remove CompletionRequest, use DartCompletionRequest only.
Change-Id: I4ecec7c4bc55e6ffacf3023ed8ee62db456bdd4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-25 22:03:20 +00:00
Konstantin Shcheglov 76dadeecd9 Remove DartCompletionRequest, use what was Impl instead.
I think we don't expect that users will write plugins that use these
types. So, we can remove the indirection.

Similarly, CompletionRequest is also currently de-facto a Dart
completion request, because it has `ResolvedUnitResult result`. I will
fold it into DartCompletionRequest in a future CL.

Change-Id: I2ea1d443ae18535f8c72f785dd1b91cf8d30ffa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-25 19:32:46 +00:00
Konstantin Shcheglov 9eddeaeb3a Make DartCompletionRequestImpl.from() synchronous.
We give it (indirectly) ResolvedUnitResult, so it does not do any
async operation.

Change-Id: I2d29925fd20ea14bd984e6c3c226de466a03fb39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-25 17:47:00 +00:00