Commit Graph

4618 Commits

Author SHA1 Message Date
paulberry@google.com 1363c77a02 Change integration test send...() methods to return structured objects.
This allows us to use completions when analyzing responses from the
server in integration tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40909 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-04 17:37:47 +00:00
danrubel@google.com 9cc5893d3d filter undesired suggestions from prefix expression
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40908 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-04 04:32:37 +00:00
danrubel@google.com a46a5b166d suggest re-exported elements of imported libraries
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40907 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-04 03:14:28 +00:00
scheglov@google.com 11644f7288 Fix for the prefix/suffix diff computing.
We need to exclude a common part of a prefix/suffix.
Also, I decided not to improve diff calculation, at least in the short term.
So, I'm removing diff.dart and the TODO comment.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40903 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 17:31:55 +00:00
danrubel@google.com ef2982539d refactor library prefix suggestion generation
so the imported_computer is responsible for all suggestions
based upon import directives.

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40900 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 16:02:36 +00:00
danrubel@google.com a6ea07633d narrow imported element suggestions
This reduces the situations in which imported elements are suggested to
reduce/eliminate incorrect suggestions

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40886 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 16:57:55 +00:00
scheglov@google.com a863eecbfd Use simple prefix/suffix diff in members sorter.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40880 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 14:52:14 +00:00
scheglov@google.com 6596936e55 Fix for starting 'Rename LibraryElement' refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40866 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 03:00:32 +00:00
scheglov@google.com 099ce93ec3 Add 'Introduce new local with cast type' quick assist.
Unfortunately we still often need it in Dart, as we always need it in Java.

Type promotion does not work for "if (name is Type)" if "name" is a field,
an expression or "name" is modified _anywhere_ in the function.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40824 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 20:45:10 +00:00
scheglov@google.com 6a3f946ec4 Fix for 'Extract Local' refactoring - take into account local variable elements.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40823 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 20:16:40 +00:00
scheglov@google.com c0ff46e62f Make fields sorting stable.
Accidentally found a problem when one of the fields is moved, even though
all the fields should not. It seems to be he case because List.sort()
is not a stable sort. So, we now use offsets to compare field items.

R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40821 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 18:00:30 +00:00
scheglov@google.com 5e9ba07a3e Fix for NPE when FieldFormalParameterElement references an unresolved field.
I found it (in a hard way - server died) during dogfooding.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40820 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 17:59:16 +00:00
scheglov@google.com 85b466c9c6 Issue 19670. Extend the 'Create Field' Quick Fix to support getter context.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19670

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40812 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 15:18:37 +00:00
scheglov@google.com 29b292ee4c Issue 19670. 'Create field' quick fix.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19670

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40782 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 19:45:34 +00:00
scheglov@google.com a836f0f5ad Fix for highlighting 'abstract' in ClassTypeAlias.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40777 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 17:33:55 +00:00
scheglov@google.com 99156246f8 Include 'potentialEdits' into refactoring feedback.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40750 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-28 18:59:00 +00:00
scheglov@google.com 5d01fcbedf Implement 'edit.sortMembers' request.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40735 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 20:09:21 +00:00
scheglov@google.com 2d00d5e2c0 Specify when 'sortMembers' will return an error.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40719 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 17:12:15 +00:00
scheglov@google.com 133a7cc20c 'Sort unit/class members' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40718 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 17:10:25 +00:00
scheglov@google.com 3bacc7ae1e Use a separate request for 'Sort members' feature, not a refactoring.
As requested in https://codereview.chromium.org/609653002/

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40713 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 15:53:47 +00:00
scheglov@google.com bc768460d4 Integrate CONVERT_GETTER_TO_METHOD refactoring into server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40712 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 15:26:23 +00:00
scheglov@google.com f4aabfb6e1 Issue 21071. Generate posix-style relative URIs.
But parse using the target file system's Context.

R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21071

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40655 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 22:22:57 +00:00
paulberry@google.com 5b45f8e762 Move PubPackageMapProvider to its own file.
This will allow clients of the AnalysisServer package to provide their
own PackageMapProvider without bringing in a dependency on dart:io.

