Commit Graph

6288 Commits

Author SHA1 Message Date
Sam Rawlins d2a47e9cce analyzer: Add YouTube doc directive support
Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: I4887304a4029c0279ae67bd45e8ef391a3eae56e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-06 15:45:48 +00:00
Keerti Parthasarathy 8b601a1cd2 Add support for extension types to document symbols.
Change-Id: Ie7fd8fc4812a84e1fbbc9760fb2f4e40c514c29c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324265
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-09-05 20:07:20 +00:00
pq ee2bc9d870 highlight the late token in unnecessary_late reports
Fixes: https://github.com/dart-lang/linter/issues/4742

Change-Id: Ia13a325dc44a49f5aab3d564f3adc0c10e80c4f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-05 18:49:26 +00:00
Danny Tuppeny cf5336c244 [analysis_server] Support extension types in Call Hierarchy
Change-Id: Ibc7a2df9135da1169e45b5eca4861a213eeea4f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-05 15:46:07 +00:00
Danny Tuppeny 82bd6a2e43 [analysis_server] Include extension types in LSP Type Hierarchy
Change-Id: If7a708d1a6f1b4133528fca6786375fffb2560e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324200
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-05 15:41:48 +00:00
Danny Tuppeny 144ea5b206 [analysis_server] Fix snippet context for initializing formals
Fixes https://github.com/dart-lang/sdk/issues/53308

Change-Id: I5b7f409882f00f347f014142c40be27ee81fed8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324100
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-04 17:28:47 +00:00
Johnni Winther e3621561aa [parser] Refactor BlockKind
Refactors BlockKind to pass an explicit template/message instead
of injecting words directly into the message which leads to
grammatically incorrect english in the output message.

Change-Id: I3b91abf2e5a748f3dfca2cc0a6c877e77b3ad7d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322121
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-04 09:40:21 +00:00
Konstantin Shcheglov 53cd950e7a Extension type. Code folding.
Change-Id: I33ee2cf63a275c7c2d8f41c4033a0ee4d2641e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323944
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-01 20:47:23 +00:00
Konstantin Shcheglov 49f5312fed Extension type. Overrides notification.
Change-Id: I1865e0d44093c1501b422d1b6d34fbc1e9612db8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323943
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-01 20:44:38 +00:00
Konstantin Shcheglov a0d32a1e3f Extension type. Include into 'occurrences' notification.
Change-Id: Ibfe62a4916c9b991e5d407e239d82ad8eb90b5ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323923
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-01 20:07:35 +00:00
Konstantin Shcheglov 13e109e6b6 Extension type. Workspace symbols.
Change-Id: Ied0e652a18f07ab3b3e7d2a0d76bf20bf3dc55d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323921
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-01 19:15:48 +00:00
Konstantin Shcheglov 3e4ab6bc16 Extension type. Implemented markers.
Change-Id: I9477ac521f8889a935fe8b439b92f9cb65acad69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-01 18:56:57 +00:00
Konstantin Shcheglov 12bd986c71 Extension type. Request based test for rename, a fix for representation field.
Change-Id: Ic10550089272797724a0047a31fa040f4a293001
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323706
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-01 17:53:57 +00:00
Konstantin Shcheglov 84f65be285 Fix 'Extract Method' refactoring inside extensions.
Change-Id: If055456980361c5ec768bf5cb104af11cfa1b12e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-01 17:06:39 +00:00
Konstantin Shcheglov 80a76ff357 Extension type. Extract method refactoring.
Change-Id: I34e08182b568bfc0296b45851ccedb803595efa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323701
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-31 21:35:39 +00:00
Konstantin Shcheglov 55634cbb5b Extension type. Rename refactorings.
Change-Id: Ia65a8e18ff0a92b799ac376872b621e69ad61701
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323683
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-31 20:40:00 +00:00
Konstantin Shcheglov 2c9089f120 Extension type. More tests for search, highlight, navigation.
Change-Id: Iffa7e73be52219591dc75f8aacb7defa4b001b1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-31 19:36:37 +00:00
Sam Rawlins 734e9c3c5b analyzer: Report configurations in doc imports
Work towards https://github.com/dart-lang/sdk/issues/50702

