Commit Graph

186 Commits

Author SHA1 Message Date
Konstantin Shcheglov a0a6fc1c32 Elements. Move flags into MetadataImpl.
Change-Id: I4086f4155471387133feaa357710c0bd3d7f19a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-02 10:07:40 -07:00
Konstantin Shcheglov 2cf84f8053 Elements. Rename most XyzElementImpl into XyzFragmentImpl.
Change-Id: I7902ccedd9d3e9ccde1091eb28aad98591791b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-28 08:35:25 -07:00
Konstantin Shcheglov b2fdd8a345 Elements. Rename XyzElement2 into XyzElement.
The CL was done with rename + adding typedef for each class.

Change-Id: Ia25cc581d2e42cf7d12a85a3579af952d5c232ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 13:27:18 -07:00
Konstantin Shcheglov 49599e06cc Elements. Deprecated element2.dart library.
Change-Id: I2be38df49e6f242d9fe59f34164549da4a0f41b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424683
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 11:23:18 -07:00
Sam Rawlins 331c700f33 DAS plugins: Move Assist code to analysis_server_plugin package
The PluginServer class needs access to AssistProcessor in order to
compute assists. That class needs access to a few other classes, which
then must also be moved:

* assist_core.dart - the Assist class
* assist_dart.dart - the DartAssistContext class
* assist_generators.dart - the registeredAssistGenerators variable
* assist_performance.dart - the AssistPerformance and
  GetAssistsPerformance classes
* assist_processor.dart - the AssistProcessor class with it's
  singular API, `compute()`
* performance.dart - the ProducerRequestPerformance class
* the `addCaretAtOffset` helper function, refactored into a
  `withCaretAt` extension method

This change is functionally a no-op.

Change-Id: Ic883d21e9cc8c3db1f6093f830f01ec6eb9a0976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-19 13:44:51 -07:00
Konstantin Shcheglov bb676ba1f5 Elements. ElementImpl is not Element2.
Change-Id: Ia8885018d3e23875e53dfa0d3cf470bdd28eef29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-17 08:46:49 -07:00
Sam Rawlins 7c646390c2 DAS: Simplify the storage of the fix mappings for assists
This map is a map of _assists_ and the lint rules that can _fix_, when
used as a _fix_ producer. A rather specific set of information. It was
being passed around everywhere, but now with the instance of
`_RegisteredAssistGenerators` to hang onto, we can leave the map there,
and remove it from a handful of other classes which all ultimately just
passed the map back to AssistProcessor.

Change-Id: Ib2aa4ea1fdb23bbaf55b3377232f2205b7f91447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415460
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-14 10:48:34 -07:00
Brian Wilkerson e8e56ff2f5 Cleanup declarations in server with trailing digits
There are still lots of declarations whose name ends in a trailing
digit, but most of them are unrelated to the migration, and some
are required in order to not break internal code.

I'm happy to break this up into smaller CLs if it's hard to review.
Mostly it's just renaming some declarations, although there are one or
two places where I did a little more clean-up.

Change-Id: I50d32316e82e48c6a5a47aec630b4ffee2ead2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410922
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-23 08:17:36 -08:00
Brian Wilkerson 5454e70ce2 [migration] Rename utilities in protocol_dart.dart
Change-Id: I90c06dffcac98bc8ec6bb2a982a6825157eda56d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407620
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-03 16:32:40 -08:00
Brian Wilkerson 448f0d4080 [migrate] server/protocol_dart.dart
I didn't rename all of the functions because I thought it would be easier to review if I did it in two steps.

Change-Id: If765d56300374794dc9964f17002cfbe172e66b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-03 14:34:21 -08:00
Konstantin Shcheglov 8bbe6fbdfe Elements. Report analyzer_use_new_elements without any txt file, add file ignores.
Change-Id: I13125f93a6633563ed6853a622bd9fec045bfc0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403923
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-10 15:20:59 -08:00
Sam Rawlins 4e4fec1830 DAS: Correct some broken comment references
Change-Id: I55df606eca2e08469ee7c0b8895fab5c7e5afb05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-12-17 08:32:29 -08:00
Keerti Parthasarathy c7d0e325d7 [Elements.migrate] Migrate CandidateSuggestion.
Change-Id: I664ab34e7c674582d98f3c75d3fffe41d8cf8be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-11-19 18:14:27 +00:00
FMorschel 6dac184012 Adds library result
R=scheglov@google.com

Fixes https://github.com/dart-lang/sdk/issues/57092

Change-Id: I125c53e138c97e57fc22d69b2362351ddcbb6b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395420
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com>
2024-11-19 15:50:42 +00:00
Sam Rawlins fbf331e0dd DAS: reformat source code with tall-style
Change-Id: I42b4a44fd6a2197e499e8623274b3cd1a4b5556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394003
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 23:04:00 +00:00
Keerti Parthasarathy e573f64f48 Create LSP CompletionItem from CandidateSuggestion, bypassing the SuggestionBuilder.
This eliminates the step of converting CandidateSuggestion to legacy completion item and then into LSP completion item. Also makes use of the SuggestionCollector to sort and truncate suggestions.