R=brianwilkerson@google.com, rpaquay@chromium.org

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40638 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 18:09:08 +00:00
paulberry@google.com 54e1435931 Propagate future returned by _updateElementReferences().
Otherwise the Future.forEach() may complete too soon, causing the
refactoring to be returned to the client before all of the necessary
changes have been accumulated.

BUG=dartbug.com/21071
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40637 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 17:52:43 +00:00
brianwilkerson@google.com 1f4682b962 Rework launch data
R=jwren@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40610 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 22:02:03 +00:00
scheglov@google.com 077de1fb02 'Convert Getter to Method' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40574 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 21:55:15 +00:00
scheglov@google.com 855f8364d2 Issue 20910. Add SORT_MEMBERS refactoring to the server specification.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20910

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40573 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 21:54:03 +00:00
scheglov@google.com 45d53b7df8 Replace AnalysisServerListener with Stream.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40557 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 18:35:30 +00:00
scheglov@google.com 571a630d38 Move SourceReference, extract duplicate code.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40550 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 17:06:44 +00:00
scheglov@google.com c56440ec34 Integrate CONVERT_METHOD_TO_GETTER into the server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40549 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 17:04:50 +00:00
scheglov@google.com fac2a62392 Reset refactoring manager on any analysis.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40542 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 14:56:26 +00:00
scheglov@google.com bb4bd6d889 'Convert Method to Getter' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40541 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 14:53:19 +00:00
scheglov@google.com 66c1b3aacc Issue 18296. Harden the name checks.
Don't allow to use invalid names in refactorings.

R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18296

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40521 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 20:53:05 +00:00
scheglov@google.com 00c0b8e164 Use MOVE_FILE refactoring to implement file rename participant in Editor.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40520 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 20:35:07 +00:00
scheglov@google.com eb0fde9cf3 Try to restore 'package:' URI reference to the file being moved.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40519 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 20:28:18 +00:00
scheglov@google.com 604a9e760d Integration of MOVE_FILE into the server and a couple of fixes.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40510 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 18:10:56 +00:00
scheglov@google.com cb8c9c654d Move file refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40500 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 16:23:14 +00:00
scheglov@google.com eeb6c26d21 API proposal for the MOVE_FILE refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40499 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 16:20:29 +00:00
scheglov@google.com df85f37a29 Issue 13783. Add file from missing import.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=13783

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40482 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 00:19:54 +00:00
scheglov@google.com ac5e10b501 Push add*Edit helpers into SourceChange.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40464 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 21:20:37 +00:00
scheglov@google.com 3e884db043 Index and search of import prefixes.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40397 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 20:19:39 +00:00
scheglov@google.com 40be584340 Remove unused code.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40395 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 20:09:43 +00:00
danrubel@google.com 70d983e570 add element to completion suggestions
suggest getter rather than field element
add test for function suggestions

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40366 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 03:50:46 +00:00
danrubel@google.com 6a91be4ddf convert engine element setter to completion element setter
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40362 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 23:21:57 +00:00
danrubel@google.com 6cc9d7d887 add element to completion suggestion API
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40360 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 23:17:24 +00:00
scheglov@google.com 7fde5deecc Send final problems even if 'validateOnly'.
Also fix for reporting duplicate 'Rename Local' shadowing warnings.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40332 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:48:19 +00:00
scheglov@google.com 457050dd88 Add SourceFileEdit.time field.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40329 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:19:37 +00:00
scheglov@google.com 620f7cf957 Rollback https://codereview.chromium.org/575613002
I'm sorry, but I'm going to rollback this change.
We discussed this offline with Brian and decided that while it looks
technically correct, it does not work well for our use cases, as well as
probably for our users.

R=paulberry@google.com, brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19697

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40324 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 16:31:52 +00:00
scheglov@google.com 2208ce5587 Split refactoring problems into init, options and final.
R=brianwilkerson@google.com, jwren@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40318 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 15:14:51 +00:00
scheglov@google.com 8ed8098a48 Issue 17389. Analyzer snapshot and server tweaks to use new ParameterElement.defaultValueCode.
This also makes Analysis Server to return hovers with parameter default values.

R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=17389

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40298 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 01:46:27 +00:00