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

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

Issue 1369033002: Completions with exact prefix should be prioritized - fixes #23099 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.dart.local; 5 library test.services.completion.dart.local;
6 6
7 import 'package:analysis_server/src/protocol.dart' as protocol 7 import 'package:analysis_server/src/protocol.dart' as protocol
8 show Element, ElementKind; 8 show Element, ElementKind;
9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; 9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 786
787 test_overrides() { 787 test_overrides() {
788 addTestSource(''' 788 addTestSource('''
789 class A {m() {}} 789 class A {m() {}}
790 class B extends A {m() {^}} 790 class B extends A {m() {^}}
791 '''); 791 ''');
792 expect(computeFast(), isTrue); 792 expect(computeFast(), isTrue);
793 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD); 793 assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD);
794 } 794 }
795 795
796 test_prioritization_private() {
797 addTestSource('main() {var ab; var _ab; _^}');
798 expect(computeFast(), isTrue);
799 assertSuggestLocalVariable('ab', null);
800 assertSuggestLocalVariable('_ab', null);
801 }
802
803 test_prioritization_public() {
804 addTestSource('main() {var ab; var _ab; a^}');
805 expect(computeFast(), isTrue);
806 assertSuggestLocalVariable('ab', null);
807 assertSuggestLocalVariable('_ab', null, relevance: DART_RELEVANCE_DEFAULT);
808 }
809
796 test_shadowed_name() { 810 test_shadowed_name() {
797 addTestSource('var a; class A { var a; m() { ^ } }'); 811 addTestSource('var a; class A { var a; m() { ^ } }');
798 expect(computeFast(), isTrue); 812 expect(computeFast(), isTrue);
799 assertSuggestLocalField('a', null); 813 assertSuggestLocalField('a', null);
800 } 814 }
801 } 815 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698