Commit Graph

6233 Commits

Author SHA1 Message Date
Konstantin Shcheglov fba1416943 Macro. Report diagnostics during resolution.
Change-Id: I23095ad18f7289c1df3463c0d835f76976e09118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339223
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-12-01 23:01:48 +00:00
Konstantin Shcheglov ebf05be9b8 Macro. Add isMacroAugmentation to FileResult.
Change-Id: I5aa887212338bfc80a3f6cb15310f06ad1b2b48f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339107
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-30 21:30:23 +00:00
Brian Wilkerson 8b03d7e024 Fix a comment in code completion support
Change-Id: I3e87e8f3f78002d8b29cc32e92a0a052d84f414e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339202
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-30 19:02:30 +00:00
Sam Rawlins 9de396953f analyzer: Track fixes in YAML files
This may seem to be a silly change, adding these lists only for the
error fix status file, but I claim this is a very pragmatic solution:

* It is important and beneficial to correctly track error fix
  statuses; I was recently confused about these fix statuses because
  the text in the fix status file was a lie.
* When fixes are added for more errors, you cannot forget to update
  the codesWithFixes list because the fix won't apply (and no test
  asserting the fix works would pass).
* Overhauling these FixGenerators to use maps like the others is maybe
  a good change in the long run, but at this point might be
  over-engineering; we only have fixes for 2-3 codes for each file
  type.

Change-Id: Iaa902acf2401f97ff722e222910f5d6fcd00a5ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-11-29 23:19:54 +00:00
Danny Tuppeny 7f9099e75a [analysis_server] Fix static type on hovers for non-synthetic getters/setters
Fixes https://github.com/Dart-Code/Dart-Code/issues/4863

Change-Id: Ie4272b77e81fcee282e22002a8cc3f58611af969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338821
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-29 23:18:09 +00:00
pq 6864496d2b Update EditFormatIfEnabledResult to anticipate multiple options in a contextRoot
I'm not crazy about the re-constitution of `File`s (see the TODO) but I'm not sure this is a yak we want to shave now (especially since this handler is not yet in use).

Larger context: https://github.com/dart-lang/sdk/issues/53876

Change-Id: I4b9814842525ed4440aa39a7d14baa75f526f72a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-29 22:16:38 +00:00
Keerti Parthasarathy a7e402df46 Add more test cases to test pubspec fixes for missing dependencies.
- Use YamlNode to access spans and offsets instead of casting.
- Add logic to merge conflicting edits when removing multiple entries
from dev_dependencies.

Change-Id: I1f20b5a4691c37e9f56293acbaf870a489380b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338592
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-11-29 19:34:49 +00:00
pq 7d64b343c0 get enabled plugin names from the analysis driver
See discussion: https://discord.com/channels/608014603317936148/1171510601655275612/1179140354004492369

Change-Id: I3447f633e810bb3b4942142eeaa4a0e7504bec0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-28 23:51:29 +00:00
Brian Wilkerson 3641fc33d6 Suggest local declarations in new framework
Sorry for the length of the CL. I couldn't really think of a good way
to split it up further.

The first pass was previously suggesting everything declared in scopes
below the class level. This CL expands that to include everything
declared in the current library. It does not include imported
declarations. It also doesn't yet handle members suggested after a
period. Those are both being handled by constributors.

Please look over the tests carefully. There are more changes than I
would have liked, although I think they're mostly for the better (as
in, the suggestions are more accurate), but I could easily have
missed an invalid change.

Change-Id: I98b3cfc8440ee5da09a8e6828c946d65d8d77759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338482
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-11-28 21:48:28 +00:00
Danny Tuppeny 4f0dc3bfd9 [analysis_server] Ensure textDocument/didClose removes overlays synchronously to avoid races when files are closed/opened quickly
Plugin re-registration could cause VS Code to send us a close/open request very close together and this `await` before removing the overlay could result in them being processed in the wrong order. This resulted in subsequent file updates failing with "Unable to edit document because the file was not previously opened"

Fixes https://github.com/Dart-Code/Dart-Code/issues/4862
See also https://github.com/Dart-Code/Dart-Code/issues/4740

Change-Id: If6beeebdd79914e1b26553b81f4fb38f000cbaf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338660
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-28 17:52:57 +00:00
Danny Tuppeny 7d3020f14f [analysis_server] Handle snippet completions correctly in return statements
Fixes https://github.com/Dart-Code/Dart-Code/issues/4843