The utility functions/methods are in completion_utils.dart, these are based on the code in mapping.dart, modified to use CandidateSuggestions.

Change-Id: I1e44a5318575eeb3b89803e20a082f98b7bedd41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392082
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-10-29 15:16:43 +00:00
Keerti Parthasarathy 640ad1416e Add methods for element2 to be used for migration
Change-Id: I4794f03c2140ad84139114ea5a308116fb5d41ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-10-17 21:46:10 +00:00
Sam Rawlins 34ad8e075e Move FixProcessors and registeredFixGenerators to analysis_server_plugin
These two are needed in the shared package so that plugins can run
CorrectionProducers. They go in 'src' because plugin developers do not
need to see this code.

Work towards https://github.com/dart-lang/sdk/issues/53402

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Iee5b5dd063d5b0a9b00c58b91a3e50328c8b5fc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-07-30 21:17:13 +00:00
Sam Rawlins 3e58529caa DAS: Separate out registered fix generators into their own file
Work towards https://github.com/dart-lang/sdk/issues/53402

I move them all out of static fields on FixProcessor to be instance
fields on a singleton class in a new file, fix_generators.dart. For
each one that ended in the word 'Map', I removed that.

I also move `_bulkFixableErrorCodes` and `canBulkFix` to
BulkFixProcessor, as it is the only caller, and holds onto the data.

I also correct some outdated doc comments.

I also make `_isFixableError` static.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I01beccac4969f832941c75eb6d7b49b54a0b085c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377563
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-07-29 13:59:59 +00:00
Sam Rawlins beee864196 DAS: Move away from LintNames, now that LintRules have LintCodes
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Id52cbf9fe95f9f2aaff80baaa10b2abbdba85f9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376560
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-07-22 06:43:58 +00:00
Sam Rawlins 1e84b64a0e DAS: Move DartChangeWorkspace to the analysis_server_plugin package
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I79f43d06b48149b1d9dec30c5f5a77fdfd57ce4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373143
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-26 02:17:59 +00:00
Konstantin Shcheglov 5c07c89a35 Enable 'unnecessary_final' in analysis_server/.
Change-Id: I71ee934b915d4aff924cf5925f87bcc9adc6c015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-16 20:04:15 +00:00
Sam Rawlins 6896a21216 analyzer plugins: Move DartFixContext and Impl to server_plugin
* Combine DartFixContext and DartFixContextImpl into one class;
  separation seems unnecessary.
* Change constructor (which was on DartFixContextImpl) to use all
  named parameters.
* Change `resolveResult` field to `resolvedResult`, since the type is
  called `ResolvedUnitResult`.
* Start doc comments with third person verbs [1].


[1]: https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs

Work towards https://github.com/dart-lang/sdk/issues/53402

Change-Id: Idb3c6776f899d5bc9b634c1d9c4b998de2603d04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-19 19:06:33 +00:00
Sam Rawlins 3a650f40a8 analysis_server: Introduce analysis_server_shared package
With a simple move of two classes, Fix and FixContent.

The class moves are not exactly no-ops. I moved each class into its
own library and made the following changes:

* Start doc comments with third person verbs [1].
* Make `Fix` class **final**.
* Make `FixContext` class **interface**.

[1]: https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs

Work towards https://github.com/dart-lang/sdk/issues/53402

Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try
Change-Id: Ic046b236d634543832825db8746e0abdca5191fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355889
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-18 20:54:49 +00:00
Oleh Prypin 0e9cdfbc06 Reland "analyzer: Remove unnecessary FixContributor and DartFixContributor classes"
This is a reland of commit c69f4321e6.

Bug: b/318016861
Change-Id: Ic47203839e453b9fd156c8df89117c642b4a235d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350863
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-02-07 21:50:09 +00:00
Konstantin Shcheglov 14a1045f16 Legacy. Deprecate 'withNullability' in getDisplayString() methods.
Change-Id: I688f230f4189cd1fc600e4d34f07f339111c382d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350645
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-07 01:25:38 +00:00
Konstantin Shcheglov 65662d45b6 Legacy. Remove 'withNullability' parameters from analysis_server/ functions.
Change-Id: Ibe70149b6415234861b49fdc9cad58896b55d119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350350
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-06 20:19:48 +00:00
Sam Rawlins 0c3503dde7 Analyzer: Stop relying on a static lint rule map in AssistProcessor
This also simplifies the logic of determining whether a possible producer is
already being proposed as a quick fix for an enable lint rule.

Fixes testing analysis_server with: `dart --enable-asserts pkg/analysis_server/test/test_all.dart`.

Otherwise a functional no-op.

Change-Id: I623101b1c4c732f631a0b74c488cc8853afd282e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-18 17:33:29 +00:00
Ilya Yanok d1717197ec Revert "analyzer: Remove unnecessary FixContributor and DartFixContributor classes"
This reverts commit c69f4321e6.

