72 Commits

Author SHA1 Message Date
Konstantin Shcheglov b1ee5a3ec3 CQ. Replace MockSource with FileSource in analyzer_plugin/.
Change-Id: Id45b00c588a7557e3cf6258b26afe25ea3848372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499741
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-30 22:30:34 -07:00
Paul Berry 9f6d1c1029 [messages] Start using toplevel diagnostic constants.
Changes the analyzer and related packages so that when they refer to
diagnostic constants, they do so via the import prefix `diag`, which
refers to the appropriate `diagnostic.dart` file containing the top
level diagnostic constant declarations, rather than the static
declarations inside `DiagnosticCode`-derived classes (which will soon
be removed).

This CL was created by the following steps:

- Run the script
  `pkg/analyzer_utilities/tool/messages/switch_to_toplevel_diagnostics.dart`.

- Execute `dart fix --apply --code=unused_import,unnecessary_import`
  on the following directories (this removes imports that are no
  longer necessary due to the change):
  - `pkg/analysis_server`
  - `pkg/analyzer`
  - `pkg/linter`
  - `pkg/analysis_server_plugin`
  - `pkg/analyzer_plugin`
  - `pkg/analyzer_testing`
  - `pkg/front_end`
  - `pkg/analyzer_cli`

- Execute `dart format` on the following files and directories:
  - `pkg/analysis_server`
  - `pkg/analyzer`
  - `pkg/linter`
  - `pkg/analysis_server_plugin`
  - `pkg/analyzer_plugin`
  - `pkg/analyzer_testing`
  - `pkg/front_end/test/scanner_test.dart`

  (Note that `pkg/front_end` and `pkg/analyzer_cli` are not
  re-formatted as whole directories because they contain `.dart` files
  that are test cases rather than source code, and reformatting those
  files might change test expectations.)

- Manually add `diag` to
  pkg/front_end/test/spell_checking_list_tests.txt.

- Manually fix the ignore comment in
  `pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart`. (The
  script `switch_to_toplevel_diagnostics.dart` automatically adds it
  after `import 'package:analyzer/src/diagnostic/diagnostic.dart' as
  diag;`, but then executing `dart format` bumps the ignore comment to
  the following line, where it has no effect.)

Change-Id: I6a6a69643022aab2b5a6224fb4124eead243260d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-11-12 16:53:42 -08:00
Sam Rawlins b40781459a Bump analyzer_plugin to use Dart SDK 3.9.0
Change-Id: Ice7b7e978ccc666c18cbea9cb9e79673893066ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-02 14:07:49 -07:00
Paul Berry f2123a8f7c [analyzer] Rename error constants to camelCase.
This change was generated by the following process:

- The script `pkg/analyzer/tool/messages/rename_error_constants.dart`
  was run. This generated the vast majority of the diffs.

- Then all modified files were reformatted using
  `tools/sdk/dart-sdk/bin/dart/format`.

- Finally, the script `pkg/analyzer/tool/messages/generate.dart` was
  run, to rebuild generated code.

Change-Id: I6a6a69644ed8740ad6269d98cb169076151824ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-08-13 22:02:42 -07:00
Sam Rawlins 69cd0ee5f6 analyzer: Deprecate "errorCode" parameters in Diagnostic constructors
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: Ifc173ec6e5924057fee3c420c8916f0abb257428
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434141
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-06-11 14:19:09 -07:00
Sam Rawlins 7b42aae99f analyzer: Deprecate AnalysisResultWithErrors.errors in favor of .diagnostics
Also rename UnitAnalysisResult.errors (package-private API) to .diagnostics

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

Change-Id: I0bdd7c9c19cff3bff9ee61fe4689564a7b5b727b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433581
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-06-09 15:51:01 -07:00
Sam Rawlins c4c9854b9b analyzer_testing: Move ResourceProviderMixin to analyzer_testing
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I31932409e495369793dd16c017385c98b86cf44c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427480
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 16:56:29 -07:00
Sam Rawlins 126def2b08 analyzer_plugin: Use Diagnostic instead of deprecated AnalysisError
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: Icf62987d6de7cafb6f6e92076a5fcc2bd48772c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426522
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-05 11:34:00 -07:00
Konstantin Shcheglov a5468363c6 CQ. Remove unnecessary 'async' where no 'await'.
Change-Id: I58f56c098c9cec753325ab56d0aad37e1fde0ec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403082
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-07 10:08:11 -08:00
Jonas Finnemann Jensen d2d5de63a4 Avoid context confusion in ServerPlugin.analyzeFiles
Change-Id: Ib2500c17e4abe2a485fb8325134276f803113db4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388701
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-11-07 23:47:12 +00:00
Sam Rawlins 895093e9f9 Initial PluginServer implementation
This is the core implementation of the "plugin server" that will support the API described at https://docs.google.com/document/d/1T8P323DJxsc3YPzveNIaSKWFkrJp9ydTR4jp_XFb7XQ/edit?resourcekey=0-f8Ue29KMUizqXNGhATp1tg#heading=h.23fjh5hfm2is