Change-Id: If9c3d702f16e609e0d1f2c2bf09ec02a73cd5a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323427
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 21:26:28 +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 5926a7301b [analysis_server] Fix duplicate fields when extracting widgets
Fixes https://github.com/dart-lang/sdk/issues/53383

Change-Id: Ia985f1c71c99416906bac4669ff61961d32f29fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 21:10:49 +00:00
Konstantin Shcheglov f722afcf0c Extension types. Support for sorting.
Change-Id: I632b05f9e02283eca663e68d6087230182003e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323425
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-30 18:55:31 +00:00
Danny Tuppeny eb73dba14d [analysis_server] Add support for additional completion label details
This allows more of the signature and URI to be shown in the full completion list without needing to cursor through each item to see it.

Some examples can be seen in https://github.com/Dart-Code/Dart-Code/issues/2462#issuecomment-1663786808

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

Change-Id: Ib8290f90c31f974271109df7912d230b5e824319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 15:51:03 +00:00
Sam Rawlins 1288b96e52 Parsing support for doc imports
Work towards https://github.com/dart-lang/sdk/issues/50702

* This adds a `docImport` field to the `Comment` class.
* Doc imports are parsed with the standard Fasta parser and
  AstBuilder.
* We add one static check that `deferred` isn't used. Other
  checks are needed.
* Many tests.
* We need to add support for line splits in a doc comment.
* I think doc comment imports need to be visted by AST visitors,
  but maybe I am wrong...

Change-Id: I06e2b6fe42ef5ce916d46d9a9db35334726677d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322591
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 15:35:18 +00:00
Kallen Tu af24f1d61a [analyzer] Report more specific diagnostic codes instead of INVALID_CONSTANT.
Add a more specific, but for general use, diagnostic for when the evaluator encounters a type parameter. The errors should match more closely to the CFE errors now.

This CL also tidies up some other areas like `_evaluatePropertyAccess` and produces a better error than `INVALID_CONSTANT` when you try to access something that's not String.length.

Change-Id: I4780e6e52049887a0ee44cdf046968f332527079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322364
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-29 22:36:02 +00:00
Keerti Parthasarathy 49d159da36 Add a file name parameter to sort imports function
Change-Id: Ie41c7f28f90a74449dfb26e78a1c417d6fd82440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323204
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-08-29 20:04:17 +00:00
Kallen Tu 1c67426891 [analyzer] Report cycles in constant constructors.
Cycles were not previously reported because constructors don't have an
evaluation result (since it depends on the invocation arguments).

This CL uses the ConstantVerifier to check every constant constructor.

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

Bug: https://github.com/dart-lang/sdk/issues/46735
Change-Id: Ie8419787b621abb303ecc738aa36f2e7abf96a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-29 19:02:38 +00:00
Konstantin Shcheglov 83fc715bef Extension type. Report EXTENSION_TYPE_WITH_ABSTRACT_MEMBER.
https://github.com/dart-lang/language/commit/913b81ed505cbe2cd21bb77b108293314d298184

Change-Id: Ic3303744ea4c1f2cc90df63a3ae52b51861757ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-28 18:55:00 +00:00
Danny Tuppeny 9004168e1a [analysis_server] Fix filterText for overrides
I noticed filterText was incorrect in some cases - for example if label was "MyClass(a)" filterText should be only "MyClass" without the "a".

There was a test for this but it was wrong, it checked filterText was null, even though label contained parens (a null filterText means use label).

I renamed the tests so they moved around a little, but they should be clearer (and more correct) now.

Change-Id: If94f80e8d7dc8b394c49eebb4d7482de2d62c38b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-24 19:09:35 +00:00
Danny Tuppeny b5ed2bb7c0 [analysis_server] Add support for survey prompts
Change-Id: I0447de090311694712fce005806c6ac296ca2eac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322406
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-24 16:36:02 +00:00
Johnni Winther b1594fa130 [parser] Handle invalid extension type header in error recovery
This expands the existing recovery for class headers to handle
invalid, out-of-order, and duplicate clauses in extension type
declaration headers.

