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

Side by Side Diff: pkg/analysis_server/test/services/completion/imported_computer_test.dart

Issue 580623002: add element to completion suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 3 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.services.completion.toplevel; 5 library test.services.completion.toplevel;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analysis_server/src/services/completion/imported_computer.dart'; 8 import 'package:analysis_server/src/services/completion/imported_computer.dart';
9 import '../../reflective_tests.dart'; 9 import '../../reflective_tests.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 20 matching lines...) Expand all
31 return computeFull().then((_) { 31 return computeFull().then((_) {
32 assertSuggestClass('A'); 32 assertSuggestClass('A');
33 assertNotSuggested('x'); 33 assertNotSuggested('x');
34 assertNotSuggested('_B'); 34 assertNotSuggested('_B');
35 // Should not suggest compilation unit elements 35 // Should not suggest compilation unit elements
36 // which are returned by the LocalComputer 36 // which are returned by the LocalComputer
37 assertNotSuggested('C'); 37 assertNotSuggested('C');
38 }); 38 });
39 } 39 }
40 40
41 test_function() {
42 addSource('/testA.dart', '@deprecated A() {int x;} _B() {}');
43 addTestSource('import "/testA.dart"; class C {foo(){^}}');
44 return computeFull().then((_) {
45 assertSuggestFunction('A', null, true);
46 assertNotSuggested('x');
47 assertNotSuggested('_B');
48 // Should not suggest compilation unit elements
49 // which are returned by the LocalComputer
50 assertNotSuggested('C');
51 });
52 }
53
41 test_class_importHide() { 54 test_class_importHide() {
42 addSource('/testA.dart', 'class A { } class B { }'); 55 addSource('/testA.dart', 'class A { } class B { }');
43 addTestSource('import "/testA.dart" hide ^; class C {}'); 56 addTestSource('import "/testA.dart" hide ^; class C {}');
44 return computeFull().then((_) { 57 return computeFull().then((_) {
45 assertSuggestClass('A'); 58 assertSuggestClass('A');
46 assertSuggestClass('B'); 59 assertSuggestClass('B');
47 assertNotSuggested('Object'); 60 assertNotSuggested('Object');
48 }); 61 });
49 } 62 }
50 63
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 209
197 test_topLevelVar_notImported() { 210 test_topLevelVar_notImported() {
198 addSource('/testA.dart', 'var T1; var _T2;'); 211 addSource('/testA.dart', 'var T1; var _T2;');
199 addTestSource('class C {foo(){^}}'); 212 addTestSource('class C {foo(){^}}');
200 return computeFull(true).then((_) { 213 return computeFull(true).then((_) {
201 assertSuggestTopLevelVar('T1', null, CompletionRelevance.LOW); 214 assertSuggestTopLevelVar('T1', null, CompletionRelevance.LOW);
202 assertNotSuggested('_T2'); 215 assertNotSuggested('_T2');
203 }); 216 });
204 } 217 }
205 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698