This is heavily curbed from the ServerPlugin class at
`package:analyzer_plugin/plugin/plugin.dart`, but does not depend on it.
It depends on two concepts from the analyzer_plugin package: (1) the
protocol used for de/serializing requests, responses, etc. And (2) the
`PluginCommunicationChannel` class. This is also just a utility for
communicating between the analysis server and the plugin server.

This plugin server is capable of "registering" individual "plugins",
which allows plugins to register individual (maybe multiple) lint rules,
and individual (maybe multiple) quick fixes.

The plugin server for now only responds essentially to three requests:

* `ANALYSIS_REQUEST_SET_CONTEXT_ROOTS`
* `EDIT_REQUEST_GET_FIXES`
* `PLUGIN_REQUEST_VERSION_CHECK`

All files are analyzed during `handleAnalysisSetContextRoots`, and
quick fixes are calculated during `handleEditGetFixes`.

There are many TODOs, but the included test shows that this plugin
server can notify the analysis server of lint diagnostics to be
reported, and can respond to a query for quick fixes.

Change-Id: Ibc93332319220a2caf49d20ab480940041a15049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-08-29 16:03:42 +00:00
pq bc34c295ae final -> var for package:analyzer_plugin
Change-Id: I0e7cd26dcb0c7de1b4f7e19b66719d5a73670ce7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345824
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-12 22:37:40 +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
Devon Carew 3b0b1bd863 Bump package:lints to the latest; address instances of new lints.
Changes:
```
> git log --format="%C(auto) %h %s" 8d5f750..b044aca
 https://dart.googlesource.com/lints.git/+/b044aca add several rules to core and recommended (150)
 https://dart.googlesource.com/lints.git/+/81100a2 fix a dangling table link (146)
```

Diff: https://dart.googlesource.com/lints.git/+/8d5f7500024320654adb1e799e49fc10c5304ae7..b044acab9f6669b3d8e781923a8ff86877801177/
Change-Id: I031333ade99af700a7009b14a36d3aadba12fc94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327321
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-25 21:15:15 +00:00
Konstantin Shcheglov 036b8cafad Add AnalysisError.tmp() constructor, deprecate the default one.
Bug: https://github.com/dart-lang/sdk/issues/51985
Change-Id: I1204c71a4c5ea62d32d65662ecb5274dacb0bfae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301730
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-05-08 14:39:29 +00:00
Danny Tuppeny a7baf9309f [analysis_server] Ensure plugin protocol classes only use types valid for Isolate.send()
Fixes https://github.com/dart-lang/sdk/issues/50594.

Change-Id: I5550239dbce4a1ed7fbd844dd53642989289c899
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-01 16:57:56 +00:00
Sam Rawlins 5f8ef7be53 Enable new linter rules in analyzer packages
Change-Id: Id0182648a347a05cbf6e1483a0afe94219268853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-11-21 23:02:38 +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
Konstantin Shcheglov e81b3006bf Fix ServerPluginTest on Windows.
Change-Id: I2a13e4be2d1b3ea3794c0d6f01ae5c2eb13f4561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-06-21 21:41:19 +00:00
Konstantin Shcheglov 46b73c6785 Use AnalysisContextCollection for DartServerPlugin.
Not for landing, has debug logging.

There is also an example (also not for landing) of a concrete plugin.

