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

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

Issue 1384583007: Fix hover documentation for parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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_hover.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.domain.analysis.hover; 5 library test.domain.analysis.hover;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 expect(hover.elementDescription, 'mmm(int a, String b) → List<String>'); 161 expect(hover.elementDescription, 'mmm(int a, String b) → List<String>');
162 expect(hover.elementKind, 'method'); 162 expect(hover.elementKind, 'method');
163 // types 163 // types
164 expect(hover.staticType, isNull); 164 expect(hover.staticType, isNull);
165 expect(hover.propagatedType, isNull); 165 expect(hover.propagatedType, isNull);
166 // no parameter 166 // no parameter
167 expect(hover.parameter, isNull); 167 expect(hover.parameter, isNull);
168 }); 168 });
169 } 169 }
170 170
171 test_expression_parameter() {
172 addTestFile('''
173 library my.library;
174 class A {
175 /// The method documentation.
176 m(int p) {
177 }
178 }
179 ''');
180 return prepareHover('p) {').then((HoverInformation hover) {
181 // element
182 expect(hover.containingLibraryName, isNull);
183 expect(hover.containingLibraryPath, isNull);
184 expect(hover.containingClassDescription, isNull);
185 expect(hover.dartdoc, 'The method documentation.');
186 expect(hover.elementDescription, 'int p');
187 expect(hover.elementKind, 'parameter');
188 // types
189 expect(hover.staticType, 'int');
190 expect(hover.propagatedType, isNull);
191 // no parameter
192 expect(hover.parameter, isNull);
193 });
194 }
195
171 test_expression_syntheticGetter() { 196 test_expression_syntheticGetter() {
172 addTestFile(''' 197 addTestFile('''
173 library my.library; 198 library my.library;
174 class A { 199 class A {
175 /// doc aaa 200 /// doc aaa
176 /// doc bbb 201 /// doc bbb
177 String fff; 202 String fff;
178 } 203 }
179 main(A a) { 204 main(A a) {
180 print(a.fff); 205 print(a.fff);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 library my.library; 357 library my.library;
333 main() { 358 main() {
334 // nothing 359 // nothing
335 } 360 }
336 '''); 361 ''');
337 return prepareHover('nothing').then((HoverInformation hover) { 362 return prepareHover('nothing').then((HoverInformation hover) {
338 expect(hover, isNull); 363 expect(hover, isNull);
339 }); 364 });
340 } 365 }
341 } 366 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_hover.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698