Reason for revert: `DartFixContributor` is used by Dart LSC tool, see b/318016861

Original change's description:
> analyzer: Remove unnecessary FixContributor and DartFixContributor classes
>
> I'm not sure what purpose they used to have or why they
> "are long-lived". But today they only serve as unnecessary object
> allocations.
>
> Change-Id: Icf73ddd42f540ae956dfeeb676de2f04bfca39d5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343240
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

Change-Id: Ic71e337399e263b899b0ffcbe388986d6011f6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344000
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-12-29 09:47:08 +00:00
Sam Rawlins c69f4321e6 analyzer: Remove unnecessary FixContributor and DartFixContributor classes
I'm not sure what purpose they used to have or why they
"are long-lived". But today they only serve as unnecessary object
allocations.

Change-Id: Icf73ddd42f540ae956dfeeb676de2f04bfca39d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-12-27 23:48:32 +00:00
pq 440ea59ee0 enable flutter_style_todos in server
Change-Id: I4921d538e1498e66c8cab2d84dfcad21d1a7b555
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335952
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-14 21:08:12 +00:00
Konstantin Shcheglov 49ef0be2bc Add ElementKind.MIXIN, use it for MixinElement.
Change-Id: Ie95c6c331ff437c4d6b99bfc7f9a3109f47c985b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 18:27:39 +00:00
Konstantin Shcheglov bbc3dcbe30 Extension type. Tests for type hierarchy.
Change-Id: Ic0e31bb13efd68a3413429d1ff9110bb9b268e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323432
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-30 21:18:25 +00:00
Danny Tuppeny 6229694c74 [analysis_server] Don't remove unused parameters when running fix-all-on-save
Fixes https://github.com/Dart-Code/Dart-Code/issues/4655

Change-Id: I09269766124f7b77fde7c499c6f69a09989d1766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317684
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:49:06 +00:00
pq 05965ef720 + fix dangling library comments
Change-Id: Ia857fec46ddf83d307cd19450cea88aab8c86a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294430
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-11 20:17:38 +00:00
Josh Soref ba15a61271 Spelling build
Closes https://github.com/dart-lang/sdk/pull/50859

GitOrigin-RevId: 7b056018c2925745701bdecdd7da325d9458204d
Change-Id: Iff037d773713bf73efde6951599becfd7297b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277740
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 08:56:14 +00:00
Konstantin Shcheglov 8f70d95df0 Use TypeAliasElement.aliasedType instead of aliasedElement in analysis_server/..
Change-Id: Ib7c144b12c59a09be98f3a461bd50b5e0a663fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-09-12 19:38:19 +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 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 d19e1d16b9 Use LibraryFileStateKind to link.
Change-Id: I35a88c71e9cd1c6e05d3de28ecb7c5dabf75defd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250680
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-07 18:08:31 +00:00
Brian Wilkerson e0820bb508 Enable the prefer_function_declarations_over_variables lint in the analysis server
Change-Id: I53a6cd3c5d3be1c66173f52a7f01d8df63fd9350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249727
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-06-27 18:27:23 +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 52290eba28 Add CompletionSuggestion.libraryUri, keep isNotImported.
Change-Id: I1bce246c2d8eaa968a47ae6ba82114592b991a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-04 22:49:10 +00:00
Konstantin Shcheglov 2170c061b0 Add Element.libraryUri and CompletionSuggestion.isNotImported
Remove libraryUrisToImport and libraryUriToImportIndex.

Change-Id: Iafe27d6fb0c5ce0c623567a0384a4579274b151f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227580
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-11 19:53:14 +00:00
Konstantin Shcheglov 30ea5d1167 Return variable to either getter or setter.
Change-Id: I412b1747f95505c37812a4f72f5f1e0fe6fff81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-13 16:29:53 +00:00
Konstantin Shcheglov 979f3ea79e Use LibraryElement(s) to find extensions for 'Import Library' quick fix.
So, we don't need ExtensionCache anymore.

This fixes the issue with importing a library from lib/src sometimes.

Bug: https://github.com/dart-lang/sdk/issues/47842
Change-Id: I9a28fb2e1e14ab96a58c3ef72daa87562f1bccd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-12 17:39:22 +00:00
Konstantin Shcheglov e0752585f2 Use available files and element models for 'Import Library' quick fix.
We still use `ExtensionCache` to fix members.
I will try to change this next.

Change-Id: I047250b0fc9187673fcc88e80b1d40fc421db475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-10 20:35:40 +00:00
Danny Tuppeny 00ca3283c0 [analysis_server] Correct sorting of fixes, inverting priorities to maintain order
Fixes https://github.com/Dart-Code/Dart-Code/issues/3646.

Change-Id: I9784bbda8aa62d3506810fc7768d58a4cd2bf064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219706
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-11-08 19:55:02 +00:00