Change-Id: I7b33b91cc718e4c0673137121b8d083fa0ef1562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321900
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-24 11:20:18 +00:00
Danny Tuppeny 7e68622678 [analysis_server] Extract a UserPromptSender to simplify sending prompts to the user
This mirrors a similar change made for OpenUriNotificationSender to avoid callers having to check the `supportsShowMessageRequest` flag before calling `showUserPrompt`. Instead, they can ask for a sender and get a `null` if it's not supported.

Also removed a `!` in initialization options that was a bit dangerous (I triggered errors while testing surveys) and instead made all code that reads initialization options handle the case where initialization hasn't happened with a safe default where appropriate.

This should not change any functionality, it just makes an upcoming CL (with functional changes) smaller/simpler.

Change-Id: I730b7879b5f49a3b6c99414b054724e2c0ca6515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-23 16:39:33 +00:00
Johnni Winther 7e9c1c8018 [parser] Add error recovery to extension type declaration parsing
This changes the parser to always interpret `extension type` as the
start of an extension type declaration.

Recovery is added to handle missing identifier, primary constructor,
parameter constructor parameters, and extension type declaration body.

Change-Id: I98cac0b2641167c4708fa20b22f0de0a70336457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-22 12:05:10 +00:00
Danny Tuppeny cd4b9527eb [analysis_server] Fix "dart fix" not handling directives_ordering
Fixes https://github.com/dart-lang/sdk/issues/53261

Change-Id: I5b7f87efeee1046959b81f0a07f07ce1f81706d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-21 16:44:11 +00:00
Keerti Parthasarathy 36a146f037 Add utility methods for format and sort imports
Change-Id: I6f0408d8da8592ad125bcb4b9c4ff90fc3a9540c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-08-18 14:55:59 +00:00
Helin Shiah 6b03758f76 Collect analytics from VS Code remote usages
This is the ID sometimes sent for internal VS Code users, and we want to capture these users as well for some internal IDE tracking.

Change-Id: Id3b5aa89eacefb873e88b59745014454a89e6a73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-08-17 20:24:30 +00:00
Kallen Tu 48245c1064 [analyzer] Issue 53163: Fix crash with unresolved object in String length for const expressions.
Unresolved types would throw in `stringLength` and we don't handle them the same way we do with the other operators. Throwing EvaluationExceptions is the problem here, but that's for another CL.

In the meantime, this CL makes `stringLength` consistent to the other operators in the DartObjectComputer.

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

Bug: https://github.com/dart-lang/sdk/issues/53163
Change-Id: Ib99b61736d699056fa3c379e4d9c79756a4425f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-08-17 19:48:28 +00:00
pq edaea9b489 quick fix for REDECLARE_ON_NON_REDECLARING_MEMBER
See: https://github.com/dart-lang/sdk/issues/53121

Change-Id: I324f8a14820da2e9e5b714f9f1d88c647f9cfebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-17 17:28:59 +00:00
Sam Rawlins 7ee87f8601 [analyzer] Remove all support for strong-mode
This looks pretty beefy; it is more-or-less 3 parts:

* Removing the `implicit-casts: false`, `implicit-dynamic: false`
  modes:
  * Remove `AnalysisOptionsFileConfig.implicitCasts|implicitDynamic`
  * Remove `AnalysisOptionsImpl.implicitCasts|implicitDynamic`
  * Remove `TypeSystemImpl.implicitCasts`
  * Remove all behavioral tests of the modes
  * Remove Analysis Options-parsing code that handled `strong-mode`
* Remove ability to fix deprecated modes (introduced before Dart 3).
* Move some non-generated AnalysisOptionsHintCodes and
  AnalysisOptionsWarningCodes to be generated. As
  `AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED` was the
  last `AnalysisOptionsHintCode` code, there were problems with the
  code-generator, unless I moved these non-generated codes.
  * `DEPRECATED_LINT_HINT`, `DEPRECATED_LINT_HINT_WITH_REPLACEMENT`,
    `DUPLICATE_RULE_HINT`, `INCOMPATIBLE_LINT`, `UNDEFINED_LINT`.
  * Those codes are then added to error_fix_status.yaml.

