Commit Graph

37 Commits

Author SHA1 Message Date
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Konstantin Shcheglov 7f3f3e66ac Skip BazelChangesTest on Windows.
Change-Id: I88259cf2d101c80b35b16bec5cdefd3dc85a5356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 21:24:01 +00:00
Michal Terepeta 6172458220 Trigger checks for generated files also on failed builds
Bug: http://b/183199080
Change-Id: If8a9baed10068f70d24a8831a093e4a4bf240303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192383
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-03-22 18:14:54 +00:00
Michal Terepeta 9933192f36 Move watching generated Bazel files to an isolate
This does a few optimizations to improve the performance of the analyzer
when watching for generated files:

- We do all the polling in a separate isolate.

- We detect when Bazel finished running and only poll afterwards.

- We use a batch interface and deliver all changes at once (instead of
  one by one). This allows us to avoid resetting caches more often than
  necessary.

I had to remove one of the larger tests and created an integration test
instead, since the code for detecting the Bazel builds relies on
`dart:io` directly (`ResourceProvider` does not expose a way to
check for symlink targets).

Since this required a bit more code, I've decided to create a separate
file for it (`bazel_watcher.dart`).

Change-Id: I6c2383e7fd4348ab8af1af639b10db519c7a2f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183010
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 17:50:58 +00:00
Konstantin Shcheglov 2513d37525 Fix reported void_checks diagnostics.
Change-Id: I49b27cf3aab3606fb5b024cba3ed4b95e9ebe0f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 23:50:37 +00:00
Mike Fairhurst 1134a0f17c [analysis_server] Remove unused dart:async imports
Change-Id: I764ee78cb9e31bdb3abaa36ca4754e1fed180311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161447
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:29:52 +00:00
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson 26fec2ef66 Add return types to methods in analysis_server
Change-Id: I6149cd21df4df44aee0374db32e47e849aa9a960
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134047
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 00:26:49 +00:00
Brian Wilkerson 5584c96fde Enable prefer_single_quotes in analysis_server
All of the changes except in the analysis options file are from dartfix.

Change-Id: Icd9bf02ad07f71d1fc365979c7dfe18a792dc595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132624
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-21 17:52:52 +00:00
Brian Wilkerson 4043a6fce3 Remove unnecessary uses of new in analysis_server
Other than analysis_options.yaml, all of the changes were from running
dartfix.

Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 19:01:51 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Devon Carew f381778867 Update the status of analysis server tests.
Change-Id: I12c2366209ae712e064888714dd65ce8ec9d89f7
Reviewed-on: https://dart-review.googlesource.com/62003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-06-23 18:42:31 +00:00
Paul Berry 591cf85c76 Re-enable the old analyzer/FE integration logic.
This gets the tests running again.  I'll follow this up with CLs that
reshape the ResolutionStorer API to match the Factory API we're
building, and then after that we can transition the code over to
calling the Factory API directly.

Fixes #33504
Fixes #32258

Change-Id: I105841ed5b2ed1198ec5e3e7387f694c61d36ca7
Reviewed-on: https://dart-review.googlesource.com/61101
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-06-20 14:35:31 +00:00
Kevin Millikin be30b62e3d Remove the Kernel type inference listener
We have decided to move to a different API for Fasta/Analyzer
integration, one that doesn't involve compiling to Kernel or observing
type inference.  The listener API will become broken, so let's just
remove it before that happens.

We lose the ability to trace type inference so let's restore that
ability next.  The analyzer's resolution storer is not used, but that
code has been left.  The resolution applier will no longer work
without the resolution storer, so those tests have been disabled.

Change-Id: If9ac5aba2d5de7788d8a65f7fa8410599e636d21
Reviewed-on: https://dart-review.googlesource.com/42400
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 16:28:07 +00:00
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Paul Berry 105b170ddb Roll package test to 0.12.29+1 and stack_trace to 1.9.0
This required some changes to analysis_server, since analysis_server
used to have its own version of pumpEventQueue().  Since
pumpEventQueue() is now provided by the test package, I've removed
analysis_server's version, and I've updated some of the call sites to
pass in "times: 5000" to replicate the old analysis_server behavior.

