| 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 engine.incremental_resolver_test; | 5 library engine.incremental_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2836 } | 2836 } |
| 2837 '''); | 2837 '''); |
| 2838 _updateAndValidate(r''' | 2838 _updateAndValidate(r''' |
| 2839 main() { | 2839 main() { |
| 2840 // edited comment text | 2840 // edited comment text |
| 2841 print(0); | 2841 print(0); |
| 2842 } | 2842 } |
| 2843 '''); | 2843 '''); |
| 2844 } | 2844 } |
| 2845 | 2845 |
| 2846 void test_endOfLineComment_header_add() { |
| 2847 _resolveUnit(r''' |
| 2848 main() { |
| 2849 Object x; |
| 2850 x.foo(); |
| 2851 } |
| 2852 '''); |
| 2853 _updateAndValidate(r''' |
| 2854 // 000 |
| 2855 main() { |
| 2856 Object x; |
| 2857 x.foo(); |
| 2858 } |
| 2859 '''); |
| 2860 } |
| 2861 |
| 2862 void test_endOfLineComment_header_remove() { |
| 2863 _resolveUnit(r''' |
| 2864 // 000 |
| 2865 main() { |
| 2866 Object x; |
| 2867 x.foo(); |
| 2868 } |
| 2869 '''); |
| 2870 _updateAndValidate(r''' |
| 2871 main() { |
| 2872 Object x; |
| 2873 x.foo(); |
| 2874 } |
| 2875 '''); |
| 2876 } |
| 2877 |
| 2878 void test_endOfLineComment_header_update() { |
| 2879 _resolveUnit(r''' |
| 2880 // 000 |
| 2881 main() { |
| 2882 Object x; |
| 2883 x.foo(); |
| 2884 } |
| 2885 '''); |
| 2886 _updateAndValidate(r''' |
| 2887 // 10 |
| 2888 main() { |
| 2889 Object x; |
| 2890 x.foo(); |
| 2891 } |
| 2892 '''); |
| 2893 } |
| 2894 |
| 2846 void test_endOfLineComment_localFunction_inTopLevelVariable() { | 2895 void test_endOfLineComment_localFunction_inTopLevelVariable() { |
| 2847 _resolveUnit(r''' | 2896 _resolveUnit(r''' |
| 2848 typedef int Binary(one, two, three); | 2897 typedef int Binary(one, two, three); |
| 2849 | 2898 |
| 2850 int Global = f((a, b, c) { | 2899 int Global = f((a, b, c) { |
| 2851 return 0; // Some comment | 2900 return 0; // Some comment |
| 2852 }); | 2901 }); |
| 2853 '''); | 2902 '''); |
| 2854 _updateAndValidate(r''' | 2903 _updateAndValidate(r''' |
| 2855 typedef int Binary(one, two, three); | 2904 typedef int Binary(one, two, three); |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3757 return ResolutionContextBuilder.contextFor(node, listener).scope; | 3806 return ResolutionContextBuilder.contextFor(node, listener).scope; |
| 3758 } | 3807 } |
| 3759 } | 3808 } |
| 3760 | 3809 |
| 3761 class _Edit { | 3810 class _Edit { |
| 3762 final int offset; | 3811 final int offset; |
| 3763 final int length; | 3812 final int length; |
| 3764 final String replacement; | 3813 final String replacement; |
| 3765 _Edit(this.offset, this.length, this.replacement); | 3814 _Edit(this.offset, this.length, this.replacement); |
| 3766 } | 3815 } |
| OLD | NEW |