Commit Graph

292 Commits

Author SHA1 Message Date
Sam Rawlins 9d41f28545 DAS plugins: document that a git URI can be used
Change-Id: I8bcac6d4816af2ba3b27f271cf39959371d3da2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509544
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-06-04 21:09:29 -07:00
Konstantin Shcheglov 46bb00bfae Start analyzer 13.2.0-dev, analyzer_plugin 0.14.11-dev, analyzer_testing 0.3.1-dev, analysis_server_plugin 0.3.17-dev
Change-Id: I08c2d7d8829ebe0eba147baa52a754e71b43c145
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-06-04 12:51:41 -07:00
Konstantin Shcheglov 050afdb4ae Prepare to publish analyzer 13.1.0, _fe_analyzer_shared 101.0.0, analysis_server_plugin 0.3.16, analyzer_plugin 0.14.10, analyzer_testing 0.3.0
Change-Id: I61d4d2e2da18ed1ea2c1eaf78138a32774535be0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-06-04 11:21:35 -07:00
Sam Rawlins d0f27293ce DAS plugins: Respect the analysis roots set by "dart analyze"
Work towards https://github.com/dart-lang/sdk/issues/62686

`dart analyze` uses an 'analysis.setAnalysisRoots' "command" to let
the analysis server know that the user requested, for example,
`dart analyze foo` or `dart analyze foo/bar.dart`. This was not conveyed
to analyzer plugins, so analyzer plugins will always analyze the entire
context collection.

(For some reason, only files in the "analysis roots" were reported in
stdout; maybe DAS or dartdev does its own filtering on diagnostics.)

This change forwards the `setAnalysisRoots` request to DAS plugins using
a new protocol message that mirrors the one for the server.

We should not change the behavior of `analysis.setContextRoots` for
legacy plugins, so we keep sending that request as per usual. Then
we send `analysis.setAnalysisRoots` at the same time.

If we receive an `analysis.setAnalysisRoots` message, dispose and
delete references to the existing context collection, and instantiate
a new one, with the specified `included` and `excluded` paths.

Change-Id: I53627da1c30351a22b5e5410a557bf486620a7aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 13:47:02 -07:00
Sam Rawlins 19ca914f74 Remove redundant lint rules
use_null_aware_elements is included in the lints package analysis
options.

Change-Id: I01222fc7e84be32da657f04b16e15af7d5861433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-27 10:26:22 -07:00
Sam Rawlins b8b1e01173 DAS plugins: Fix cmdline where plugin diagnostics are never reported
In the recent change,
https://dart-review.googlesource.com/c/sdk/+/503040, the asynchronous
nature of the change required adding _new_ hooks to track that the
plugin isolate is analyzing or not. I missed removing the old hooks.

The result is that an invocation of `dart analyze` will get a notification from the plugin isolate that it is analyzing, and then
_immediately_ a notification indicating that it is not.

So this change removes the old hooks.

Change-Id: Idc871d25c043ee1be94030729a1fd8226bdc753f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-18 07:55:28 -07:00
Sam Rawlins cbd61d792e DAS plugins: Make better use of the analysis driver
Fixes https://github.com/dart-lang/sdk/issues/62649

This change overhauls what the PluginServer does when it receives requests from DAS like watch events, overlay changes, setting context roots, and setting priority files, to use the AnalysisDriver APIs. These APIs provide a much smarter, more fine-grained mechanism for determining which files need to be re-analyzed.

This requires a lot of changes that really don't seem obvious (or just,
to me, they are not intuitive), because they relate to Streams being
processed, drained, read, etc. So I'll summarize as much as I can:

* In order to track that results coming from AnalysisDriver are
  definitely for the same AnalysisSession we are concerned with, at
  any given time, we add `_filesBeingAnalyzed` and
  `_filesBeingResolved`. These two maps are cleared any time the plugin
  isolate is notified of changes, so there is not a memory concern.
* We add a `waitForIdle` method which is just used by tests
  occasionally, in order to ensure analysis is complete.
* We tackle a related bug mentioned in the issue thread regarding
  adding or removing overlays without changing the source contents.
  There are now a few checks that old-content is not equal to
  new-content.
* Due to the more async nature of reading events off of the analysis
  driver, we have to be more particular in tests about sending
  `AnalysisSetContextRootsParams` and reading from the notification
  stream, so there are a lot of changes in tests to re-position these
  calls.