This also required some changes to analyzer, since the fail() method
is now marked as @alwaysThrows, so no code may follow it without
producing a dead code hint.

Change-Id: Ie5ef3a5cc685c18da02de699e59f63f3bb8865f7
Reviewed-on: https://dart-review.googlesource.com/32683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-07 14:22:23 +00:00
Devon Carew 9b1394a7e6 Migrate more analysis server integration tests to --preview-dart-2.
Bug:
Change-Id: I3374f6a69a1abb18350c1127ce943c6a8f7e6546
Reviewed-on: https://dart-review.googlesource.com/27400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-07 21:16:29 +00:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Brian Wilkerson 7d26ff6d4f Remove some more library directives
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884233004 .
2017-05-17 08:02:08 -07:00
Brian Wilkerson e55812a3f2 Unify the server and plugin versions of the generators
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Devon Carew d02519aec4 Make the analysis server integration tests driver only.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2820893002 .
2017-04-17 11:23:38 -07:00
Brian Wilkerson a2713a8be5 Disable a test that times out on the bots
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2568183002 .
2016-12-12 08:51:11 -08:00
Brian Wilkerson 7f36a0d403 Get all integration tests running with the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2564863003 .
2016-12-09 16:12:52 -08:00
Konstantin Shcheglov 05a86a7495 Remove 'initializeTestEnvironment' from 'analysis_server'.
Also fixes the server_options_test.dart:22 test broken in https://codereview.chromium.org/2394683006/

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2402483002 .
2016-10-06 10:26:17 -07:00
Konstantin Shcheglov de4d8b3a78 Switch analysis_server to use 'package:test'.
I'm changing DEPS in the corresponding analyzer CL.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2394683006 .
2016-10-06 08:47:15 -07:00
Brian Wilkerson 9ad256cf18 Move the wire protocol support into the public API
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1398293002 .
2015-10-11 07:34:28 -07:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
scheglov@google.com 9efb25fa50 Use package:test_reflective_loader instead of reflective_tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1101003002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45365 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 20:54:29 +00:00
brianwilkerson@google.com cd58e290c4 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//969113002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44151 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 22:43:12 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//849863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00
scheglov@google.com b8da9bc651 Format and sort analyzer and analysis_server packages.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//725143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41792 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 22:23:53 +00:00
paulberry@google.com b4af87636b Change integration test notifications to use structured objects.
This allows us to use completions when writing code to handle server
notifications in integration tests.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//631553002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40916 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 01:04:51 +00:00
paulberry@google.com a5e47c8eb2 Change integration test send...() methods to use structured objects.
This is less error prone than using raw JSON, and requires less effort
when writing integration tests.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//621383002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40904 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 18:52:47 +00:00
paulberry@google.com 8d8ee25cff Merge analysis_testing package into analysis_server.
Note that analysis_server already contains a file test/mocks.dart, so
the mocks.dart file from analysis_testing has been imported as
test/mocks2.dart.  I will merge these two into a single file in a
future CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//533243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39814 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:11:42 +00:00
paulberry@google.com f556420f97 Rename some bools in the analysis server API.
R=brianwilkerson@google.com, jwren@google.com

Review URL: https://codereview.chromium.org//508203002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39604 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 16:39:49 +00:00
paulberry@google.com 19a44a67a6 Split up server_domain_int_test.dart; regularize integration test directories.
With this change, there is a separate subfolder in "test/integration"
for each domain, and each subfolder has its own "test_all.dart".

This change is almost entirely code motion.  The only material change
is that two tests have been dropped:

- test_connected(): this test is now unnecessary since every time the
  "server.connected" message is received, the generated code in
  integration_test_methods.dart verifies that it is well-formed.

- test_error(): this was a placeholder to remind us to test the
  "server.error" notification.  On further reflection, it's unlikely
  that we'll be able to integration test this notification, since it
  only occurs in the event of a server bug.

R=jwren@google.com

Review URL: https://codereview.chromium.org//458453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39112 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 22:25:26 +00:00