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

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

Issue 1004343002: Completion should not show overridden inherited methods (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
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.domain.completion; 5 library test.domain.completion;
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/channel/channel.dart'; 10 import 'package:analysis_server/src/channel/channel.dart';
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 assertHasResult( 429 assertHasResult(
430 CompletionSuggestionKind.INVOCATION, 'a', DART_RELEVANCE_LOCAL_FIELD); 430 CompletionSuggestionKind.INVOCATION, 'a', DART_RELEVANCE_LOCAL_FIELD);
431 assertHasResult(CompletionSuggestionKind.INVOCATION, 'b', 431 assertHasResult(CompletionSuggestionKind.INVOCATION, 'b',
432 DART_RELEVANCE_LOCAL_VARIABLE); 432 DART_RELEVANCE_LOCAL_VARIABLE);
433 assertHasResult(CompletionSuggestionKind.INVOCATION, 'x', 433 assertHasResult(CompletionSuggestionKind.INVOCATION, 'x',
434 DART_RELEVANCE_LOCAL_METHOD); 434 DART_RELEVANCE_LOCAL_METHOD);
435 assertHasResult(CompletionSuggestionKind.INVOCATION, 'DateTime'); 435 assertHasResult(CompletionSuggestionKind.INVOCATION, 'DateTime');
436 }); 436 });
437 } 437 }
438 438
439 test_overrides() {
440 addFile('/libA.dart', 'class A {m() {}}');
441 addTestFile('''
442 import '/libA.dart';
443 class B extends A {m() {^}}
444 ''');
445 return getSuggestions().then((_) {
446 expect(replacementOffset, equals(completionOffset));
447 expect(replacementLength, equals(0));
448 assertHasResult(CompletionSuggestionKind.INVOCATION, 'm',
449 DART_RELEVANCE_LOCAL_METHOD);
450 });
451 }
452
439 test_partFile() { 453 test_partFile() {
440 addFile('/project/bin/testA.dart', ''' 454 addFile('/project/bin/testA.dart', '''
441 library libA; 455 library libA;
442 part "$testFile"; 456 part "$testFile";
443 import 'dart:html'; 457 import 'dart:html';
444 class A { } 458 class A { }
445 '''); 459 ''');
446 addTestFile(''' 460 addTestFile('''
447 part of libA; 461 part of libA;
448 main() {^}'''); 462 main() {^}''');
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 689 }
676 '''); 690 ''');
677 await waitForTasksFinished(); 691 await waitForTasksFinished();
678 Request request = 692 Request request =
679 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); 693 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0');
680 Response response = handler.handleRequest(request); 694 Response response = handler.handleRequest(request);
681 expect(response.error, isNotNull); 695 expect(response.error, isNotNull);
682 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); 696 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
683 } 697 }
684 } 698 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698