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

Side by Side Diff: pkg/analysis_server/test/completion_test.dart

Issue 800723002: Allow completions to wait for analysis without requiring a busy wait loop. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
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 test.completion.support; 5 library test.completion.support;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'completion_test_support.dart'; 9 import 'completion_test_support.dart';
10 10
(...skipping 27 matching lines...) Expand all
38 class A {!1int x; !2mth() {!3int y = this.!5x!6;}}class B{}''', 38 class A {!1int x; !2mth() {!3int y = this.!5x!6;}}class B{}''',
39 <String>["1+A", "2+B", "3+x", "3-y", "5+mth", "6+x"], 39 <String>["1+A", "2+B", "3+x", "3-y", "5+mth", "6+x"],
40 failingTests: '3'); 40 failingTests: '3');
41 41
42 CompletionTestCase.buildTests('testCommentSnippets005', ''' 42 CompletionTestCase.buildTests('testCommentSnippets005', '''
43 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''', 43 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''',
44 <String>["1+Date", "2+JUN", "2+JUL"]); 44 <String>["1+Date", "2+JUN", "2+JUL"]);
45 45
46 CompletionTestCase.buildTests('testCommentSnippets007', ''' 46 CompletionTestCase.buildTests('testCommentSnippets007', '''
47 class C {mth(Map x, !1) {}mtf(!2, Map x) {}m() {for (in!3t i=0; i<5; i++); A!4 x ;}}class int{}class Arrays{}class bool{}''', 47 class C {mth(Map x, !1) {}mtf(!2, Map x) {}m() {for (in!3t i=0; i<5; i++); A!4 x ;}}class int{}class Arrays{}class bool{}''',
48 <String>["1+bool", "2+bool", "3+int", "4+Arrays"], failingTests: '3'); 48 <String>["1+bool", "2+bool", "3+int", "4+Arrays"],
49 failingTests: '3');
49 50
50 CompletionTestCase.buildTests('testCommentSnippets008', ''' 51 CompletionTestCase.buildTests('testCommentSnippets008', '''
51 class Date{}final num M = Dat!1''', <String>["1+Date"]); 52 class Date{}final num M = Dat!1''', <String>["1+Date"]);
52 53
53 // space, char, eol are important 54 // space, char, eol are important
54 CompletionTestCase.buildTests('testCommentSnippets009', ''' 55 CompletionTestCase.buildTests('testCommentSnippets009', '''
55 class Map{}class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', 56 class Map{}class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''',
56 <String>[ 57 <String>[
57 "1+Map", 58 "1+Map",
58 "2+Maps", 59 "2+Maps",
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 94
94 CompletionTestCase.buildTests('testCommentSnippets017', ''' 95 CompletionTestCase.buildTests('testCommentSnippets017', '''
95 class F {var x = !1false;}''', <String>["1+true"], failingTests: '1'); 96 class F {var x = !1false;}''', <String>["1+true"], failingTests: '1');
96 97
97 CompletionTestCase.buildTests('testCommentSnippets018', ''' 98 CompletionTestCase.buildTests('testCommentSnippets018', '''
98 class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''', 99 class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''',
99 <String>["1+Map", "1-void", "1-null", "2+Arrays", "2-void", "2-null"], 100 <String>["1+Map", "1-void", "1-null", "2+Arrays", "2-void", "2-null"],
100 failingTests: '1'); 101 failingTests: '1');
101 102
102 CompletionTestCase.buildTests('testCommentSnippets019', ''' 103 CompletionTestCase.buildTests('testCommentSnippets019', '''
103 class A{m(){Object x;x.!1/**/clear()''', 104 class A{m(){Object x;x.!1/**/clear()''', <String>["1+toString"]);
104 <String>["1+toString"]);
105 105
106 CompletionTestCase.buildTests('testCommentSnippets020', ''' 106 CompletionTestCase.buildTests('testCommentSnippets020', '''
107 classMap{}class tst {var newt;void newf(){}test() {var newz;new!1/**/;}}''', 107 classMap{}class tst {var newt;void newf(){}test() {var newz;new!1/**/;}}''',
108 <String>["1+newt", "1+newf", "1+newz", "1-Map"], 108 <String>["1+newt", "1+newf", "1+newz", "1-Map"],
109 failingTests: '1'); 109 failingTests: '1');
110 110
111 CompletionTestCase.buildTests('testCommentSnippets021', ''' 111 CompletionTestCase.buildTests('testCommentSnippets021', '''
112 class Map{}class tst {var newt;void newf(){}test() {var newz;new !1/**/;}}''', 112 class Map{}class tst {var newt;void newf(){}test() {var newz;new !1/**/;}}''',
113 <String>["1+Map", "1-newt"], 113 <String>["1+Map", "1-newt"],
114 failingTests: '1'); 114 failingTests: '1');
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 "1+library", 2125 "1+library",
2126 "2+import", 2126 "2+import",
2127 "3+export", 2127 "3+export",
2128 "4+part", 2128 "4+part",
2129 "5+as", 2129 "5+as",
2130 "6+hide", 2130 "6+hide",
2131 "7+show", 2131 "7+show",
2132 "8-null"], 2132 "8-null"],
2133 failingTests: '1234567'); 2133 failingTests: '1234567');
2134 2134
2135 // The following test is disabled because it prevents the Dart VM from 2135 // keywords
2136 // exiting, for some unknown reason. TODO(paulberry): fix this. 2136 CompletionTestCase.buildTests(
2137 // // keywords 2137 'test018',
2138 // CompletionTestCase.buildTests( 2138 '''!1part !2of foo;''',
2139 // 'test018', 2139 <String>["1+part", "2+of"],
2140 // '''!1part !2of foo;''', 2140 failingTests: '12');
2141 // <String>["1+part", "2+of"],
2142 // failingTests: '12');
2143 2141
2144 CompletionTestCase.buildTests('test019', ''' 2142 CompletionTestCase.buildTests('test019', '''
2145 var truefalse = 0; 2143 var truefalse = 0;
2146 var falsetrue = 1; 2144 var falsetrue = 1;
2147 main() { 2145 main() {
2148 var foo = true!1 2146 var foo = true!1
2149 }''', <String>["1+true", "1+truefalse", "1-falsetrue"], failingTests: '1'); 2147 }''', <String>["1+true", "1+truefalse", "1-falsetrue"], failingTests: '1');
2150 2148
2151 CompletionTestCase.buildTests( 2149 CompletionTestCase.buildTests(
2152 'test020', 2150 'test020',
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2403 'test_classMembers_inGetter', 2401 'test_classMembers_inGetter',
2404 '''class A { var fff; get z {ff!1}}''', 2402 '''class A { var fff; get z {ff!1}}''',
2405 <String>["1+fff"]); 2403 <String>["1+fff"]);
2406 2404
2407 CompletionTestCase.buildTests( 2405 CompletionTestCase.buildTests(
2408 'testSingle', 2406 'testSingle',
2409 '''class A {int x; !2mth() {int y = this.x;}}class B{}''', 2407 '''class A {int x; !2mth() {int y = this.x;}}class B{}''',
2410 <String>["2+B"]); 2408 <String>["2+B"]);
2411 } 2409 }
2412 } 2410 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698