Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 10834222: Initial implementation of 'Create Method' quick fix (Closed)

Created:
8 years, 4 months ago by scheglov
Modified:
8 years, 4 months ago
Reviewers:
messick
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Initial implementation of 'Create Method' quick fix - only top-level functions are supported; - argument suggestions are not bound to the linked nodes, just first suggestion is used. 2. Tweak for resolved AST access R=messick@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=10468

Patch Set 1 #

Total comments: 4

Patch Set 2 : Use resolveUnit() in ASTProvider #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1022 lines, -17 lines) Patch
M compiler/java/com/google/dart/compiler/ast/DartExpression.java View 1 chunk +16 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 3 chunks +3 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/META-INF/MANIFEST.MF View 1 chunk +1 line, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/codemanipulation/StubUtility.java View 1 chunk +186 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/fix/LinkedProposalPositionGroup.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java View 1 2 chunks +1 line, -7 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/CorrectionMessages.java View 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/CorrectionMessages.properties View 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/QuickFixProcessor.java View 1 12 chunks +201 lines, -7 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/proposals/LinkedCorrectionProposal.java View 1 chunk +79 lines, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/proposals/SourceBuilder.java View 1 chunk +83 lines, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/proposals/TrackedPositions.java View 1 chunk +52 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/ASTProvider.java View 1 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/DartUiTest.java View 1 2 chunks +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/QuickFixProcessorTest.java View 2 chunks +106 lines, -0 lines 0 comments Download
A editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/StubUtilityTest.java View 1 chunk +286 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/correction/TestAll.java View 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/AbstractDartTest.java View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
scheglov
8 years, 4 months ago (2012-08-08 06:01:57 UTC) #1
messick
https://chromiumcodereview.appspot.com/10834222/diff/1/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java File editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java (right): https://chromiumcodereview.appspot.com/10834222/diff/1/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java#newcode94 editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java:94: // we don't want to spend too much time ...
8 years, 4 months ago (2012-08-08 14:34:36 UTC) #2
scheglov
8 years, 4 months ago (2012-08-08 15:41:05 UTC) #3
https://chromiumcodereview.appspot.com/10834222/diff/1/editor/tools/plugins/c...
File
editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java
(right):

https://chromiumcodereview.appspot.com/10834222/diff/1/editor/tools/plugins/c...
editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java:94:
// we don't want to spend too much time on resolving here.
On 2012/08/08 14:34:37, messick wrote:
> I'm a little confused by this comment. Refactoring runs at user-interaction
> speeds. Why can't we ensure we have a resolved AST? The alternative is
> unreproducible bug reports, or inconsistent behavior.

Well, clients should be prepared, that AST is not resolved, not all nodes have
elements, etc.
This just may happen by other reasons.
And the worst what will happen - you will not see some Quick Assist or Quick
Fix.

But we can try to do better.
I've changed ASTProvider to provide actually resolved AST.

https://chromiumcodereview.appspot.com/10834222/diff/1/editor/tools/plugins/c...
editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/correction/AssistContext.java:99:
//        // see bug 63554
On 2012/08/08 14:34:37, messick wrote:
> We don't have bug 63554 (yet)

Done.

Powered by Google App Engine
This is Rietveld 408576698