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

Side by Side Diff: pkg/analysis_server/test/analysis/notification_navigation_test.dart

Issue 1465303003: Generate separate navigation regions for 'super' and optional 'name'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/lib/src/domains/analysis/navigation_dart.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.analysis.notification.navigation; 5 library test.analysis.notification.navigation;
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/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 test_partOf() { 790 test_partOf() {
791 var libCode = 'library lib; part "test.dart";'; 791 var libCode = 'library lib; part "test.dart";';
792 var libFile = addFile('$projectPath/bin/lib.dart', libCode); 792 var libFile = addFile('$projectPath/bin/lib.dart', libCode);
793 addTestFile('part of lib;'); 793 addTestFile('part of lib;');
794 return prepareNavigation().then((_) { 794 return prepareNavigation().then((_) {
795 assertHasRegionString('lib'); 795 assertHasRegionString('lib');
796 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length); 796 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length);
797 }); 797 });
798 } 798 }
799 799
800 test_redirectingConstructorInvocation() {
801 addTestFile('''
802 class A {
803 A() {}
804 A.foo() : this();
805 A.bar() : this.foo();
806 }
807 ''');
808 return prepareNavigation().then((_) {
809 {
810 assertHasRegion('this();');
811 assertHasTarget('A() {}', 0);
812 }
813 {
814 assertHasRegion('this.foo');
815 assertHasTarget('foo() :');
816 }
817 {
818 assertHasRegion('foo();');
819 assertHasTarget('foo() :');
820 }
821 });
822 }
823
800 test_string_export() { 824 test_string_export() {
801 var libCode = 'library lib;'; 825 var libCode = 'library lib;';
802 var libFile = addFile('$projectPath/bin/lib.dart', libCode); 826 var libFile = addFile('$projectPath/bin/lib.dart', libCode);
803 addTestFile('export "lib.dart";'); 827 addTestFile('export "lib.dart";');
804 return prepareNavigation().then((_) { 828 return prepareNavigation().then((_) {
805 assertHasRegionString('"lib.dart"'); 829 assertHasRegionString('"lib.dart"');
806 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length); 830 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length);
807 }); 831 });
808 } 832 }
809 833
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 B() : super(); 895 B() : super();
872 B.named() : super.named(); 896 B.named() : super.named();
873 } 897 }
874 '''); 898 ''');
875 return prepareNavigation().then((_) { 899 return prepareNavigation().then((_) {
876 { 900 {
877 assertHasRegionString('super'); 901 assertHasRegionString('super');
878 assertHasTarget('A() {}', 0); 902 assertHasTarget('A() {}', 0);
879 } 903 }
880 { 904 {
881 assertHasRegionString('super.named'); 905 assertHasRegion('super.named');
906 assertHasTarget('named() {}');
907 }
908 {
909 assertHasRegion('named();');
882 assertHasTarget('named() {}'); 910 assertHasTarget('named() {}');
883 } 911 }
884 }); 912 });
885 } 913 }
886 914
887 test_superConstructorInvocation_synthetic() { 915 test_superConstructorInvocation_synthetic() {
888 addTestFile(''' 916 addTestFile('''
889 class A { 917 class A {
890 } 918 }
891 class B extends A { 919 class B extends A {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 test_type_void() { 955 test_type_void() {
928 addTestFile(''' 956 addTestFile('''
929 void main() { 957 void main() {
930 } 958 }
931 '''); 959 ''');
932 return prepareNavigation().then((_) { 960 return prepareNavigation().then((_) {
933 assertNoRegionAt('void'); 961 assertNoRegionAt('void');
934 }); 962 });
935 } 963 }
936 } 964 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698