152 Commits

Author SHA1 Message Date
Paul Berry 643733b42e [analyzer etc] Add ignores for codegen to prepare for new syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

Updates the `CodeGenerator` mixin so that it outputs `ignore_for_file`
comments to ignore the following lints:
- unnecessary_type_name_in_constructor
- unnecessary_ignore
- duplicate_ignore

This mixin is used by the code generators that produce the Dart
wrappers for the analysis server and analyzer plugin wire protocols.

This is a first step towards migrating the packages `analysis_server`,
`analysis_server_client`, and `analyzer_plugin` packages to use the
new constructor declaration syntax, since it will allow the
`unnecessary_type_name_in_constructor` lint to be enabled without
breaking generated code.

Once all the packages have had their SDK constraints bumped to a
language version that supports the new syntax, I'll update the code
generator to use the new syntax, and remove the ignores.

For more information about the new constructor declaration syntax, see
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

Change-Id: Ied17e3ea772546675aad48efc324f6f16a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505521
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-22 10:30:17 -07:00
Paul Berry aaa48e2247 [deps] Roll prebuilt Dart SDK to 3.13.0-103.1.beta.
This will allow use of Dart 3.13 features (such as primary
constructors) within the SDK itself.

Note that some generated files required benign updates due to
formatter behavior changes.

Change-Id: I595554e9cff3dbaa3f11da407d6c26036a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503662
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-15 08:23:09 -07:00
Sam Rawlins 299dabac5f DAS: Enforce constant_identifier_names lint rule.
All we have to do is ignore it in some generated files, and then it
is enforced in all other lib, tool, test files.

Change-Id: I5822db725f9c632820323dd20f5d4b6554808c26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-20 11:09:49 -07:00
Sam Rawlins e9bf7d423a DAS: Simplify == code to use one expression
The code used to generate:

```
bool operator ==(Object other) {
  if (Other is X) {
    return a && b && c;
  }
  return false;
}
```

which is just simplified to the one expression:

```
bool operator ==(Object other) =>
  other is X && a && b && c;
```

Change-Id: I0d1a80b57598bd8e840c0cd99304ace64f4cd786
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-11-18 10:40:09 -08:00
Sam Rawlins 793aeaee01 DAS protocol: Update comments to use markdown codeblocks
One can see that we have bare HTML in these signature-in-comments,
like:

  "contextMessages": optional List<DiagnosticMessage>

These are flagged by the unintended_html_in_doc_comment lint rule.

This CL solves this by indenting these signatures 4 spaces, making
them Markdown indented code blocks. Alternatively we could use
backticks. Backticks would make the comments taller; indenting makes
them wider. I would prioritize whichever style is less intrusive when
reading them in plain text, which I think would be to use
indentation.

Change-Id: I019d9073e994a505325194ceeac3c6e0635d947e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-10-08 09:16:20 -07:00
Sam Rawlins 33f664940a Bump DAS to use Dart SDK 3.9.0
Change-Id: I04bc285d822a657adb5573c6de3eb38655ab0fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-03 12:56:29 -07:00
Sam Rawlins 1b212e6cee DAS: improve error-throwing code to include JSON
Most calls to `jsonDecoder.mismatch` include the 3rd argument. I add
more here, so that the error can say, "I expected this field in some
JSON, but instead the JSON looks like this: ..."

Change-Id: I7d1944624e1fe758d9732d71db6571a579dc4690
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-08-27 11:31:39 -07:00
Danny Tuppeny f3f45a0e88 [analysis_server] Fix some typos in readme/spec
Change-Id: Ifb14293a886eedd0ee868ac43ef18b6224967ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 10:03:07 -07:00
Parker Lougheed 04b178d8dc [analysis_server] Remove a few instances of dynamic
Change-Id: If117a852bf052f9e3deb879cdd92c48b68241b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423161
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-04-28 15:29:21 -07:00
Sam Rawlins b42700fb21 DAS plugins: Print plugin pub-related crash information to terminal; stop analyzing
Change-Id: Id7f3d9957c52239210029b3b5c3e6f58d96a4d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413000
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-28 14:38:48 -08:00
Danny Tuppeny a0b6a489f3 [analysis_server] Allow legacy clients to set LSP capabilities in setClientCapabilities
This adds a new field to the existing (legacy) setClientCapabilities parameters that accepts an LSP ClientCapabilities.

This will allow a legacy client to indicate that it supports things like the `workspace/applyEdit` reverse-request.

