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

Unified Diff: pkg/analysis_server/test/analysis/get_hover_test.dart

Issue 2310153002: Issue 27244. Add 'isDeprecated' to HoverInformation. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/analysis/get_hover_test.dart
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 9d5436beca2cecaf09f166f3ecedb51aaa1735e8..bbf8cbf20fc1a5a56c48e7517ecfdb94cd065be5 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -238,6 +238,24 @@ class A {
expect(hover.parameter, isNull);
}
+ test_expression_method_deprecated() async {
+ addTestFile('''
+class A {
+ @deprecated
+ static void test() {}
+}
+main() {
+ A.test();
+}
+''');
+ HoverInformation hover = await prepareHover('test();');
+ // element
+ expect(hover.containingLibraryPath, testFile);
+ expect(hover.elementDescription, 'test() → void');
+ expect(hover.elementKind, 'method');
+ expect(hover.isDeprecated, isTrue);
+ }
+
test_expression_method_invocation() async {
addTestFile('''
library my.library;
@@ -258,6 +276,7 @@ main(A a) {
expect(hover.containingLibraryPath, testFile);
expect(hover.elementDescription, 'mmm(int a, String b) → List<String>');
expect(hover.elementKind, 'method');
+ expect(hover.isDeprecated, isFalse);
// types
expect(hover.staticType, '(int, String) → List<String>');
expect(hover.propagatedType, isNull);
@@ -409,6 +428,7 @@ main() {
// no parameter
expect(hover.parameter, isNull);
}
+
{
HoverInformation hover = await prepareHover('new A');
onConstructor(hover);
@@ -445,6 +465,7 @@ main() {
expect(hover.elementDescription, 'A.named() → A');
expect(hover.elementKind, 'constructor');
}
+
{
HoverInformation hover = await prepareHover('new A');
onConstructor(hover);
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_hover.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698