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

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

Issue 1303233008: improve keyword suggestions - fixes #24016 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
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.util; 5 library test.services.completion.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/protocol.dart' as protocol 10 import 'package:analysis_server/src/protocol.dart' as protocol
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after
4284 // SwitchStatement Block BlockFunctionBody MethodDeclaration 4284 // SwitchStatement Block BlockFunctionBody MethodDeclaration
4285 addTestSource('class A {String g(int x) {switch(x) {c^}}}'); 4285 addTestSource('class A {String g(int x) {switch(x) {c^}}}');
4286 computeFast(); 4286 computeFast();
4287 return computeFull((bool result) { 4287 return computeFull((bool result) {
4288 assertNoSuggestions(); 4288 assertNoSuggestions();
4289 }); 4289 });
4290 } 4290 }
4291 4291
4292 test_SwitchStatement_case() { 4292 test_SwitchStatement_case() {
4293 // SwitchStatement Block BlockFunctionBody MethodDeclaration 4293 // SwitchStatement Block BlockFunctionBody MethodDeclaration
4294 addTestSource('class A {String g(int x) {switch(x) {case 0: ^}}}'); 4294 addTestSource('class A {String g(int x) {var t; switch(x) {case 0: ^}}}');
4295 computeFast(); 4295 computeFast();
4296 return computeFull((bool result) { 4296 return computeFull((bool result) {
4297 assertSuggestLocalClass('A'); 4297 assertSuggestLocalClass('A');
4298 assertSuggestLocalMethod('g', 'A', 'String'); 4298 assertSuggestLocalMethod('g', 'A', 'String');
4299 assertSuggestLocalVariable('t', null);
4299 assertSuggestImportedClass('String'); 4300 assertSuggestImportedClass('String');
4300 }); 4301 });
4301 } 4302 }
4302 4303
4303 test_SwitchStatement_empty() { 4304 test_SwitchStatement_empty() {
4304 // SwitchStatement Block BlockFunctionBody MethodDeclaration 4305 // SwitchStatement Block BlockFunctionBody MethodDeclaration
4305 addTestSource('class A {String g(int x) {switch(x) {^}}}'); 4306 addTestSource('class A {String g(int x) {switch(x) {^}}}');
4306 computeFast(); 4307 computeFast();
4307 return computeFull((bool result) { 4308 return computeFull((bool result) {
4308 assertNoSuggestions(); 4309 assertNoSuggestions();
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
4698 assertNotSuggested('bar2'); 4699 assertNotSuggested('bar2');
4699 assertNotSuggested('_B'); 4700 assertNotSuggested('_B');
4700 assertSuggestLocalClass('Y'); 4701 assertSuggestLocalClass('Y');
4701 assertSuggestLocalClass('C'); 4702 assertSuggestLocalClass('C');
4702 assertSuggestLocalVariable('f', null); 4703 assertSuggestLocalVariable('f', null);
4703 assertNotSuggested('x'); 4704 assertNotSuggested('x');
4704 assertNotSuggested('e'); 4705 assertNotSuggested('e');
4705 }); 4706 });
4706 } 4707 }
4707 } 4708 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698