Change-Id: I59c41c2ef6439583465a729785fe379c03583cce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-11-27 19:28:09 +00:00
Parker Lougheed 597d7e4d82 [analysis_server] Verify training dev server waits for analysis to complete
Without this fix, the notification handlers were being called multiple times
due to the original listener not closing in time.

Fixes https://github.com/dart-lang/sdk/issues/51017
Closes https://github.com/dart-lang/sdk/issues/54161

Bug: https://github.com/dart-lang/sdk/issues/51017
Change-Id: I969e46496a9a330252cf8247b97cb057befabbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337882
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-27 18:54:59 +00:00
Danny Tuppeny 4266d645b3 [analysis_server] Use declaration docs instead of element docs to avoid needing to rewrite indentation
Change-Id: I50270c9594bd7647e174fa1dc2a60c6dd38952bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338001
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-23 17:59:00 +00:00
Danny Tuppeny 15ac79c93d [analysis_server] Fix a test that's failing on Windows
This code uses `Element.documentationComment` in the generated code and assumes it has the correct line endings. However, `documentationComment` is always normalized to `\n` so that's what we need to replace when building the new code.

Change-Id: I83c73bfeccbce7ec8621da2759f042f736fbe4d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337724
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-22 18:18:11 +00:00
Konstantin Shcheglov 800619634b Extension type. Issue 54081. Report ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR.
Bug: https://github.com/dart-lang/sdk/issues/54081
Change-Id: Id539dd6693eaab0a86f51982e4497943e150d5b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337608
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-22 00:58:09 +00:00
Danny Tuppeny 2aa6fa772b [analysis_server] Don't send redundant empty LSP diagnostics
We never need to send empty diagnostics to the client unless we have previously sent a non-empty set. These empty diagnostics account for a large amount of traffic during initial analysis and also could be quite large when modifying files with dependencies.

See https://github.com/dart-lang/sdk/issues/53501

Change-Id: I3d0e2ea2633469da905c8ca328dcc89e38a64edc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-21 20:05:04 +00:00
Danny Tuppeny cfcd74e72c [analysis_server] Remove some boilerplate from LSP tests
No functional changes, just some refactoring extracted from another change to simplify reviewing.

This just:

- adds an `initialAnalysis` getter for tests since it's very common to wait for
- adds a `diagnostics` map that tracks the current state of diagnostics in a test (to avoid tests setting up their own tracking)
- removes some duplicating code for sending diagnostics by having NotificationManager call LspAnalysisServer to send them
- removes unnecessary experiment flags from LSP tests

Change-Id: I1811f393a6d3446550f9007ede926f9ca4556563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-21 19:02:16 +00:00
Sam Rawlins dd6c961bf0 Remove all pre-NNBD support in the linter code
In this CL we "remove" 3 linter rules, and any subsequently unused quick fixes:

* `always_require_non_null_named_parameters`
* `avoid_returning_null`
* `avoid_returning_null_for_future`

We also delete any code that branched on pre-NNBD libraries; these are
no longer supported.

Change-Id: I3bad7a44de3563e5737919c878170213ad506b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-21 18:55:01 +00:00
Parker Lougheed 9e328d4af3 [analysis_server] Do not suggest Type instance methods on extension static member access
Fixes https://github.com/dart-lang/sdk/issues/52962

Bug: https://github.com/dart-lang/sdk/issues/52962
Change-Id: I516050aa3592a33a7710dc13d79cd6e4b0208b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337420
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-21 00:24:16 +00:00
Konstantin Shcheglov ff0db172a7 Macro. Migrate exceptions to AnalyzerMacroDiagnostic subtypes.
Change-Id: I443da89078c7dabb83430187d42b1e7b1d5a2ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-21 00:09:49 +00:00
Sam Rawlins 20f05ad0bd Remove Hints that only fire on pre-NNBD code
These Hints and any subsequently unused quick fixes are deleted:

* HintCode.CAN_BE_NULL_AFTER_NULL_AWARE
* HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE
* HintCode.NULL_AWARE_BEFORE_OPERATOR
* HintCode.NULL_AWARE_IN_CONDITION
* HintCode.NULL_AWARE_IN_LOGICAL_OPERATOR

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

Change-Id: I1b9326ae3c83fcc6be7a7ba4a5f493fc08cc75be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-20 21:20:07 +00:00
Parker Lougheed a35921065b [analysis_server] Preserve field doc comments in CONVERT_CLASS_TO_ENUM assist
Fixes https://github.com/dart-lang/sdk/issues/53202

