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

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

Issue 1349223002: Fix for dynamic instance field reference highlighting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights2.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.highlights2; 5 library test.analysis.notification.highlights2;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 assertHasRegion( 724 assertHasRegion(
725 HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'aaa = 1'); 725 HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'aaa = 1');
726 assertHasRegion( 726 assertHasRegion(
727 HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'bbb = 2'); 727 HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'bbb = 2');
728 assertHasRegion(HighlightRegionType.INSTANCE_FIELD_REFERENCE, 'bbb = 3'); 728 assertHasRegion(HighlightRegionType.INSTANCE_FIELD_REFERENCE, 'bbb = 3');
729 assertHasRegion(HighlightRegionType.INSTANCE_SETTER_REFERENCE, 'aaa = 4'); 729 assertHasRegion(HighlightRegionType.INSTANCE_SETTER_REFERENCE, 'aaa = 4');
730 assertHasRegion(HighlightRegionType.INSTANCE_SETTER_REFERENCE, 'bbb = 5'); 730 assertHasRegion(HighlightRegionType.INSTANCE_SETTER_REFERENCE, 'bbb = 5');
731 }); 731 });
732 } 732 }
733 733
734 test_INSTANCE_FIELD_dynamic() {
735 addTestFile('''
736 class A {
737 var f;
738 A(this.f);
739 }
740 ''');
741 return prepareHighlights().then((_) {
742 assertHasRegion(HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'f;');
743 assertHasRegion(HighlightRegionType.INSTANCE_FIELD_REFERENCE, 'f);');
744 });
745 }
746
734 test_KEYWORD() { 747 test_KEYWORD() {
735 addTestFile(''' 748 addTestFile('''
736 main() { 749 main() {
737 assert(true); 750 assert(true);
738 for (;;) break; 751 for (;;) break;
739 switch (0) { 752 switch (0) {
740 case 0: break; 753 case 0: break;
741 default: break; 754 default: break;
742 } 755 }
743 try {} catch (e) {} 756 try {} catch (e) {}
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 void test_toString() { 1095 void test_toString() {
1083 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS'); 1096 expect(HighlightRegionType.CLASS.toString(), 'HighlightRegionType.CLASS');
1084 } 1097 }
1085 1098
1086 void test_valueOf_unknown() { 1099 void test_valueOf_unknown() {
1087 expect(() { 1100 expect(() {
1088 new HighlightRegionType('no-such-type'); 1101 new HighlightRegionType('no-such-type');
1089 }, throws); 1102 }, throws);
1090 } 1103 }
1091 } 1104 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698