| OLD | NEW |
| 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.inline_method; | 5 library services.src.refactoring.inline_method; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' hide Element; | 9 import 'package:analysis_server/src/protocol.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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 SourceRange nodeRange = rangeNode(node); | 756 SourceRange nodeRange = rangeNode(node); |
| 757 if (bodyRange.covers(nodeRange)) { | 757 if (bodyRange.covers(nodeRange)) { |
| 758 _addInstanceFieldQualifier(node); | 758 _addInstanceFieldQualifier(node); |
| 759 _addParameter(node); | 759 _addParameter(node); |
| 760 _addVariable(node); | 760 _addVariable(node); |
| 761 } | 761 } |
| 762 } | 762 } |
| 763 | 763 |
| 764 void _addInstanceFieldQualifier(SimpleIdentifier node) { | 764 void _addInstanceFieldQualifier(SimpleIdentifier node) { |
| 765 PropertyAccessorElement accessor = getPropertyAccessorElement(node); | 765 PropertyAccessorElement accessor = getPropertyAccessorElement(node); |
| 766 if (isClassFieldAccessorElement(accessor)) { | 766 if (isFieldAccessorElement(accessor)) { |
| 767 AstNode qualifier = getNodeQualifier(node); | 767 AstNode qualifier = getNodeQualifier(node); |
| 768 if (qualifier == null || qualifier is ThisExpression) { | 768 if (qualifier == null || qualifier is ThisExpression) { |
| 769 if (accessor.isStatic) { | 769 if (accessor.isStatic) { |
| 770 String className = accessor.enclosingElement.displayName; | 770 String className = accessor.enclosingElement.displayName; |
| 771 if (qualifier == null) { | 771 if (qualifier == null) { |
| 772 SourceRange qualifierRange = rangeStartLength(node, 0); | 772 SourceRange qualifierRange = rangeStartLength(node, 0); |
| 773 result.addStaticFieldQualifier(className, qualifierRange); | 773 result.addStaticFieldQualifier(className, qualifierRange); |
| 774 } | 774 } |
| 775 } else { | 775 } else { |
| 776 SourceRange qualifierRange; | 776 SourceRange qualifierRange; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 805 } | 805 } |
| 806 | 806 |
| 807 void _addVariable(SimpleIdentifier node) { | 807 void _addVariable(SimpleIdentifier node) { |
| 808 VariableElement variableElement = getLocalVariableElement(node); | 808 VariableElement variableElement = getLocalVariableElement(node); |
| 809 if (variableElement != null) { | 809 if (variableElement != null) { |
| 810 SourceRange nodeRange = rangeNode(node); | 810 SourceRange nodeRange = rangeNode(node); |
| 811 result.addVariable(variableElement, nodeRange); | 811 result.addVariable(variableElement, nodeRange); |
| 812 } | 812 } |
| 813 } | 813 } |
| 814 } | 814 } |
| OLD | NEW |