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

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

Issue 908493003: filter static methods when showing instance completions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 10 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
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:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 buildTests('testCommentSnippets040', ''' 222 buildTests('testCommentSnippets040', '''
223 class List{add(){}}class Map{}class X{m(){List list; list.!1 Map map;}}''', 223 class List{add(){}}class Map{}class X{m(){List list; list.!1 Map map;}}''',
224 <String>["1+add"]); 224 <String>["1+add"]);
225 225
226 buildTests('testCommentSnippets041', ''' 226 buildTests('testCommentSnippets041', '''
227 class List{add(){}length(){}}class X{m(){List list; list.!1 zox();}}''', 227 class List{add(){}length(){}}class X{m(){List list; list.!1 zox();}}''',
228 <String>["1+add"]); 228 <String>["1+add"]);
229 229
230 buildTests('testCommentSnippets042', ''' 230 buildTests('testCommentSnippets042', '''
231 class DateTime{static const int WED=3;int get day;}fd(){DateTime d=new DateTime. now();d.!1WED!2;}''', 231 class DateTime{static const int WED=3;int get day;}fd(){DateTime d=new DateTime. now();d.!1WED!2;}''',
232 <String>["1+day", "2-WED"], 232 <String>["1+day", "2-WED"]);
233 failingTests: '2');
234 233
235 buildTests('testCommentSnippets043', ''' 234 buildTests('testCommentSnippets043', '''
236 class L{var k;void.!1}''', <String>["1-k"]); 235 class L{var k;void.!1}''', <String>["1-k"]);
237 236
238 buildTests('testCommentSnippets044', ''' 237 buildTests('testCommentSnippets044', '''
239 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''', 238 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''',
240 <String>["1+List", "1+XXX.fisk"], 239 <String>["1+List", "1+XXX.fisk"],
241 failingTests: '1'); 240 failingTests: '1');
242 241
243 buildTests('testCommentSnippets047', ''' 242 buildTests('testCommentSnippets047', '''
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 "1+FileMode._internal1", 634 "1+FileMode._internal1",
636 "1+FileMode._internal"], 635 "1+FileMode._internal"],
637 failingTests: '1'); 636 failingTests: '1');
638 637
639 buildTests('testCommentSnippets078', ''' 638 buildTests('testCommentSnippets078', '''
640 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''', 639 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''',
641 <String>["1+from", "1-clear"]); // static method, instance method 640 <String>["1+from", "1-clear"]); // static method, instance method
642 641
643 buildTests('testCommentSnippets079', ''' 642 buildTests('testCommentSnippets079', '''
644 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''', 643 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''',
645 <String>["1-from", "1+clear"], 644 <String>["1-from", "1+clear"]); // static method, instance method
646 failingTests: '1'); // static method, instance method
647 645
648 buildTests('testCommentSnippets080', ''' 646 buildTests('testCommentSnippets080', '''
649 class RuntimeError{var message;}void main() { RuntimeError.!1 }''', 647 class RuntimeError{var message;}void main() { RuntimeError.!1 }''',
650 <String>["1-message"]); // field 648 <String>["1-message"]); // field
651 649
652 buildTests('testCommentSnippets081', ''' 650 buildTests('testCommentSnippets081', '''
653 class Foo {this.!1}''', <String>["1-Object"], failingTests: '1'); 651 class Foo {this.!1}''', <String>["1-Object"], failingTests: '1');
654 652
655 buildTests('testCommentSnippets082', ''' 653 buildTests('testCommentSnippets082', '''
656 class HttpRequest {} 654 class HttpRequest {}
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 class B { 1418 class B {
1421 A a; 1419 A a;
1422 } 1420 }
1423 class C extends A { 1421 class C extends A {
1424 int fieldC; 1422 int fieldC;
1425 } 1423 }
1426 main(B b, C c) { 1424 main(B b, C c) {
1427 b.a.!1; 1425 b.a.!1;
1428 c.!2; 1426 c.!2;
1429 }''', 1427 }''',
1430 <String>["1-FIELD", "1+fieldA", "2+fieldC", "2+fieldA"], 1428 <String>["1-FIELD", "1+fieldA", "2+fieldC", "2+fieldA"]);
1431 failingTests: '1');
1432 1429
1433 buildTests('testCompletion_return_withIdentifierPrefix', ''' 1430 buildTests('testCompletion_return_withIdentifierPrefix', '''
1434 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]); 1431 f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]);
1435 1432
1436 buildTests('testCompletion_return_withoutExpression', ''' 1433 buildTests('testCompletion_return_withoutExpression', '''
1437 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]); 1434 f() { var vvv = 42; return !1 }''', <String>["1+vvv"]);
1438 1435
1439 buildTests('testCompletion_staticField1', ''' 1436 buildTests('testCompletion_staticField1', '''
1440 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo wer() {x!Xc = y!Yc = MA!1 }}''', 1437 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flo wer() {x!Xc = y!Yc = MA!1 }}''',
1441 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"], 1438 <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"],
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 "5+_m", 2150 "5+_m",
2154 "6+g", 2151 "6+g",
2155 "7-g", 2152 "7-g",
2156 "8-m", 2153 "8-m",
2157 "9-_m", 2154 "9-_m",
2158 "A+_m", 2155 "A+_m",
2159 "B+m", 2156 "B+m",
2160 "C+g", 2157 "C+g",
2161 "D+_m", 2158 "D+_m",
2162 "E+m", 2159 "E+m",
2163 "F+g"], 2160 "F+g"]);
2164 failingTests: '789');
2165 2161
2166 buildTests('test026', '''var aBcD; var x=ab!1''', <String>["1+aBcD"]); 2162 buildTests('test026', '''var aBcD; var x=ab!1''', <String>["1+aBcD"]);
2167 2163
2168 buildTests( 2164 buildTests(
2169 'test027', 2165 'test027',
2170 '''m(){try{}catch(eeee,ssss){s!1}''', 2166 '''m(){try{}catch(eeee,ssss){s!1}''',
2171 <String>["1+ssss"]); 2167 <String>["1+ssss"]);
2172 2168
2173 buildTests('test028', '''m(){var isX=3;if(is!1)''', <String>["1+isX"]); 2169 buildTests('test028', '''m(){var isX=3;if(is!1)''', <String>["1+isX"]);
2174 2170
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 } else { 2381 } else {
2386 ++expectedPassCount; 2382 ++expectedPassCount;
2387 tester(testName, () { 2383 tester(testName, () {
2388 CompletionTestCase test = new CompletionTestCase(); 2384 CompletionTestCase test = new CompletionTestCase();
2389 return test.runTest(spec, extraFiles); 2385 return test.runTest(spec, extraFiles);
2390 }); 2386 });
2391 } 2387 }
2392 } 2388 }
2393 } 2389 }
2394 } 2390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698