Commit Graph

1474 Commits

Author SHA1 Message Date
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 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 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 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
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 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 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 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 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
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
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 e823d01b65 Issue 19697. Partial fix - don't search for subclasss members.
I think it still worth to commit this CL, if nothing else,
it makes search a little faster by not searching for subclasses.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40290 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 23:34:15 +00:00
scheglov@google.com 3d6fff5735 Issue 18926. Rename refactoring for labels.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18926

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40259 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 17:48:09 +00:00
scheglov@google.com caf4b0476e Issue 18895. Convert an expression function body into the block function body when Extract Local.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18895

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40250 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 15:28:31 +00:00
scheglov@google.com 3e3178ee6c Support for searching LabelElements in SearchEngine.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40245 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 15:03:01 +00:00
scheglov@google.com 7eae998b90 Issue 13029. Quick fix to create a function for a Function typed named parameter.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=13029

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40242 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 14:53:06 +00:00
scheglov@google.com 3f1f6f9e41 Issue 20892. Quick Fix 'Import Library' for type arguments.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20892

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40241 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 14:50:38 +00:00
scheglov@google.com 210a4459b2 Issue 20358. Don't report referenced names of named parameters in named expressions as possible shadowing.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20358

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40240 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 14:48:36 +00:00
danrubel@google.com a5ecdaffcc fix code completion import dart exception
BUG=dartbug.com/20893
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40238 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 12:41:41 +00:00
scheglov@google.com 59eac1e533 Issue 19800. Support for inlining getters/setters.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19800

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40230 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-14 03:17:55 +00:00
scheglov@google.com 4a59e13a84 Issue 19799. Merge getter/setter pairs into fields when create missing overrides.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19799

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40220 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 21:29:09 +00:00
scheglov@google.com 8269bc67c3 Issue 19801. Fix for inlining referenced function with an expression body.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19801

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40214 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 19:41:59 +00:00
scheglov@google.com 778536d97c Issue 19682. New analyzer snapshot that fixes an inline refactoring problem.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19682

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40193 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 22:47:29 +00:00
scheglov@google.com 3120d3632f Issue 17024. Quick Fix to find imported library.
It works with both project and package libraries.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40173 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 18:36:04 +00:00
scheglov@google.com 14e375418b Issue 10355. Quick Fix to replace 'var' with 'dynamic'.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=10355

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40172 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 18:26:58 +00:00
scheglov@google.com 88c1df9734 Issue 20891. Produce Quick Fixes for annotations.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20891

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40167 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 17:36:42 +00:00
scheglov@google.com 7ac6ed2b6f Issue 20890. Fix for NPE in the 'Add show' QA.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20890

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40115 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 20:49:42 +00:00
danrubel@google.com 016dc1132b add code completion declared and return types
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40087 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 13:04:11 +00:00
scheglov@google.com 65f95d89f4 Fix for List<Future> is not assignable to List.
Instead of pushing core.dart file, we should pre-index SDK.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40038 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 16:24:22 +00:00
paulberry@google.com ea7f519f03 Make SdkLibrary.shortName consistently include 'dart:'
The documentation of SdkLibrary.shortName claimed that it didn't
include the 'dart:' prefix; however the implementation did include it.
The implementation of shortName in _MockSdkLibrary class (used only
for unit testing) did not include the 'dart:' prefix, causing some
unit tests to pass even though the functionality was wrong.

This change updates the docs and _MockSdkLibrary to correspond to the
implementation (the 'dart:' prefix is included).  Additionally it
fixes one usage of shortName which was expecting the 'dart:' prefix to
be absent; this was preventing quick fixes from working correctly.

In addition, the Mock SDK is modified to add a reference from
dart:core to dart:async and from dart:async to dart:math (these
dependencies exist in the real SDK).  This avoids the need for some
workarounds in unit tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40000 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 21:02:30 +00:00
scheglov@google.com 19f017660a Return a feedback for the INLINE_METHOD refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39993 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 19:56:26 +00:00
danrubel@google.com 611e8ca216 rename completion class
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39987 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 18:38:36 +00:00
scheglov@google.com c0c0b51188 Send feedback for the INLINE_LOCAL_VARIABLE refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39981 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 17:33:09 +00:00
danrubel@google.com 8aeace76ec improve keyword suggestions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39978 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 16:32:50 +00:00
scheglov@google.com 897ba068ee Fix for no-op assist proposals.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39931 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 21:09:01 +00:00
scheglov@google.com 3661df5b0e Include additional information into RenameFeedback.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39918 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 16:39:15 +00:00
paulberry@google.com 245168938e Merge analysis server's mocks.dart and mocks2.dart into one file.
There were competing implementations of MockAnalysisContext and
MockSource, but one of the implementations was only used in one place
(analysis_server_test.dart), so it's been switched over to use the
other implementation.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39826 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 19:45:42 +00:00
scheglov@google.com 43b0e2d584 Use unit + offset as 'Inline Local' arguments.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39821 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:45:18 +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
scheglov@google.com 47fe46e1a6 Integrate EXTRACT_METHOD refactoring into the server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39808 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 14:54:16 +00:00
danrubel@google.com efb4c758f8 improve keyword suggestions when completing partial keyword
BUG=
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39780 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 21:54:56 +00:00
scheglov@google.com 4213f465fe Fix for 'returnType' when extract a method with a single expression.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39778 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 21:51:21 +00:00
scheglov@google.com 43e1872038 Impements 'names', 'offsets' and 'lengths' for ExtractMethodRefactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39768 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 19:35:48 +00:00