Bug: https://github.com/dart-lang/sdk/issues/53202
Change-Id: Icbc1627da55eb7c680cba802fdb931a843317b3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336860
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-20 18:29:28 +00:00
Parker Lougheed 4b09c6d205 [analysis_server] Account for different assignment operators in convert_to_switch_expression
Before this fix, mixes of assignment operators were allowed and converted to a default assignment, changing the semantics of the code.

Change-Id: Ie88ffc5eacaec7cb722f2e2c56980c7f21905260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336983
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-20 18:21:25 +00:00
Parker Lougheed 984e4b214f [analysis_server] Resolve TODO in convert_to_switch_expression quick assist
I'm looking to make some additions to this assist, but to make review easier and assist my understanding, I combined the logic for determining if a switch statement is supported, and if so, what kind it is.

Change-Id: Ic5c48df82c305c31898dd884178ce78ce7da28f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336782
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-17 22:53:26 +00:00
Brian Wilkerson d86a114d49 Move the generation of type parameter suggestions
Change-Id: I3ab850747ab9c12360ffcccd80120b7723af8420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336840
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-17 17:26:38 +00:00
Parker Lougheed 4f0417d8cc [analysis_server] Don't offer convert_to_if_case_statement_chain assist when body is empty
Fixes https://github.com/dart-lang/sdk/issues/54077

Bug: https://github.com/dart-lang/sdk/issues/54077
Change-Id: Id0efda426308d5eb42564c696f52a21fa0d62a55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336783
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-17 16:26:25 +00:00
Keerti Parthasarathy 5ed46e624e Fix exception when running dart fix against flutter examples.
Ran against the code used in flutter customer_testing.

Change-Id: I330e528b3184c7a05ab34f9040a802dc06146b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-11-17 15:56:20 +00:00
pq 07c77f59a2 Final todo updated format fixes
This should tidy up the last ones. 🤞

Sorry for the noise!

Change-Id: I7104fc33282184acb0c843eae6e73f6fcc77d892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336723
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-11-16 20:18:32 +00:00
Brian Wilkerson 974b97ca3f Fix the semantic highlighting for both extension types and mixins
Change-Id: Ie64494adbe9d54810b0b156b4884734bdb801309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336601
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-15 23:01:13 +00:00
Danny Tuppeny be709b288c [analysis_server] Ensure exclude folder paths are always normalized
Workspace folder paths were normalized but these ignore paths are not.

Change-Id: Idc6197b04d740e473bc3f3fede1d7798f5b94944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336364
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 18:08:32 +00:00
Konstantin Shcheglov 444ad4daae Include 'localVariableDistance' feature into relevance.
Bug: https://discord.com/channels/608014603317936148/1174045252164796566/1174149206571753594
Change-Id: Id3aed7cc67194a5efdbfbf1851c132b8e7b933e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336320
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 17:08:10 +00:00
pq bec6e82853 migration to driver.getAnalysisOptionsForFile (continued)
Change-Id: Ia22286786febe7e915df0d7e7b18b9657fef2b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-14 22:41:28 +00:00
Danny Tuppeny 4dddc98fc6 [analysis_server] Include 'required' keyword in closure completion text
This adds missing 'required' keywords when completing closures. The keyword is only added to the completion text and not the displayed label because there's limited space for completions and seeing the end of the completion (for example `=>` vs `{}` is more useful.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4834

Change-Id: I3cb791bcd84533e9bc3819d8a527233f026849bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 22:38:39 +00:00
Danny Tuppeny 28d9ac03ef [analysis_server] Fix missing closure completions in LSP
Closure completions disappeared in eb73dba14d because we ended up wiping our the filterText/label when trying to clean them up for functions.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4837

Change-Id: I61976734356117aa1ec0fae81c8a56245f2b35c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 22:33:01 +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
Danny Tuppeny 467bd633c4 [analysis_server] Fix location of inserted prefix for annotations
Fixes https://github.com/Dart-Code/Dart-Code/issues/4836

Change-Id: I628dca1e97b800bf2559276864d143e0e2bba377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336002
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 19:44:21 +00:00
Danny Tuppeny f7697fa6cb [analysis_server] Disable bulk-fix for "add await"
Fixes https://github.com/dart-lang/sdk/issues/54022

Change-Id: I806f019c598fb0ea352cf211c575c9f94c05577e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 18:38:02 +00:00
Sam Rawlins 73ab31b98a analyzer: Move the Source class to be public API.
Deprecate accessing LineInfo, Source, or SourceRange via the
old library (pkg/analyzer/lib/src/generated/source.dart).
Migrate all SDK code to the new library.

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

