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

Unified Diff: pkg/analysis_server/test/analysis_hover_test.dart

Issue 366183002: Update HoverInformation to include offset, length, kind. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis_hover_test.dart
diff --git a/pkg/analysis_server/test/analysis_hover_test.dart b/pkg/analysis_server/test/analysis_hover_test.dart
index 653c740ec08aeafa41dcdab2f8ed140adbfebedc..72c36551d3c8d93c67350d90fc2280f1e78f8b07 100644
--- a/pkg/analysis_server/test/analysis_hover_test.dart
+++ b/pkg/analysis_server/test/analysis_hover_test.dart
@@ -95,6 +95,7 @@ List<String> fff(int a, String b) {
expect(hover.containingLibraryPath, testFile);
expect(hover.dartDoc, '''doc aaa\ndoc bbb''');
expect(hover.elementDescription, 'fff(int a, String b) → List<String>');
+ expect(hover.elementKind, 'function');
// types
expect(hover.staticType, '(int, String) → List<String>');
expect(hover.propagatedType, isNull);
@@ -113,6 +114,7 @@ foo(Object myParameter) {}
return prepareHover('123', () {
// literal, no Element
expect(hover.elementDescription, isNull);
+ expect(hover.elementKind, isNull);
// types
expect(hover.staticType, 'int');
expect(hover.propagatedType, isNull);
@@ -137,6 +139,7 @@ class A {
expect(hover.containingLibraryPath, testFile);
expect(hover.dartDoc, '''doc aaa\ndoc bbb''');
expect(hover.elementDescription, 'A.mmm(int a, String b) → List<String>');
+ expect(hover.elementKind, 'method');
// types
expect(hover.staticType, '(int, String) → List<String>');
expect(hover.propagatedType, isNull);
@@ -145,6 +148,34 @@ class A {
});
}
+ test_expression_method_nvocation() {
+ addTestFile('''
+library my.library;
+class A {
+ List<String> mmm(int a, String b) {
+ }
+}
+main(A a) {
+ a.mmm(42, 'foo');
+}
+''');
+ return prepareHover('mm(42, ', () {
+ // range
+ expect(hover.offset, findOffset('mmm(42, '));
+ expect(hover.length, 'mmm'.length);
+ // element
+ expect(hover.containingLibraryName, 'my.library');
+ expect(hover.containingLibraryPath, testFile);
+ expect(hover.elementDescription, 'A.mmm(int a, String b) → List<String>');
+ expect(hover.elementKind, 'method');
+ // types
+ expect(hover.staticType, isNull);
+ expect(hover.propagatedType, isNull);
+ // no parameter
+ expect(hover.parameter, isNull);
+ });
+ }
+
test_expression_syntheticGetter() {
addTestFile('''
library my.library;
@@ -163,6 +194,7 @@ main(A a) {
expect(hover.containingLibraryPath, testFile);
expect(hover.dartDoc, '''doc aaa\ndoc bbb''');
expect(hover.elementDescription, 'String fff');
+ expect(hover.elementKind, 'field');
// types
expect(hover.staticType, 'String');
expect(hover.propagatedType, isNull);
@@ -183,6 +215,7 @@ main() {
expect(hover.containingLibraryPath, testFile);
expect(hover.dartDoc, isNull);
expect(hover.elementDescription, 'dynamic vvv');
+ expect(hover.elementKind, 'local variable');
// types
expect(hover.staticType, 'dynamic');
expect(hover.propagatedType, 'int');
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698