Commit Graph

81 Commits

Author SHA1 Message Date
Konstantin Shcheglov 1d323687b3 Use selection to decide whether EXTRACT_LOCAL_VARIABLE and EXTRACT_METHOD are available.
R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/959
Change-Id: I64af87f26bbc26527011c34194a064a01e2d263e
Reviewed-on: https://dart-review.googlesource.com/57060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-29 20:33:06 +00:00
Konstantin Shcheglov 71ca507d3d Fix for 'Extract Widget' refactoring test on Windows.
R=brianwilkerson@google.com

Change-Id: Ibcc2e7a1d080c46168675d62ac9f0462e7d2cad0
Reviewed-on: https://dart-review.googlesource.com/51540
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-17 18:17:21 +00:00
Konstantin Shcheglov afbaf0c4a6 Add 'Extract Widget' to getAvailableRefactorings().
R=brianwilkerson@google.com

Change-Id: Ieb6faa63de75d64edd317bf8b5276f775c634e3c
Reviewed-on: https://dart-review.googlesource.com/51361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-16 20:13:08 +00:00
Konstantin Shcheglov 44dbba2b80 Use offset/length of the import prefix, or empty. Same for constructor names.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32685
Change-Id: I40b7f9c679b04725db19dad661e3a88a4a982f1c
Reviewed-on: https://dart-review.googlesource.com/48682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-28 18:19:09 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

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

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +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
Brian Wilkerson 1d8a5d77c1 Convert more tests to use ResourceProviderMixin
Change-Id: Ia4cce51e33c79c82a989bfda9b8303dfaa72e103
Reviewed-on: https://dart-review.googlesource.com/31880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 00:47:34 +00:00
Konstantin Shcheglov 223a78d7bf Listen for watch events and notify AnalysisServer.
So, AnalysisServer can serve a broadcast Stream and let EditDomain
reset a pending refactoring.

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

Bug: https://github.com/flutter/flutter-intellij/issues/1465
Change-Id: I9462ad623ef261a658655a7445ee0ad9b0029a18
Reviewed-on: https://dart-review.googlesource.com/18426
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-03 15:59:45 +00:00
Devon Carew e6a34d78f1 Improve the extract method refactoring for flutter build() methods.
Bug:
Change-Id: Ic957eede0989b9cd171212425d5da0aad83bc941
Reviewed-on: https://dart-review.googlesource.com/11740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-08 01:41:41 +00:00
Brian Wilkerson b941f148a7 Remove uses of the old plugin model from the analysis server
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3001413002 .
2017-08-23 07:42:13 -07: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
Konstantin Shcheglov 911263f240 Remove the old index.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2963773003 .
2017-06-28 13:44:05 -07:00
Brian Wilkerson a0d7d64f0b Convert more tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936123002 .
2017-06-13 19:38:59 -07:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson 27f9e5e4ce Reverse the sense of the flag to make it easier to find test that need to be converted
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884593003 .
2017-05-15 08:40:40 -07:00
Brian Wilkerson 2a4772a537 Remove unnecessary tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2868233003 .
2017-05-10 09:15:36 -07:00
Brian Wilkerson e6c8092cea Enable analysis driver in tests where possible
R=danrubel@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2868353002 .
2017-05-10 09:13:25 -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
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
Konstantin Shcheglov 90c7698f1b 'Extract Local' and 'Inline Local' refactoring need only single file analysis.
We still analyze more than we actually need - we don't need the full
RESOLVED_UNIT, we could live with some much lower RESOLVED_UNITx. But it
might be fast enough for practical purposes to compute fully resolved
units.