Change-Id: Ia3b75c701f1699c92f902e058daec4844ce664fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404106
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-14 08:56:41 -08:00
Sam Rawlins dbf6008297 DAS: Support monospaced text (eg code snippets) in generated doc comments
We take any `<tt>`-wrapped text, and keep it in some "monospaced" /
"teletype" format. For dartdoc we put it in backticks. For Javadoc
we put it in `<code></code>`, which looks standard for inline text.

This corrects some erroneous doc comment reference-looking text
(`offsets[i]`) which is not meant to be a doc comment.

Change-Id: I1d77a02368e3cde158ce95d3b0095ba09e071370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-12-17 12:24:58 -08:00
Sam Rawlins 73443c8603 DAS: Generated protocol 'enums' can be real enums
File sizes are reduced:

```
analysis_server_client's protocol_common.dart    - 132k -> 102k (-23%)
analysis_server_client's protocol_generated.dart - 453k -> 433k (- 4%)
analysis_server's        protocol_generated.dart - 528k -> 509k (- 3%)
analyzer_plugin's        protocol_common.dart    - 139k -> 108k (-22%)
```

Change-Id: I8018f1d09e053c9d3df340ba31cdb07cbd29acf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-07 17:27:18 +00:00
Robert Nystrom 732b07a42b Roll dart_style into the SDK.
I'm still chasing down a couple of google3 failures, but this is ready for review so that I can get it approved and land it once the last couple of failures are fixed. Here is who I think should review what:

athom@ for:

- DEPS

johnniwinther@ for:

- pkg/_fe_analyzer_shared
- pkg/front_end
- pkg/kernel

brianwilkerson@ for:

- pkg/analysis_server
- pkg/analyzer_plugin
- pkg/analyzer_utilities

kenzieschmoll@ for:

- pkg/dartdev

pquitslund@ for:

- pkg/linter/lib/src/lint_codes.g.dart

If you're not the right person, feel free to summon someone else.

Most of the changes here are re-running code generators that auto-format the code they generate. The changes are:

Roll in the latest dart_style commit:

- DEPS

Manually updated these test expectations to expect the new style:

- pkg/analysis_server/test/lsp/format_test.dart
- pkg/analysis_server/test/services/refactoring/agnostic/change_method_signature_test.dart
- pkg/analysis_server/test/src/domains/flutter/set_property_value_test.dart
- pkg/analysis_server/test/src/services/flutter/container_properties_test.dart
- pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart
- pkg/analysis_server/test/src/services/refactoring/convert_selected_formal_parameters_to_named_test.dart
- pkg/analysis_server/test/src/services/refactoring/move_selected_formal_parameters_left_test.dart

This was auto-generated by something, but I'm not sure why it thinks there is a diff:

- pkg/analyzer_plugin/doc/api.html

Updated to require a version of dart_style that accepts a language version in DartFormatter():

- pkg/analyzer_plugin/pubspec.yaml

Updated to always use the latest language version (and thus new style) when invoking the formatter:

- pkg/analyzer_utilities/lib/tools.dart

Manually updated the formatting in the code templates so that they matched the formatting expected by the tests, which implicitly format using the latest language version:

- pkg/dartdev/lib/src/templates/...

The rest are all generated files that are formatted so re-generated using the new style:

- pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart
- pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
- pkg/analysis_server_client/lib/handler/notification_handler.dart
- pkg/analysis_server_client/lib/src/protocol/...
- pkg/analysis_server/lib/protocol/protocol_generated.dart
- pkg/analysis_server/test/integration/support/integration_test_methods.dart
- pkg/analysis_server/test/integration/support/protocol_matchers.dart
- pkg/analyzer_plugin/lib/protocol/...
- pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
- pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
- pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
- pkg/analyzer/lib/src/dart/error/...
- pkg/analyzer/lib/src/error/codes.g.dart
- pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
- pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
- pkg/analyzer/lib/src/summary/format.dart
- pkg/analyzer/lib/src/wolf/ir/ir.g.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_000_1.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_001_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_010_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_100_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/simple/...
- pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
- pkg/front_end/lib/src/codes/cfe_codes_generated.dart
- pkg/front_end/lib/src/util/parser_ast_helper.dart
- pkg/front_end/test/parser_test_listener.dart
- pkg/front_end/test/parser_test_parser.dart
- pkg/front_end/testcases/...
- pkg/kernel/lib/src/coverage.dart generated
- pkg/kernel/lib/src/equivalence.dart generated
- pkg/linter/lib/src/lint_codes.g.dart

