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

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/convert_method_to_getter.dart

Issue 1159563004: Rename Element.node (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library services.src.refactoring.convert_method_to_getter; 5 library services.src.refactoring.convert_method_to_getter;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element; 9 import 'package:analysis_server/src/protocol_server.dart' hide Element;
10 import 'package:analysis_server/src/services/correction/source_range.dart'; 10 import 'package:analysis_server/src/services/correction/source_range.dart';
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return change; 86 return change;
87 } 87 }
88 88
89 @override 89 @override
90 bool requiresPreview() => false; 90 bool requiresPreview() => false;
91 91
92 void _updateElementDeclaration(Element element) { 92 void _updateElementDeclaration(Element element) {
93 // prepare parameters 93 // prepare parameters
94 FormalParameterList parameters; 94 FormalParameterList parameters;
95 { 95 {
96 AstNode node = element.node; 96 AstNode node = element.computeNode();
97 if (node is MethodDeclaration) { 97 if (node is MethodDeclaration) {
98 parameters = node.parameters; 98 parameters = node.parameters;
99 } 99 }
100 if (node is FunctionDeclaration) { 100 if (node is FunctionDeclaration) {
101 parameters = node.functionExpression.parameters; 101 parameters = node.functionExpression.parameters;
102 } 102 }
103 } 103 }
104 // insert "get " 104 // insert "get "
105 { 105 {
106 SourceEdit edit = new SourceEdit(element.nameOffset, 0, 'get '); 106 SourceEdit edit = new SourceEdit(element.nameOffset, 0, 'get ');
(...skipping 22 matching lines...) Expand all
129 } 129 }
130 // we need invocation 130 // we need invocation
131 if (invocation != null) { 131 if (invocation != null) {
132 SourceRange range = rangeEndEnd(refRange, invocation); 132 SourceRange range = rangeEndEnd(refRange, invocation);
133 SourceEdit edit = newSourceEdit_range(range, ''); 133 SourceEdit edit = newSourceEdit_range(range, '');
134 doSourceChange_addElementEdit(change, refElement, edit); 134 doSourceChange_addElementEdit(change, refElement, edit);
135 } 135 }
136 } 136 }
137 } 137 }
138 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698