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

Side by Side Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 982243002: Disable incremental resolution of comments outside function bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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() { 2846 void test_endOfLineComment_outBody_add() {
2847 _resolveUnit(r''' 2847 _resolveUnit(r'''
2848 main() { 2848 main() {
2849 Object x; 2849 Object x;
2850 x.foo(); 2850 x.foo();
2851 } 2851 }
2852 '''); 2852 ''');
2853 _updateAndValidate(r''' 2853 _updateAndValidate(r'''
2854 // 000 2854 // 000
2855 main() { 2855 main() {
2856 Object x; 2856 Object x;
2857 x.foo(); 2857 x.foo();
2858 } 2858 }
2859 '''); 2859 ''', expectedSuccess: false);
2860 } 2860 }
2861 2861
2862 void test_endOfLineComment_header_remove() { 2862 void test_endOfLineComment_outBody_remove() {
2863 _resolveUnit(r''' 2863 _resolveUnit(r'''
2864 // 000 2864 // 000
2865 main() { 2865 main() {
2866 Object x; 2866 Object x;
2867 x.foo(); 2867 x.foo();
2868 } 2868 }
2869 '''); 2869 ''');
2870 _updateAndValidate(r''' 2870 _updateAndValidate(r'''
2871 main() { 2871 main() {
2872 Object x; 2872 Object x;
2873 x.foo(); 2873 x.foo();
2874 } 2874 }
2875 '''); 2875 ''', expectedSuccess: false);
2876 } 2876 }
2877 2877
2878 void test_endOfLineComment_header_update() { 2878 void test_endOfLineComment_outBody_update() {
2879 _resolveUnit(r''' 2879 _resolveUnit(r'''
2880 // 000 2880 // 000
2881 main() { 2881 main() {
2882 Object x; 2882 Object x;
2883 x.foo(); 2883 x.foo();
2884 } 2884 }
2885 '''); 2885 ''');
2886 _updateAndValidate(r''' 2886 _updateAndValidate(r'''
2887 // 10 2887 // 10
2888 main() { 2888 main() {
2889 Object x; 2889 Object x;
2890 x.foo(); 2890 x.foo();
2891 } 2891 }
2892 '''); 2892 ''', expectedSuccess: false);
2893 } 2893 }
2894 2894
2895 void test_endOfLineComment_localFunction_inTopLevelVariable() { 2895 void test_endOfLineComment_localFunction_inTopLevelVariable() {
2896 _resolveUnit(r''' 2896 _resolveUnit(r'''
2897 typedef int Binary(one, two, three); 2897 typedef int Binary(one, two, three);
2898 2898
2899 int Global = f((a, b, c) { 2899 int Global = f((a, b, c) {
2900 return 0; // Some comment 2900 return 0; // Some comment
2901 }); 2901 });
2902 '''); 2902 ''');
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 return ResolutionContextBuilder.contextFor(node, listener).scope; 3806 return ResolutionContextBuilder.contextFor(node, listener).scope;
3807 } 3807 }
3808 } 3808 }
3809 3809
3810 class _Edit { 3810 class _Edit {
3811 final int offset; 3811 final int offset;
3812 final int length; 3812 final int length;
3813 final String replacement; 3813 final String replacement;
3814 _Edit(this.offset, this.length, this.replacement); 3814 _Edit(this.offset, this.length, this.replacement);
3815 } 3815 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698