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

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

Issue 1050983002: Tweaks for hover - local variables and methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 d499a4c6d4945ebd97c0a30043c18e4e4ebac12d..642883245786d886a73a29e0fe9d4e0e74bccb64 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -129,7 +129,7 @@ class A {
expect(hover.containingLibraryPath, testFile);
expect(hover.containingClassDescription, 'A');
expect(hover.dartdoc, '''doc aaa\ndoc bbb''');
- expect(hover.elementDescription, 'A.mmm(int a, String b) → List<String>');
+ expect(hover.elementDescription, 'mmm(int a, String b) → List<String>');
expect(hover.elementKind, 'method');
// types
expect(hover.staticType, '(int, String) → List<String>');
@@ -157,7 +157,7 @@ main(A a) {
// element
expect(hover.containingLibraryName, 'my.library');
expect(hover.containingLibraryPath, testFile);
- expect(hover.elementDescription, 'A.mmm(int a, String b) → List<String>');
+ expect(hover.elementDescription, 'mmm(int a, String b) → List<String>');
expect(hover.elementKind, 'method');
// types
expect(hover.staticType, isNull);
@@ -203,8 +203,9 @@ main() {
''');
return prepareHover('vvv);').then((HoverInformation hover) {
// element
- expect(hover.containingLibraryName, 'my.library');
- expect(hover.containingLibraryPath, testFile);
+ expect(hover.containingLibraryName, isNull);
+ expect(hover.containingLibraryPath, isNull);
+ expect(hover.containingClassDescription, isNull);
expect(hover.dartdoc, isNull);
expect(hover.elementDescription, 'dynamic vvv');
expect(hover.elementKind, 'local variable');
@@ -214,6 +215,31 @@ main() {
});
}
+ test_expression_variable_inMethod() {
+ addTestFile('''
+library my.library;
+class A {
+ m() {
+ num vvv = 42;
+ }
+}
+''');
+ return prepareHover('vvv = 42').then((HoverInformation hover) {
+ // element
+ expect(hover.containingLibraryName, isNull);
+ expect(hover.containingLibraryPath, isNull);
+ expect(hover.containingClassDescription, isNull);
+ expect(hover.dartdoc, isNull);
+ expect(hover.elementDescription, 'num vvv');
+ expect(hover.elementKind, 'local variable');
+ // types
+ expect(hover.staticType, 'num');
+ expect(hover.propagatedType, 'int');
+ // no parameter
+ expect(hover.parameter, isNull);
+ });
+ }
+
test_instanceCreation_implicit() {
addTestFile('''
library my.library;
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_hover.dart ('k') | pkg/analyzer/lib/src/generated/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698