Change-Id: Ic7c98a5820415c92a457f9fa2756351b05520cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-14 17:10:37 +00:00
pq 63118a139d handle more flutter_style_todos cases
Change-Id: Iadf85cc56193c16c041097ca33a2a819a204bc37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-11 05:23:25 +00:00
pq 8258b6cc1e fix more flutter_style_todos (and address a null access)
Change-Id: I826f4f1f1f59325d618574779efd10e51038f23e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-09 21:03:58 +00:00
pq 2cce183a71 quick fix for flutter_style_todos
Handles:

* missing space before `TODO`
* missing colon
* lower case `todo`



Change-Id: Ib0e00e992d42c4d29fee87679c45dae10448653d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335024
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-09 18:08:21 +00:00
Sam Rawlins 93541c708c linter: Remove two deprecated linter rules
Fixes https://github.com/dart-lang/linter/issues/4800

Change-Id: I4eef17ca19ea7469fba372c28eef7618249c48dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334080
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-09 17:03:15 +00:00
pq 9e6c856c27 migrate to getAnalysisOptionsForFile(file)
This migrates the bulk of the calls to `.analysisOptions`. I'll tackle the remainder in a few follow-ups.

Change-Id: I0f4c78d88938feecaba7202e0dc299dc17e2bb35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334647
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-08 21:48:38 +00:00
Polina Cherkasova cd96507b72 Switch from leak_tracker/leak_tracker to leak_tracker/memory_usage.
It is relanding of https://dart-review.googlesource.com/c/sdk/+/334143

Contributes to https://github.com/flutter/flutter/issues/135856

We want Flutter to take dependency on leak_tracker. It will be easier to manage in G3 if Flutter and Dart SDK depend on different packages. So, separated memory_usage and switching analyzer to it.

Change-Id: Ic85172bfe28cf070e01f5ff298ee975b25ae6f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335061
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
2023-11-08 20:57:51 +00:00
Keerti Parthasarathy ccb65e9469 Add support for bulk fixes for deprecated_export_use
Precursor to re landing the changes to dartdev.

Change-Id: Ia4e3093d1dc234ff54e38a1d121068417ba8e795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334960
Auto-Submit: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-08 19:01:57 +00:00
Danny Tuppeny bdab586ec6 [analysis_server] Don't fail when adding non-file workspace folders
I'd previously fixed non-file workspace folders that existed during initialization, but not those added later via `didChangeWorkspaceFolders`.

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

Change-Id: Ie991fc9755857cb1786505fce34c47e5a1be72d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-11-08 17:42:40 +00:00
pq 354f91a25b add an allAnalysisOptions getter to driver based contexts
Change-Id: I0dc6a2508ba89afc86a663cbd0557d168a0c7cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334643
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-07 20:57:29 +00:00
pq 7cf32a83dc Reland "add a file property to FileResults"
This is a reland of commit 18c8a50557

Original change's description:
> add a `file` property to `FileResult`s
>
> Change-Id: Ibec62da4552da3124d85f6020f4e8e1dac8a757b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333588
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: Ia6e04cdf73e55c100fe5e2b5b6678f1c6bffc327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334361
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-11-07 15:52:12 +00:00
Oleh Prypin 72195c41bb Revert "Switch from leak_tracker/leak_tracker to leak_tracker/memory_usage."
This reverts commit 64adde8968.

Reason for revert: package is not ready for use in g3

Original change's description:
> Switch from leak_tracker/leak_tracker to leak_tracker/memory_usage.
>
> Contributes to https://github.com/flutter/flutter/issues/135856
>
> We want Flutter to take dependency on leak_tracker. It will be easier to manage in G3 if Flutter and Dart SDK depend on different packages. So, separated memory_usage and switching analyzer to it.
>
> Change-Id: Ib1a7aae4af8c5dfb84e9f7252319862b0c93a8b2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334143
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Polina Cherkasova <polinach@google.com>

Bug: b/309525596
Change-Id: I02cb1097839e37910e40f38f856230a82abbfe61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334462
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-07 11:07:19 +00:00
Polina Cherkasova 64adde8968 Switch from leak_tracker/leak_tracker to leak_tracker/memory_usage.
Contributes to https://github.com/flutter/flutter/issues/135856

We want Flutter to take dependency on leak_tracker. It will be easier to manage in G3 if Flutter and Dart SDK depend on different packages. So, separated memory_usage and switching analyzer to it.

Change-Id: Ib1a7aae4af8c5dfb84e9f7252319862b0c93a8b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334143
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
2023-11-06 23:06:11 +00:00