Commit Graph

14 Commits

Author SHA1 Message Date
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Konstantin Shcheglov ded707e265 Update latestSdkLanguageVersion to '2.12'.
Change-Id: I4b06f02dfecf9e10bca7fb0b285527c80d76166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-12-07 18:40:54 +00:00
Sam Rawlins 9e6486fe3f Analyzer: Make test fields late, late final, or hinted for migration.
Many fields can be late or late final, so adding hints for the migration tool.

In SnippetTester, the fields are all set in the constructor. Added a factory
constructor so the fields can be final. Renamed them to be private.

Change-Id: I559e7ba92c7c6749038630b03f67f8a77bdc704a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170406
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 17:45:17 +00:00
Konstantin Shcheglov 2b7fc8f134 Update FeatureSet to the new rules.
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I6c7d7dc56fd0d4edcc3c6f6cc6fb0422316b8f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-19 18:27:37 +00:00
Mike Fairhurst 3095a082cd [analyzer] Add an API to get a language comment token off a unit.
Change-Id: I377fdc44d5e514d6d9a601b3947c3908e5a4497a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140768
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-03-26 03:47:57 +00:00
Konstantin Shcheglov 5940821f4e Issue 37487. Add CompilationUnit.languageVersion override.
Initial:  https://dart-review.googlesource.com/c/sdk/+/136802
Reverted: https://dart-review.googlesource.com/c/sdk/+/136851

Bug: https://github.com/dart-lang/sdk/issues/37487
Change-Id: Ida3bf049840e7bda32ecdd54309ea0b141aa6800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137201
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-26 18:08:07 +00:00
Paul Berry b0b06bff31 Revert "Issue 37487. Add CompilationUnit.languageVersion override."
Reason for revert: it was a breaking change to the analyzer public API.

There were two breakages:

- A @required `languageVersion` parameter was added to
  AstFactory.compilationUnit, which is part of the officially
  supported analyzer public API.

- A @required `languageVersion` parameter was added to the Parser
  constructor, which is not part of the officially supported analyzer
  public API, but is part of its de facto public API due to the fact
  that it is used by dart_style.

This reverts commit ce26dfda7d.

Change-Id: I507103ea6f6ffabf915d6f56e9f24454725c3930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136851
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-02-25 04:39:10 +00:00
Konstantin Shcheglov ce26dfda7d Issue 37487. Add CompilationUnit.languageVersion override.
Bug: https://github.com/dart-lang/sdk/issues/37487
Change-Id: I57fbcdd6771d9004ba1fc43902c19514dab2a23d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-21 20:19:43 +00:00
Sam Rawlins 5dfa750393 Convert all function parameters and typedefs to generic syntax
Change-Id: I18f8644ecbe61555b2929ed09d446733d33ec2a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128521
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-12-16 23:36:38 +00:00
Paul Berry de013a4b51 Add an optional path parameter to parseString.
This is needed because some clients rely on the path showing up in
error messages.

Change-Id: I3746db3fc9eecef048b4e50c37b6a0b60a13dc7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110340
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-30 21:34:56 +00:00
Paul Berry a2e1434603 Breaking changes for analyzer version 0.37
Change-Id: I65a16ab2d2ca05de701c27f08300de85a6316b41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99880
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-02 03:59:49 +00:00
Paul Berry 53a905cde1 Introduce function parseFile2.
This is similar to the existing `parseFile` function, but it is more
efficient, and it supports the same parameters `featureSet` and
`throwIfDiagnostics` as `parseString`.

Change-Id: I4b9ecc36a137cc1c99e671e379f00afa3942c9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105542
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-21 16:08:07 +00:00
Paul Berry 9a2eecf67f Fix parseString: ensure that CompilationUnit.lineInfo is set properly.
Change-Id: Id81338c1021f9548f2c3f24931baf1e45ac1b18b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106320
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-17 16:10:29 +00:00
Paul Berry 686df33d99 Add parseString() to replace the deprecated parseCompilationUnit().
Change-Id: Ib272f6a281b09a02ba037049e76bf08dd78dbbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105540
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 12:56:57 +00:00