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

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

Issue 1517693004: extract LibraryPrefixContributor from imported reference contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
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/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 465
466 test_imports_prefixed() { 466 test_imports_prefixed() {
467 addTestFile(''' 467 addTestFile('''
468 import 'dart:html' as foo; 468 import 'dart:html' as foo;
469 main() {^} 469 main() {^}
470 '''); 470 ''');
471 return getSuggestions().then((_) { 471 return getSuggestions().then((_) {
472 expect(replacementOffset, equals(completionOffset)); 472 expect(replacementOffset, equals(completionOffset));
473 expect(replacementLength, equals(0)); 473 expect(replacementLength, equals(0));
474 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); 474 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
475 assertHasResult(CompletionSuggestionKind.INVOCATION, 'foo'); 475 assertHasResult(CompletionSuggestionKind.IDENTIFIER, 'foo');
476 assertNoResult('HtmlElement'); 476 assertNoResult('HtmlElement');
477 assertNoResult('test'); 477 assertNoResult('test');
478 }); 478 });
479 } 479 }
480 480
481 test_imports_prefixed2() { 481 test_imports_prefixed2() {
482 addTestFile(''' 482 addTestFile('''
483 import 'dart:html' as foo; 483 import 'dart:html' as foo;
484 main() {foo.^} 484 main() {foo.^}
485 '''); 485 ''');
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 } 877 }
878 '''); 878 ''');
879 await waitForTasksFinished(); 879 await waitForTasksFinished();
880 Request request = 880 Request request =
881 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); 881 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0');
882 Response response = handler.handleRequest(request); 882 Response response = handler.handleRequest(request);
883 expect(response.error, isNotNull); 883 expect(response.error, isNotNull);
884 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); 884 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
885 } 885 }
886 } 886 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698