Maybe we should set up monitoring for refactoring times...

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2262393003 .
2016-08-22 18:59:55 -07:00
Konstantin Shcheglov 0522cad42a Convert to async/await parts that cause strong mode warnings.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2233633003 .
2016-08-10 10:28:34 -07:00
Brian Wilkerson 0d743fbacf Start making server strong mode clean
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1842063003 .
2016-03-31 08:27:05 -07:00
Konstantin Shcheglov bd76934452 Remove old index and search implementations.
Also rename the new implementation files and classes to remove the
'2' suffix.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1801883002 .
2016-03-14 12:19:40 -07:00
Konstantin Shcheglov f49612ba51 Covering expression offsets/lengths integration.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1411973006 .
2015-11-03 10:45:17 -08:00
Konstantin Shcheglov 069ba985de Fix protocol for EXTRACT_LOCAL_VARIABLE and coveringExpressionOffsets/lengths.
Unfortunately we have to make coveringExpressionOffsets and coveringExpressionLengths optional.
Otherwise new clients cannot correctly parse responses from old servers.

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

Review URL: https://codereview.chromium.org/1407333006 .
2015-11-03 10:19:41 -08: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
Konstantin Shcheglov 6c029f9cb1 Issue 24440. Fix for renaming libraries using 'part of' directives.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24440

Review URL: https://codereview.chromium.org//1364853007 .
2015-09-25 14:24:05 -07:00
Konstantin Shcheglov c48cc7b913 Check for reset during 'await' in refactoring manager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1281983002 .
2015-08-10 11:19:03 -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
Brian Wilkerson ad52c9eab9 Add support for specifying files needing analysis
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1152013002
2015-05-21 14:34:04 -07:00
brianwilkerson@google.com ac3613e2bb Re-apply change to move to plugin package
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45408 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 18:54:24 +00:00
brianwilkerson@google.com 3d536efcfe Revert breaking change
Review URL: https://codereview.chromium.org//1101213002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45384 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 22:12:20 +00:00
brianwilkerson@google.com 24c853446a Convert analyzer and analysis_server to use the plugin package
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45382 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 20:32:35 +00: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
paulberry@google.com cd1dd1864b Fix additional cases where analysis server might send null, violating protocol.
In addition, modify the code generation so that these protocol
violations will be caught by assertions during unit tests.
Previously, they would only be caught at runtime by client code.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45211 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 15:41:39 +00:00
brianwilkerson@google.com 46064e8f2f Create a public API for contributing fixes and make fixes pluggable
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45079 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 21:01:10 +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 acec842aee Add 'Convert Method to Getter' proposal only if it is an available refactoring.
So, that we don't show it for method with parameter or returning null.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43936 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 23:18:21 +00:00
scheglov@google.com 55a3255070 Return RequestErrorCode.NO_INDEX_GENERATED for search/refactoring requests.
Also remove passing a SearchEngine instance into Quick assists/fixes - they don't use it.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43819 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 20:01:45 +00:00
scheglov@google.com 865b217511 Issue 22381. Fix for navigating to constructor from redirecting factory constructor.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=22381

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43731 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 17:58:29 +00:00
scheglov@google.com c93b24904d Issue 22157. Cancel a pending refactoring request on receiving a new one.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=22157

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43201 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:24:19 +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 f6d7bd629f Improve tests for refactoring exceptions. Catch initial exceptions.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42574 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-30 18:50:57 +00:00
scheglov@google.com 11bdb14559 Catch exceptions in refactorings and return them as a SERVER_ERROR.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21907

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42526 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 21:51:02 +00:00
scheglov@google.com 1c082a63ab Don't send a refactoring feedback in case of a fatal initial problem.
R=brianwilkerson@google.com, danrubel@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42350 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 22:55:52 +00:00
scheglov@google.com 0cd030eeb8 Issue 21613. Fix for renaming FieldFormalParameterElement.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21613

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41929 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-24 16:00:28 +00:00
scheglov@google.com affc91a881 Issue 21552. Fixes for navigation, hover and rename in instance creation expressions.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21552

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41651 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 03:01:21 +00:00
scheglov@google.com 772a0c6b22 Fix 'Unused local variable' hints in analyzer and analysis_server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41576 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 18:32:54 +00:00
scheglov@google.com 68831585dd Fix for renaming import without an import prefix.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41021 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 16:25:07 +00:00