Change-Id: Ice0141b763e63b84f54692cd19a442a0719673c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391263
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-06 18:42:25 +00:00
Danny Tuppeny 75d15bbfa3 [analysis_server] Support formatter page width from analysis_options in legacy protocol
This adds the same support previously added to LSP to the legacy protocol.

As with LSP, the value in analysis_options overrides the explicit argument (since the expectation is that the user has not specifically chosen this value for this file, but rather as a default for the project/globally).

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


[analyzer] Add support for "formatter" in analysis_options + use page_width in LSP

This adds support for validation + completion for `formatter/page_width` in analysis_options, and uses this value in preference to the client-supplied value in the LSP server.

It does not yet add support for the legacy protocol, and there are a few questions in https://github.com/dart-lang/sdk/issues/56864#issuecomment-2399289974.

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

Change-Id: Ic2be00087f78eb62c409dbc8f558d2f24b521f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-10-08 17:31:46 +00:00
Danny Tuppeny 916272331b [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods
This avoids accidentally using the converter when talking to plugins, (at least for now) URIs are never expected, and file paths should always be used regardless of which mode the server is in.

This unfortunately touches a _lot_ of code, so I've pushed in many separate patch sets to Gerrit.

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

Change-Id: I312c3e2cbc35a05a078aaa0138aec7288b3c7dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373745
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-07-02 14:15:11 +00:00
Konstantin Shcheglov 8968e5500a CQ. Enable avoid_redundant_argument_values in analysis_server/
Change-Id: If9c09f81bdbac890553573a8491ca27cb4f22dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353805
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-26 19:51:41 +00:00
Danny Tuppeny c3d80286fe [analysis_server] Add a supportsUris client capability for legacy server to switch into URI mode
This adds support for the legacy server to switch to URIs using a client capability. In this mode, all "FilePaths" will be URI strings over the protocol (in both directions).

It also allows the server to send LSP notifications (wrapped inside an "lsp.notification" notification, matching how requests/responses work). Notifications are automatically enabled if the client uses any LSP methods or sends the new "supportsUris" capability.

Change-Id: I5d2b76e396862129c61de70d57397603c958a02d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349120
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-01 22:19:00 +00:00
Danny Tuppeny 8d936d38fc [analysis_server]/[analyzer_plugin] Make all toJson/fromJson methods go through a central converstion for Path<->URI Strings
This change shouldn't change any current behaviour, but means all "FilePath" types in the legacy protocol spec will go through a (currently no-op) conversion. The server will be able to replace this conversion based on client capabilities in a future CL.

Because a lot of the generated classes are in analyzer_plugin, this also moves the ClientUriConverter class there.

`pkg\analysis_server\test\src\utilities\json_test.dart` contains tests that the toJson/fromJson methods go through the converter recursively (inc. map keys/values/etc.).

Change-Id: If5aec884070128eea594540fd25a9017ada86079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349060
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-30 16:58:25 +00:00
Brian Wilkerson d45080d365 Remove support for the older legacy completion protocol
This does not remove the computation of available declarations. This CL
seemed big enough without that, so I (or someone else) can get that in
the next CL.

Change-Id: I67ab49b75c8a415ccfaef16c4e49a00026a6091f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-12-12 00:54:48 +00:00
Keerti Parthasarathy 9aca2789bb Add a method to BulkFixProcessor to compute changes to pubspec
Change-Id: I1c743df3780fea3f8cf930dad5085b4d2388fca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-10-16 21:54:25 +00:00
Danny Tuppeny 76dc2c4cfa [analysis_server] Change LSP-over-Legacy to be wrapped with the original protocol
Originally we didn't use the LSP Request/Response classes, and just exposed the handlers through the legacy request/response.

However there were some mismatches (such as legacy protocol always returns Map<String, Object?> but some LSP requests return Lists, LSP using int|String IDs, and LSP having numeric error codes that don't match legacy string error codes).

This change uses LSP's request and Response by wrapping them inside a standard (legacy) handler. The LSP-over-Legacy handler has become a standard handler, and the params contain an "lspMessage" field that holds an LSP message, and the result contains an "lspResponse" field that contains an LSP response.

If an LSP handler returns an error, it will be returned as an error inside the LSP response, which will be in a _successful_ legacy request (since that's how we can return an LSP response - as the result).

Change-Id: I67973590ab32f3543d1a6e1b7279974e5e8832bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315201
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 14:32:18 +00:00
Danny Tuppeny 2ff94f8882 [analysis_server] Allow action in response to showMessageRequest to be null
This allows for users to dismiss a notification without taking any action (something that VS Code / LSP allows for but this API did not).

Change-Id: Icf384008cfcfde6f150c63d3f2889e81e79d1dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-30 19:48:18 +00:00
Brian Wilkerson 3a7c7909a2 Specify the message request for the legacy protocol
Change-Id: Iecfa9228f3f17451da3efb403f54a3be17166353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289541
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 19:26:07 +00:00
Sam Rawlins f46c9afc12 [analysis_server] Add type arguments to remaining raw types
The Maps are all JSON, so they become `Map<Object?, Object?>`.

Most other types get a `Object` or `Object?` type argument, and a
few also get `dynamic`.

Change-Id: I097318defed55360b5b0d910bd2d085a121e97b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287673
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-16 20:37:57 +00:00
Oleh Prypin 88ac4a27a1 Revert "Roll the latest dart_style into the SDK."
This reverts commit bbba3c9788.

Reason for revert: latest dart_style has a few bugs and overall the changes should be discussed more

Original change's description:
> Roll the latest dart_style into the SDK.
>
> This includes support for records, patterns, sealed classes, and class
> modifiers. It also includes a fairly small number of style changes. The
> one that will be most noticeable is more compact switch statements.
>
> Change-Id: I9e89ba82d52bfa451fc54f9dd59048d72db48377
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285460
> Reviewed-by: Alexander Thomas <athom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Auto-Submit: Bob Nystrom <rnystrom@google.com>

Change-Id: I12fad53bdc75dda349b9362aeb84e798983bfa25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286420
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2023-03-02 13:16:36 +00:00
Robert Nystrom bbba3c9788 Roll the latest dart_style into the SDK.
This includes support for records, patterns, sealed classes, and class
modifiers. It also includes a fairly small number of style changes. The
one that will be most noticeable is more compact switch statements.

Change-Id: I9e89ba82d52bfa451fc54f9dd59048d72db48377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285460
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-03-01 16:08:40 +00:00
Alexander Thomas b9b6511ca6 Spelling sdk
Closes https://github.com/dart-lang/sdk/pull/50918

Co-authored-by: Josh Soref <jsoref@gmail.com>
GitOrigin-RevId: 1fd275051c561b63d374fb47e76a22424c4a12a9
Change-Id: I97790d9c79ff659f2c1fa2d2d46d041fe67957cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278530
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-01-20 12:37:49 +00:00
Sam Rawlins fdf59ad1eb Remove all support for super-mixins option
Bug: https://github.com/dart-lang/sdk/issues/50680
Change-Id: I96409d02e64d3e198e0fae4a55f58f871ce2aeac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275142
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>
2022-12-13 18:13:37 +00:00
Brian Wilkerson d9482e35ce Remove some unnecessary ignore comments in analyzer packages
Change-Id: I578285132f0d3f200cb2e9069750a1391940711d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 21:33:18 +00:00
Konstantin Shcheglov 671bb192ab Remove domain 'kythe' from DAS.
Change-Id: I66f0e538dce6eead6ba1c98b9cf0e3d747450130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264895
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 17:03:29 +00:00
Ahmed Ashour 5fe480b788 Fix typos
Fix #49864

TEST=ci

Change-Id: I9a7e06d604cd0b4f56f2ac229ab3fc9f01cb9d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-16 19:35:00 +00:00
pq c0e74c4433 [dart fix] report undefined diagnostics
Fixes: https://github.com/dart-lang/sdk/issues/49699

Change-Id: Ia412e4dce51b0887c3cd0d9b6d91f0ace926bea3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-24 20:35:59 +00:00
pq 1b2644afd2 [bulk fix] report undefined diagnostics
Change-Id: I4abe1e83c56e632f91a81510ec0a35b521cd11d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-18 16:11:36 +00:00
pq c4766b319a bulk fix support for specified diagnostics
Change-Id: Ifa98da5466b0efb1b88cfa17d06b6b4e1d4ba8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-08-17 17:50:03 +00:00
Ahmed Ashour 572f24882f [analyzer_plugin] consistent hashCode for SourceFileEdit
Fixes #49371

Change-Id: I853323df821a9b6481f6fdd190ccecba2c01aa2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250380
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-06 16:03:20 +00:00
Ahmed Ashour 466202bb34 [analyzer] remove lints ignore in generated files
Fixes #49039

Change-Id: I14e98fc5ab9c1f7b7e69f99dc1c97178b56c624d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245020
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-19 05:17:00 +00:00
Sam Rawlins 531e6e175f analyzer: Prefer string interpolations
ignore prefer_interpolation_to_compose_strings and
constant_identifier_names in generated files.

Change-Id: I963504e298f8e439734522fed9ac09911750f419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-05-04 20:45:25 +00:00
Brian Wilkerson 4eaf2d68cd Add a new request to format all of the files in a directory
This is marked as experimental, and is only intended to be used by
`dart fix` as a way of formatting the files that were modified if the
analysis options file indicates that they ought to be formatted.

Change-Id: I288baebfc7cb3f82cc361bdc19835e43064eb0d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-28 17:13:40 +00:00
Jaime Wren b63550cb85 Change reference from .packages to .dart_tool/package_config.json in the analysis server spec_input.html
Bug: https://github.com/dart-lang/sdk/issues/48272
Change-Id: Ica02829fbf9309327210e67d059d4606bb58b528
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2022-03-04 00:02:01 +00:00
Jaime Wren a2f887ea59 New optional enum input, CompletionCaseMatchingMode, in DAS getSuggestions2 request.
Change-Id: Ibddcd7db4f51266c29a104d2b46e93c29ddf5465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2022-02-15 00:15:00 +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
Jaime Wren c548470d26 Dart Analysis Server change to the code completion getSuggestions2 protocol, adding completionMode and invocationCount.
Change-Id: I6095cda72943a52de211cf758fbf45fe98d6f0d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2022-01-05 21:15:50 +00:00
Danny Tuppeny 30e4510f20 [analysis_server] Add a server.cancelRequest request for cancelling outstanding requests
Change-Id: I1b43b0e61e5cc89261170ce13613fad756600d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-12-09 17:39:43 +00:00
Sam Rawlins 973f2b17e0 Remove some implicit casts in analysis_server
There are a lot of implicit casts, so this CL includes:
benchmark/, many in test/, and tool/.

Most changes are quite mechanical, using `Object?`.

I also changed some functions to use types other than `dynamic`.

Bug: https://github.com/dart-lang/sdk/issues/41651
Change-Id: Id77037aae71d41e2bdca52958fdc01c43d3d51a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221885
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-12-02 22:21:47 +00:00
Konstantin Shcheglov ad5da2976b Add optional 'timeout' field to 'completion.getSuggestions2'.
The intended use is in benchmarking, to specify a long timeout, so that
the first time, when we warm up, we do necessary one time work,
which would usually run out of budget the first few times. So, the
requests that we do measure are more stable.

Change-Id: I22e870b84dcd6f2ac201c5ec57081c39c6529ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220129
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-15 16:48:42 +00:00
Konstantin Shcheglov dd3759d9cc Revert "Remove ServerService.LOG"
This reverts commit 41397cbb9a.

Reason for revert: Actually, we do use it in google3.

Original change's description:
> Remove ServerService.LOG
>
> It looks that it is not used. We have a way to turn it on in
> DartAnalysisServerService.java in Dart plugin for IntelliJ, but
> setServerLogSubscription is not used in the plugin, marked as to be
> used in the Flutter plugin, but actually is not used there.
>
> Change-Id: If851044385100543ec0ff30e02dee3d99f1558e4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219362
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: If5b807bf40adb8527aa801608fac6b1052adf67f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-05 02:18:28 +00:00
Konstantin Shcheglov 41397cbb9a Remove ServerService.LOG
It looks that it is not used. We have a way to turn it on in
DartAnalysisServerService.java in Dart plugin for IntelliJ, but
setServerLogSubscription is not used in the plugin, marked as to be
used in the Flutter plugin, but actually is not used there.

Change-Id: If851044385100543ec0ff30e02dee3d99f1558e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-04 22:56:26 +00:00
Konstantin Shcheglov 4487759dd2 Document new DAS completion APIs.
Change-Id: I2ff1f2c494033a62fead7d828d5d875b55eda203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215643
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-21 18:21:35 +00:00
Kevin Moore b67a67e03c pkg:analy* - don't call .hashCode within Object.hash functions
Follow-up to https://github.com/dart-lang/sdk/commit/cb7c932f7bed440ead0279845c2e8e578cbdea41

Change-Id: Ie00e7759880bfc80f7b04a79979325d26607f148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214581
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-26 21:49:04 +00:00