Change-Id: Id79336205b7b6d4cd462e7cfa0fdc7bea41c2987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-06-21 18:48:44 +00:00
Konstantin Shcheglov 20b560226e Rename newFile2() to newFile().
Change-Id: I1c2a4f15dee607a0a6241dfaf2d764a7d284389b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241510
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 02:59:57 +00:00
Konstantin Shcheglov 139385c615 Breaking changes for analyzer version 4.0.0
Change-Id: I26961f29f9171e94db2f5c95f1f8af5fd01bb9b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-07 06:52:27 +00:00
Konstantin Shcheglov 41b3e0abcc Make 'content' required in ResourceProviderMixin.newFile()
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:31:48 +00:00
Konstantin Shcheglov 3b89039454 Deprecate Source.isInSystemLibrary
Change-Id: Ifb76cc37e5b0aa86713675cf27086f6ce7625fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220822
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-19 20:30:37 +00:00
Konstantin Shcheglov d6d45d96f8 Deprecate Source.modificationStamp
Change-Id: Id7f361beff1c4e3f9edc743c58cce7888d330c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 19:33:07 +00:00
Konstantin Shcheglov fb05622b3b Deprecate Source.uriKind
We almost can remove it.
Unfortunately surveyor/lib/src/analysis.dart uses it, so we need to
update it first.

Change-Id: I239d24506f99183147bf45744a6f8d66d3eb4f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220826
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-11-19 18:29:07 +00:00
Konstantin Shcheglov 7e6b3d83b8 Mark all Source.encoding implementations deprecated.
Change-Id: If12b9af54def3754a701477241d8364c283921ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 16:03:27 +00:00
Konstantin Shcheglov bb732826fb Stop implementing AnalysisTarget by Source, remove source and librarySource getters.
Change-Id: I3a1d81ea33641156dccc67b1ed486e449741a5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 16:02:47 +00:00
Brian Wilkerson 9db372e6f4 Make Location.endLine and Location.endColumn optional fields in the protocol
In https://dart-review.googlesource.com/c/sdk/+/191862 we added two new
required fields to `Location`. Unfortunately this was a breaking change
because plugins using an older version of the `analyzer_plugin` produce
location objects without those fields, leading to deserialization failures.

This CL makes those fields optional in order to fix the deserialization
issue.

Unfortunately, the `analyzer_plugin` package was published after the
required fields were added. Making them optional is a breaking change
because the constructor parameters go from being positional to being
named parameters.

We also neglected to update the version number of the protocol as part
of the previous CL. Technically this is also a breaking change for clients
of the analysis server, but given that they had no way to test to see
whether these fields existed they would need to have been written as if
the fields were optional in order to reference them at all, so I think
that from a practical standpoint it isn't a breaking change. That does,
however, raise the question of whether we should increment the version
numbers as part of this CL.

Change-Id: I35fc1f8e950669a3d8dd33cee6b81890261b5c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206942
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-07-15 17:35:55 +00:00
Konstantin Shcheglov 114d7b980a Migrate analyzer_plugin package to null safety
Bug: https://github.com/dart-lang/sdk/issues/45236
Change-Id: I01175a2b2b1eb3ce6cdf30ade794d8186c6e8ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 00:29:37 +00:00
Brian Wilkerson d00ef8611a Update the server protocol to support passing back the line and column numbers for the end of a range
Change-Id: I8310e4a32cacbe98310c1dbaa3b3563b1ff1a1ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191862
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 19:22:23 +00:00
Sander Kersten 089ca8c1eb Make compute assists async and fix message
Fixes #44730.
Fixes #44731.

For "fixes" there were similar bugs that I've fixed as well.

Closes https://github.com/dart-lang/sdk/pull/44758
https://github.com/dart-lang/sdk/pull/44758

GitOrigin-RevId: e08b25ea2890fc6f796c9cc0411fe7a71eaf70b9
Change-Id: I026c325d9d362775e178a7621a17ce6ff919ed40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-23 17:58:57 +00:00
Mike Fairhurst 334d368146 [analyzer_plugin] Remove unused dart:async imports
Change-Id: I079d5f7c1f6c36d4e76ecd41b5d22e4199c1304c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161464
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 18:09:52 +00:00
Konstantin Shcheglov a45d66c6e9 Make MockAnalysisDriver implement AnalysisDriver, not extend.
The way we used to configure it does not work with changed I want to
make, specifically we were given SourceFactory with no resolves,
so no DartUriResolver, so no SDK.

R=brianwilkerson@google.com

Change-Id: Ibf798aae1792366cfbe240f9781038568936146d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-28 21:56:45 +00:00
Brian Wilkerson 6f15530536 Enable omit_local_variable_types in analyzer_plugin
Change-Id: I908e15b4820eab0e8375994ce3cebfac332306f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 04:06:49 +00:00
Konstantin Shcheglov abf7d1fc08 Issue 40572. Pass Packages to AnalysisDriver.
Just as SourceFactory is given to AnalysisDriver, so should be Packages.
Understanding --packages and discovery in out of scope.