This results in massive savings in re-analysis time. Using the example in https://github.com/dart-lang/sdk/issues/62649, typing in the
`build_runner/lib/src/logging/build_log_logger.dart` file, I see the
following:

* Before this fix, every keystroke results in 183 files being
  re-analyzed by the plugin (always 183).
* After this fix:
  * keystrokes that do not result in a summary change (or maybe
    fine-grained deps analysis), like whitespace, results in 1 file
    being re-analyzed (the file I'm editing).
  * A keystroke that results in slightly changed summary, like changing
    an import to something invalid, results 2 or 4 files being
    re-analyzed.
  * A keystroke that changes the name of class BuildLogLogger (large
    change to summary) results in 9-10 files being re-analyzed.

Change-Id: Ie35053b0d90457b5b4b53bc8803188def0308d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-14 09:57:59 -07:00
Sam Rawlins 54d25a757e DAS plugins: Add missing changelog entry for 0.3.15
Change-Id: Ic77b945edbf640528467ab3e3e7e5d5f905f97f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503581
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-05-14 09:39:36 -07:00
Konstantin Shcheglov 1309dffc0a CQ. Move analyzer diagnostics back into analyzer.
Move the analyzer-only Diagnostic, DiagnosticMessage, Severity, and
locatable diagnostic helper types out of _fe_analyzer_shared and into
package:analyzer.

I paln to make changes outlined in
https://github.com/dart-lang/sdk/issues/63311 and chat discussion.
Keeping these classes in the analyzer simplifies the migration and
avoids introducing a shared abstraction before there is a concrete need
for one.

If we decide later need to have a shared abstraction, we can always
extract one at that point. With coding agents internal code motion is
cheap.

Update analyzer, analysis server plugin, analyzer plugin, linter, and
scanner call sites to import the moved APIs from analyzer libraries, and
refresh API baselines to reflect the new public owner.

Change-Id: Ie0ef0f01c6e4be7ebaac25619ac3e3fe991a44d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-07 13:54:59 -07:00
Konstantin Shcheglov 921ec7f507 CQ. Simplify Scanner constructors.
Replace the positional Scanner constructors with a single constructor
that takes the input text and error reporting callback as named required
arguments.

Remove the unused fasta forwarding constructor, reader offset handling,
and stored first token. The scanner now keeps only the input text and
returns the token stream directly from tokenize.

Update analyzer, analysis server, plugin, CLI, scrape, and scanner test
call sites to use the named constructor arguments.

Change-Id: Ieabb7b28570d4a963563fb2d1c5ef5ac0c89032a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-05 14:04:00 -07:00
Keerti Parthasarathy 3520930c67 Add fine grained timings for assists and refactor computations.
These are displayed in the Timings Insights page and sorted by elapsed time.

Closes https://github.com/dart-lang/sdk/issues/62983

Change-Id: Ifc64680ef7b00eecf5e0a5c88e988ba28c6fe6e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499740
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-01 10:16:55 -07:00
Konstantin Shcheglov 245f876407 CQ. Abstract Scanner away from DiagnosticReporter, so that we don't need Source to scan.
Change-Id: I377a49a7997f416acdfde3a05616715abaa84ad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499780
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2026-05-01 09:17:00 -07:00
Konstantin Shcheglov 560f44af01 CQ. Switch clients to default constructor of FunctionTypeImpl.
Also rename the public `FunctionTypeImpl` constructor formal parameter
from `parameters` to `formalParameters`, matching the API exposed by
`FunctionType`.

Change-Id: I6f9bbeed06cee708f78bb7127843222db08e1d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-28 17:13:48 -07:00
Konstantin Shcheglov 84ce4ba3df Start analyzer 13.1.0-dev, analyzer_plugin 0.14.10-dev, analyzer_testing 0.2.7-dev, analysis_server_plugin 0.3.16-dev
Change-Id: If445461ac9c3fca85656c69d66fb5e99a5d2e339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-22 12:36:09 -07:00
Konstantin Shcheglov f2c40f98fd Prepare to publish analyzer 13.0.0, _fe_analyzer_shared 100.0.0, analysis_server_plugin 0.3.15, analyzer_plugin 0.14.9, analyzer_testing 0.2.6
Change-Id: I67692af1ed67a50b55ba1e7a5d907f85e6572040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497342
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-22 11:38:06 -07:00
Konstantin Shcheglov 6cd3938741 Breaking changes for analyzer 13.0.0
https://github.com/dart-lang/sdk/issues/62799
https://github.com/dart-lang/sdk/issues/62944
https://github.com/dart-lang/sdk/issues/63002
https://github.com/dart-lang/sdk/issues/62970

Looks mostly green in google3: https://fusion2.corp.google.com/presubmit/901021300/OCL:901021300:BASE:901308428:1776439417713:37cd1695

Change-Id: I44754a48f66a0b58851d7c20fcfa61f7fb1b555a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488624
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-17 23:06:25 -07:00
Sam Rawlins 0918445e9f DAS plugins: Implement plugin shutdown support
Fixes https://github.com/dart-lang/sdk/issues/62974

Change-Id: Id3d1373b5814715b9b52d3f266557e85d620296e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-16 10:40:33 -07:00
Konstantin Shcheglov 9bec262263 FixCrash. Fix inferUndefinedExpressionType() to handle missing positional / named record type field.
Change-Id: Ie3758d195f8f4e352880616c50b1f28a7337eeb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493964
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-08 17:28:26 -07:00
Brian Wilkerson c6a0f08eb0 Update convert-into-block-body for primary constructors
This updates convert-into-block-body to work on primary constructor
bodies.

It also makes it work for top-level container declarations.

Closes https://github.com/dart-lang/sdk/issues/63039

Change-Id: I9b57b73a631aee8446f6c046d6faf23e7eea827f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493488
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-08 13:14:34 -07:00
Konstantin Shcheglov 7ecd14fb10 Start analyzer 12.2.0-dev, analyzer_plugin 0.14.9-dev, analyzer_testing 0.2.6-dev, analysis_server_plugin 0.3.15-dev
Change-Id: I426a42588163b3e3680fea80ff7965ca7d076eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-08 13:06:30 -07:00
Konstantin Shcheglov 1b3b1a154f Prepare to publish analyzer 12.1.0, _fe_analyzer_shared 99.0.0, analysis_server_plugin 0.3.14, analyzer_plugin 0.14.8, analyzer_testing 0.2.5
Bug: https://github.com/dart-lang/sdk/issues/63113
Change-Id: I58a32cfd25dfdd4663aefa79ddaa64dda67d486a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493481
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-08 10:54:40 -07:00
Keerti Parthasarathy c14d910249 Add more fine grained timings while computing fixes
Bug: https://github.com/dart-lang/sdk/issues/62983
Change-Id: If610a4dcf8a33143a623344f3bb4ad0a49cfd022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-03-30 11:15:20 -07:00
Khanak Khandelwal 1c38429ffa [analysis_server_plugin] Add short note about single LintCode instance
Closes https://github.com/dart-lang/sdk/pull/63006

GitOrigin-RevId: bb93c8af4d9d3f440ad12e66f5dfa58591943c41
Change-Id: I7a9c2e71bc90e22ea10e7a43a5cddda4ff91cb9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491521
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-03-29 13:49:42 -07:00
Konstantin Shcheglov 23e558876a Start analyzer 12.1.0-dev, analyzer_plugin 0.14.8-dev, analyzer_testing 0.2.5-dev, analysis_server_plugin 0.3.14-dev
Change-Id: Ib0971736635e507fbd1cc4a214ccba8beea83639
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490346
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-24 17:03:40 -07:00
Konstantin Shcheglov ea94b269d1 Prepare to publish analyzer 12.0.0, _fe_analyzer_shared 98.0.0, analysis_server_plugin 0.3.13, analyzer_plugin 0.14.7, analyzer_testing 0.2.4
Change-Id: Ia46a1ba04db30a15d8848e8e1586795921a33ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-03-16 19:32:20 -07:00
Sam Rawlins 7d0a17196c DAS plugins: Add print-debugging support in Insights pages.
Work towards https://github.com/dart-lang/sdk/issues/61868

This adds a new notification type, 'PluginPrint'. There are several
fields and variables then named 'pluginPrint' or 'print', and I am
definitely open to changing these names, but this is the best one that
I thought of.

PluginPrint has three fields: The name of the plugin that printed, the
message that was printed, and the timestamp.

We wrap each plugin's AnalysisRule invocations with a zone, so that
the `print` handler can know the name of the plugin. The prints are
caught and sent to the server isolate as Notifications. The
PluginIsolate then stores the collected prints. The Plugins Insights
page can then retrieve them and display them.

Manual testing, with 1000 libraries that get new lint reported once per
file, I did not observe a negative performance impact.

Change-Id: Id800ae41781c15ce89d06b563878c2b0edae43d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-03-16 14:56:59 -07:00
Konstantin Shcheglov e9d8109258 DeCo. Support empty bodies in membered declarations
Allow enums, extensions, and mixins to use `;` as their body and
represent that form explicitly in the AST. The parser now produces
`EmptyEnumBody` or `EmptyClassBody` for the empty form.

Also replace `LibraryIdentifier` with token-based `DottedName` and store
the full token sequence for dotted names. This preserves periods and
source offsets directly in the AST, which keeps printing, selection, and
directive name handling working with the new shape. See
https://github.com/dart-lang/sdk/issues/62819

See https://github.com/dart-lang/language/issues/4645

Google3 presubmit looks green:
https://fusion2.corp.google.com/presubmit/884063020/OCL:884063020:BASE:884079610:1773618867493:b2110d76

Change-Id: I2d023cd03b6423da634c3e14742e02a61dc3b403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-03-16 08:56:11 -07:00
Jens Johansen 2849d34c7c [analyzer] Replace regex in ignore_info with normal code
The RegEx engine in the VM was updated in
e443b89f23 which caused the analyzer
analyzing the CFE to use ~150 mio instructions more.

Part of this was an increased cost in ignore comment processing which
relied on regex. Using regex before the updated engine made
`processPrecedingComments` have a cost of ~240 mio instructions,
updating the regex engine took that to ~264 mio instructions.

This CL gets rid of the regex and takes the cost of
`processPrecedingComments` to ~74.4 mio instructions a saving of about
189 mio instructions (all then analyzing the CFE and looking at output
from `valgrind --tool=callgrind`).

Benchmarking with `perf stat` with normal GC gives:

```
task-clock:u: -2.1760% +/- 1.6063% (-265608341.80 +/- 196062087.98) (12206056036.20 -> 11940447694.40)
page-faults:u: 0.2301% +/- 0.0313% (448.20 +/- 60.88) (194764.60 -> 195212.80)
cycles:u: -2.2906% +/- 1.6090% (-1180119481.60 +/- 828994273.75) (51521138476.00 -> 50341018994.40)
instructions:u: -0.3325% +/- 0.0032% (-196547942.60 +/- 1874215.18) (59120651337.60 -> 58924103395.00)
seconds time elapsed: -2.1715% +/- 1.6011% (-0.27 +/- 0.20) (12.21 -> 11.95)
seconds user: -2.2487% +/- 1.7816% (-0.27 +/- 0.21) (11.87 -> 11.60)

Comparing GC data:
'No' GC change.
```

Note that it must push the GC - the savings isn't really 2% in time.

And with GC disabled:

```
instructions:u: -0.4562% +/- 0.0029% (-185499444.00 +/- 1189012.77) (40663084597.80 -> 40477585153.80)
```

So here a saving of ~185 mio which fits okay with the data from
valgrind.

Change-Id: Ib203baeac6a93f5e37c737080fed342dbd0740a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487021
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-03-13 02:43:23 -07:00
Konstantin Shcheglov 2e6153cdb6 Start analyzer 11.1.0-dev, analyzer_plugin 0.14.6-dev, analyzer_testing 0.2.3-dev, analysis_server_plugin 0.3.12-dev
Change-Id: Iddeffba7499ea1b1bcd607bf72ad9766a997ae74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484501
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-02 10:53:00 -08:00
Konstantin Shcheglov e819fffbd1 Prepare to publish analyzer 11.0.0, _fe_analyzer_shared 97.0.0, analysis_server_plugin 0.3.11, analyzer_plugin 0.14.5, analyzer_testing 0.2.2
Change-Id: Ibfa9fa0db341a9335bf5983375e15212717b6b5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484220
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-27 10:52:00 -08:00
Konstantin Shcheglov 19895724dd Breaking changes for analyzer version 11.0.0
Change-Id: I75c4dca69a99c0129cc8ae6934d5925382228a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481542
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-24 14:36:29 -08:00
Sam Rawlins 7143390ba0 DAS plugins: add changelog note regarding excluded files
Fixed in https://dart-review.googlesource.com/c/sdk/+/482460

Change-Id: I57667f948cf9af40b88dc98f8983bff881487933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482960
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-02-23 11:02:35 -08:00
FMorschel e8df76286e [analysis_server_plugin] Skips files that are analyzer excluded.
Fixes: https://github.com/dart-lang/sdk/issues/62729
Change-Id: I4b60ad02b10009decfa091d8dce84a0e765a7b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482460
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-02-23 08:27:38 -08:00
Konstantin Shcheglov 5cbe70416f Start analyzer 10.3.0-dev, analyzer_plugin 0.14.5-dev, analyzer_testing 0.2.2-dev, analysis_server_plugin 0.3.11-dev
Change-Id: I5fecb1813aebf0be764f41f270ae26a0de4dcc17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482600
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-21 10:52:57 -08:00
Konstantin Shcheglov 777b6efcd9 Prepare to publish analyzer 10.2.0, _fe_analyzer_shared 96.0.0, analysis_server_plugin 0.3.10, analyzer_plugin 0.14.4, analyzer_testing 0.2.1
Change-Id: Id5f874b59e441c81910d979d9f50e4415674179d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482363
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-20 12:59:46 -08:00
Paul Berry c6a9c9536e [api_summary] Add class modifier support.
Adds the modifiers `abstract`, `base`, `final`, and `interface` to the
API summary output.

This information is an important part of the public API of a package,
because it determines whether a client can:

- Construct an instance of the class,
- Extend the class, or
- Implement the class.

Change-Id: I6a6a6964ba07db1714bc2fcb549cc15230e87058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-02-20 10:49:45 -08:00
Paul Berry 02ced6c1a5 [api_summary] Fix member sort order.
Fixes two minor bugs with the sorting of members in the API summary
tool:

- The technique for placing getters next to their corresponding
  setters was to sort them lexicographically based on
  `Element.apiName`, which in the case of setters appends `=`. This
  mostly worked, but due to the fact that `=` is between `9` and `A`
  in ASCII, it was wrong in a few corner cases. For example, it would
  sort `x`, `x=`, `x1`, and `x1=` in the order `x`, `x1`, `x1=`,
  `x=`. Fixing this didn't affect any `api.txt` files in practice.

- The technique for sorting constructors also used `Element.apiName`,
  which in the case of an unnamed constructor is `new`. This meant
  that if a class had both named and unnamed constructors, the unnamed
  constructor would not always be sorted before the other
  constructors.

The fix for both bugs is to sort by `Element.name` (which does not add
`=` for setters and is the empty string for unnamed constructors), and
then to break ties by explicitly checking whether the element is a
setter.

Change-Id: I6a6a69648fb5915266a9111c5d884531bba4405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-02-20 10:43:16 -08:00
Konstantin Shcheglov d3d0ec9f66 Start analyzer 10.2.0-dev, analyzer_plugin 0.14.4-dev, analyzer_testing 0.2.1-dev, analysis_server_plugin 0.3.10-dev
Change-Id: I99ed03bc272bf6c243438b41b69c78dbf5511427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481240
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-17 10:53:10 -08:00
Konstantin Shcheglov fc41bfcf92 Prepare to publish analyzer 10.1.0, _fe_analyzer_shared 95.0.0, analysis_server_plugin 0.3.9, analyzer_plugin 0.14.3, analyzer_testing 0.2.0
Change-Id: Ibe306aceaf6967a978fbf7e8bad07c3475e8ca10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481060
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-17 09:20:42 -08:00
FMorschel a750287f44 [analysis_server_plugin] Fixes non-LintCode fixes showing up for users
Fixes: https://github.com/dart-lang/sdk/issues/62658
Change-Id: I180934a9ead47ae25cf5ef9ea633f43a994ca3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480080
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-13 13:58:19 -08:00
Jonas Finnemann Jensen b62a14bf9a Remove unnecessary catch for YamlException.
`YamlEditor.update` should never throw `YamlException`, it should also
never throw `AssertionError`, but we know that it has bugs, and in those
cases it does throw `AssertionError`.

Change-Id: I941d88063effc8c46ba270da8531978a72e7a806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472562
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2026-02-10 03:02:14 -08:00
FMorschel e19b298536 [analysis_server_plugin] Fixes suggested ignore fixes
Fixes: https://github.com/dart-lang/sdk/issues/61715
Change-Id: Iafc3e2aa22d975addce67829ad18e2798299903c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2026-02-03 10:34:33 -08:00
Albert Moravec 7226a4ce87 [analysis_server] Allow analyzer plugins from hosted pub server
Added support for the `hosted` field in plugin definition,
so that analyzer plugins can be sourced from pub servers other
than pub.dev.

TEST=pkg/analysis_server/test/src/plugin2/generator_test.dart
TEST=pkg/analyzer/test/src/options/analysis_options_test.dart

Change-Id: Ie99693ab39c77b3d814843963613798f72e27f62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475580
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Albert Moravec <albert.moravec@gmail.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-02 14:32:37 -08:00
Konstantin Shcheglov 98c4f54c0f Start analyzer 10.1.0-dev, analyzer_plugin 0.14.3-dev, analyzer_testing 0.1.11-dev, analysis_server_plugin 0.3.9-dev
Change-Id: I2ec7613ce0abcfa6e55f8c7837860319d9503adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-02 11:54:49 -08:00
Konstantin Shcheglov 5273f91b95 CQ. Scan from strings and drop scanner reader shim.
Remove the analyzer-only `scanner/reader.dart` re-export and refactor
`Scanner` to accept source text directly.

* Delete `pkg/analyzer/src/dart/scanner/reader.dart`, which only re-exported
  `_fe_analyzer_shared` reader types.
* Replace the `Scanner(CharacterReader, ...)` factory with
  `Scanner(String contents, ...)`, aligning the API with the underlying
  `scanString` implementation.
* Update analyzer, analysis_server, analyzer_cli, analyzer_plugin, and scrape
  call sites to pass the source string directly instead of constructing
  `CharSequenceReader`.

This removes an unnecessary abstraction layer, reduces
imports/indirection, and makes scanner usage simpler and more uniform
across the repo.

Change-Id: I380b365676c8a62971a3700deadb695d1519d653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477600
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-02 11:20:31 -08:00
Sam Rawlins 4eabd1d870 DAS plugins: Use a proper glob string and canonicalize globs
Work towards https://github.com/dart-lang/sdk/issues/62341

Change-Id: I72d882607bfd4db0ad3b179d2b20549744bda0cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-31 14:55:50 -08:00
Sam Rawlins 94a701bb0a Bump analyzer to 10.0.2, analyzer_plugin to 0.14.2, analyzer_testing to 0.1.10, and analysis_server_plugin to 0.3.8
This release is so we can publish a version of analysis_server_plugin,
and then start depending on that published version in DAS.

In addition, we get a highly requested fix out to analyzer_testing
users.

Change-Id: I694f47aeee59367c1fc066bc8f7a865406b09917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476620
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-30 09:24:57 -08:00
FMorschel 03980b59ac [analysis_server_plugin] Fixes warning ignores by namespacing rules by plugins
Bug: https://github.com/dart-lang/sdk/issues/62173
Change-Id: I09b26b99fa928822f76246d8c6380a7c9a2b0a1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475080
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2026-01-28 12:22:28 -08:00
Paul Berry cf1d8b96db [messages] Make Scanner and Parser take a DiagnosticReporter.
Changes the signature of the following constructors:
- Scanner
- Scanner.fasta
- Parser

So that they accept a `DiagnosticReporter` object rather than a
`DiagnosticListener` object. This brings the scanner and the parser
into alignment with the majority of the rest of the analyzer (which
reports errors using `DiagnosticReporter` rather than by talking to
`DiagnosticListener` directly).

It also makes the `source` parameter of these constructors
unnecessary, because the `source` can be obtained from the
`DiagnosticReporter`.

Change-Id: I6a6a6964607ffb52a8332a6e618dc0c9a1e48c5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-16 13:34:50 -08:00
Sam Rawlins ca475a991d Release meta 1.18.0
analyzer package now depends on new TargetKind values in meta, so we
must bump the dependency to prevent crashes.

Change-Id: Ia639b0cd67c0dc70ae03613b6b1bfd4ad552788c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473421
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-15 11:41:02 -08:00