Index: pkg/analysis_server/test/analysis/notification_highlights_test2.dart |
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart |
index dcbf39a6c3b1b38d8b5c0567e9c8e2da5a302036..5f3b79b96578888aa85333f8a7f58a01ad7ce913 100644 |
--- a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart |
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart |
@@ -1094,6 +1094,58 @@ class A<T> { |
}); |
} |
+ test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_dynamicVarTarget() { |
+ addTestFile(''' |
+main(p) { |
+ p.aaa; |
+ p.aaa++; |
+ p.aaa += 0; |
+ ++p.aaa; // ++ |
+ p.aaa = 0; |
+ p.bbb(0); |
+ ''.length.ccc().ddd(); |
+} |
+'''); |
+ return prepareHighlights().then((_) { |
+ HighlightRegionType type = |
+ HighlightRegionType.UNRESOLVED_INSTANCE_MEMBER_REFERENCE; |
+ assertHasRegion(type, 'aaa'); |
+ assertHasRegion(type, 'aaa++'); |
+ assertHasRegion(type, 'aaa += 0'); |
+ assertHasRegion(type, 'aaa; // ++'); |
+ assertHasRegion(type, 'aaa ='); |
+ assertHasRegion(type, 'bbb('); |
+ assertHasRegion(type, 'ddd()'); |
+ }); |
+ } |
+ |
+ test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_nonDynamicTarget() { |
+ addTestFile(''' |
+import 'dart:math' as math; |
+main(String str) { |
+ new Object().aaa(); |
+ math.bbb(); |
+ str.ccc(); |
+} |
+class A { |
+ m() { |
+ unresolved(1); |
+ this.unresolved(2); |
+ super.unresolved(3); |
+ } |
+} |
+'''); |
+ return prepareHighlights().then((_) { |
+ HighlightRegionType type = HighlightRegionType.IDENTIFIER_DEFAULT; |
+ assertHasRegion(type, 'aaa()'); |
+ assertHasRegion(type, 'bbb()'); |
+ assertHasRegion(type, 'ccc()'); |
+ assertHasRegion(type, 'unresolved(1)'); |
+ assertHasRegion(type, 'unresolved(2)'); |
+ assertHasRegion(type, 'unresolved(3)'); |
+ }); |
+ } |
+ |
void _addLibraryForTestPart() { |
addFile( |
'$testFolder/my_lib.dart', |