Bug: https://github.com/dart-lang/sdk/issues/40572
Change-Id: Id120fba0f23a4423797fa9976c4cda5ed54dad53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135188
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-11 00:57:45 +00:00
Brian Wilkerson 7494f58032 Enable always_declare_return_types in analyzer_plugin
Change-Id: I972f0e2569de64397828d887b1fb37fcf57e006f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133408
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-26 23:13:34 +00:00
Brian Wilkerson 491201aae6 Enable use_function_type_syntax_for_parameters in analyzer_plugin
Change-Id: I78e70d652a1f4c8539767d65beb9a08882f78e55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132455
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-18 20:12:33 +00:00
Brian Wilkerson f34a25099b Enable slash_for_doc_comments in analyzer_plugin
Change-Id: I9cafff7fcbf6c8930e3ac8ddba05061601aa8223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132452
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-18 18:17:31 +00:00
Brian Wilkerson 03c33360b7 Remove unnecessary uses of new in analyzer_plugin
Other than
- the change to enable the lint (in analysis_options.yaml) and
- updates to the generator (in tool) to stop generating 'new',
all of the changes were generated by dartfix.

Change-Id: I9d14b99ab748ef5b80f8800a802e20100eee04a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128577
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-17 20:12:05 +00:00
Jens Johansen 9f57cf71d7 Add a blacklist to spelling tests; spell-check all packages and sdk with blacklist
Change-Id: I5bf3d5784d2ba48568a2699bb09ae39a85be17c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115214
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-03 12:39:24 +00:00
Konstantin Shcheglov e3c8774543 Add AnalysisSession.analysisContext, stop using AnalysisDriver's AnalysisResult outside the driver.
Change-Id: I63138e002d9e777f51d2d843f7ef2b1f32fed3e0
Reviewed-on: https://dart-review.googlesource.com/c/82529
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 14:16:31 +00:00
Konstantin Shcheglov e223bd3628 Replace most of direct uses of MemoryResourceProvider with ResourceProviderMixin.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I87114418b63ef68665b9c3e487980a72db00ec6a
Reviewed-on: https://dart-review.googlesource.com/c/81744
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-27 17:50:10 +00:00
Brian Wilkerson 180b3dd301 Remove extra spaces in copyright notices in analyzer_plugin
Change-Id: Icf01fbdd84747fc92908fe5ca818124c5df992af
Reviewed-on: https://dart-review.googlesource.com/c/79640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 18:05:23 +00:00
Brian Wilkerson 0bb8cbd9cb Use void in place of Null in analyzer_plugin
Change-Id: I21a3d3646c5906256e21fb8d7d71f8433b1b39e9
Reviewed-on: https://dart-review.googlesource.com/69500
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-11 15:30:28 +00:00
Devon Carew 17b53a2835 Test out no_implicit_casts on the analyzer source base.
Change-Id: I4eb2414d7d9bbe21883c9e5e8eca10f2eaafb465
Reviewed-on: https://dart-review.googlesource.com/62725
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-06-28 02:20:43 +00:00
Konstantin Shcheglov 8c20f26234 Use mock of AnalysisResult in analyzer_plugin.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ia185d6f24d3cd250dc0b42aecb64aea482e0a46a
Reviewed-on: https://dart-review.googlesource.com/58841
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-06-06 19:09:54 +00:00
Konstantin Shcheglov a9fef15ff3 Add FileResult and AnalysisDriver.getFileSync().
I thought that getSourceKind() might be not the best API. We are moving
away from Source, and it seems that we should stop using SourceKind as well.

R=brianwilkerson@google.com

Change-Id: I0fcff8dc8cefcd6d8fb899badab8037bf8d67775
Reviewed-on: https://dart-review.googlesource.com/58442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-06-05 20:51:37 +00:00
Danny Tuppeny 568e977a35 Update FoldingKinds enum, update specs and increase version number
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ieccfd90ead67a9803744c54db4eec8eea0b0403c
Reviewed-on: https://dart-review.googlesource.com/54920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-14 16:48:48 +00:00
Konstantin Shcheglov 9976cddcd7 Shared cache of FileState contents.
This makes Flutter repo analysis about 12% faster.

R=brianwilkerson@google.com, devoncarew@google.com

Base: 76.2 74.9 75.9
After: 65.6 66.0 66.6 67.1
Change-Id: I5afffdae15eacf2c09c4ede40d7312c8827bae0c
Reviewed-on: https://dart-review.googlesource.com/51061
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-13 16:43:36 +00:00