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
Brian Wilkerson
37042bb59b
Add an integration test for kythe support with bug fixes
...
R=jwren@google.com
Review-Url: https://codereview.chromium.org/3006693002 .
2017-08-28 10:07:04 -07:00
Brian Wilkerson
608bf972b0
Add folding support for plugins and update the main tutorial page
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3004733002 .
2017-08-28 08:05:37 -07:00
Brian Wilkerson
d1a2a43d54
Add plugin support for occurrences (and fix typo)
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3006703002 .
2017-08-28 08:04:42 -07:00
Brian Wilkerson
dd00fc7750
Add support for highlights notification
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3004613002 .
2017-08-25 09:21:36 -07:00
Brian Wilkerson
efd4051c7e
Add utilities to support the outline notification
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3002233002 .
2017-08-24 11:59:06 -07:00
Brian Wilkerson
c6b206a2d9
Clean up after some recent code changes
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3009513002 .
2017-08-24 10:01:11 -07:00
Brian Wilkerson
e8010e4a44
Enhance NavigationMixin to handle notifications
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3008443002 .
2017-08-24 07:44:51 -07:00
Brian Wilkerson
0a50effce5
Add minimal support for sending notifications
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/3003573002 .
2017-08-23 13:26:59 -07:00
Brian Wilkerson
6f81034a73
Initial Kythe support for plugins
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2997833002 .
2017-08-14 08:24:15 -07:00
Paul Berry
e2f77056a5
Eliminate dependencies on pkg/front_end.
...
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).
This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end. It also updates
pkg/analyzer_plugin to make use of those re-exports.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00
Brian Wilkerson
8bbf373a5e
Remove the analysus.reanalyze request from the plugin API
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2988743002 .
2017-07-25 12:10:52 -07:00
Brian Wilkerson
75504c2b25
Remove references to AnalysisDriver from the plugin mixin classes
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2970203002 .
2017-07-06 09:07:10 -07:00