Change-Id: Ic165b60ca85f08f92886433eac5f5da5b7dd5021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316483
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-17 17:07:37 +00:00
Brian Wilkerson 0a717608ca Convert more methods from KeywordContributor
Change-Id: I41cc30d36fa42dcfc2d17bf262f3cad7dc412d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320960
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-17 16:45:46 +00:00
Jonas Finnemann Jensen 43c8d637bd Refactor PubspecValidator
Unclear, if this was intentionally written as classes.
It just seemed confusing to me. Since the classes were essentially
functions that had some of their arguments passed in the constructor
and some of their arguments passed in a method call.

It also seemed impossible to reuse the actual objects.

Change-Id: I56b341ee4851d24b9d176857a53b96f7eb941335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317883
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-16 12:31:30 +00:00
pq b08f029558 verify that members marked as redeclaring actually do
See: https://github.com/dart-lang/sdk/issues/53121

Change-Id: I39294952a3adf0f037417d6e04811e3294128e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320886
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-15 23:05:50 +00:00
Konstantin Shcheglov a8580d3bd3 Extension types. Check implemented non-extension type agsinst representation, not erasure.
See https://github.com/dart-lang/language/pull/3262

Change-Id: I3ee081f43e4b3bf5159450fa94be2ab1672539de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-14 21:03:58 +00:00
Brian Wilkerson 0239101041 Convert more KeywordContributor methods
Change-Id: I9cbf77e115b77d635f1bec3c046fb38749ea76c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-11 21:38:31 +00:00
Kallen Tu adb68f4bb0 [analyzer] Provide better errors for invalid .length access in const expressions.
Add a new error message `CONST_EVAL_PROPERTY_ACCESS` for when we try to get 'length' on anything that's not a `String`.

This adds more specific errors for string length that would've went to the catch-all error at the end of `_getConstantValue` before. It should be more clear now what the error is.

Fixes https://github.com/dart-lang/sdk/issues/47273, https://github.com/dart-lang/sdk/issues/52833

Bug: https://github.com/dart-lang/sdk/issues/52833, https://github.com/dart-lang/sdk/issues/47273
Change-Id: I1f5daed82be00c6a8ecd43384d7ff9e59219cbb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319160
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-11 20:08:31 +00:00
Konstantin Shcheglov 0ce9ae9204 Extension types. Report when multiple representation fields.
Change-Id: I8d920ecdb04bb8b27f83b3126c8106682f613a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320124
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-11 19:48:01 +00:00
Konstantin Shcheglov 1c2934d42f Extension types. Report an error if the representation field has a modifier.
Change-Id: Ied3e14f67a4aad18b11c17f0ed8d986f95a3c9f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320123
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-11 18:41:12 +00:00
Keerti Parthasarathy f3acac0b5a Add an option to format code to BulkFixProcessor
Change-Id: Ie069b5e16ccf0c13c1f61cd38690b20968b7c907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319868
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-11 17:53:28 +00:00
Parker Lougheed 410c394374 [analyzer] Mark DEFAULT_LIST_CONSTRUCTOR as removed
Follow-up to https://dart-review.googlesource.com/c/sdk/+/276770

Change-Id: I583d19e3fab99594a12083381cc98cd1e453efcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319641
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-11 14:54:58 +00:00
Konstantin Shcheglov 53cccf9c8b Extension types. Report when implemented extension type representation is not a supertype of the declared extention type.
Change-Id: Iebb19c3f57046db600305993cc69dae04946889d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-10 18:38:04 +00:00
Danny Tuppeny acefe9ab6d [analysis_server] Extract LSP registration options from ServerCapabilitiesComputer
This is a non-functional refactor that extracts the growing set of capabilities and options from ServerCapabilitiesComputer into files alongside the handlers they relate to.

The motivation for this is that for LSP-over-Legacy we'll need to accept client capabilities (and return server capabilities). The server capabilities will be different to the standard LSP ones (they will be a subset, and we might not support dynamic registration - at least initially). However the features we do support will have the same registration options, so to avoid duplicating them this moves the registration options away from the creation of the ServerCapabilities.

In future, we might consider further wrapping up a "feature" (which consists of these registration options, and the related handlers), but this change is already quite large and I just wanted to progress capabilities for LSP-over-Legacy so we can handle things like Code Actions (which require executeCommand and possible reverse-requests for applyEdit).

Change-Id: Iecd0aa36626fa44826f7d4dbd6e6c0d758075239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-10 17:10:48 +00:00