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

Unified Diff: pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart

Issue 1534043002: Cache element docs (and add to completions) (#23694). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: review_fix Created 5 years 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/services/completion/dart/imported_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
index 231ce1d56ddb257ce15053df93a06ab7d83f0905..230fbda9ac1e10949b197aabfc63e2a33588c569 100644
--- a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
@@ -45,6 +45,48 @@ class ImportedReferenceContributorTest extends DartCompletionContributorTest {
assertNotSuggested('two');
}
+ test_doc_class() async {
+ addSource(
+ '/libA.dart',
+ r'''
+library A;
+/// My class.
+/// Short description.
+///
+/// Longer description.
+class A {}
+''');
+ addTestSource('import "/libA.dart"; main() {^}');
+
+ await computeSuggestions();
+
+ CompletionSuggestion suggestion = assertSuggestClass('A');
+ expect(suggestion.docSummary, 'My class.\nShort description.');
+ expect(suggestion.docComplete,
+ 'My class.\nShort description.\n\nLonger description.');
+ }
+
+ test_doc_function() async {
Brian Wilkerson 2015/12/17 22:51:17 We should add a test with c-style comments (or con
pquitslund 2015/12/18 04:56:49 Good call. Done.
+ resolveSource(
+ '/libA.dart',
+ r'''
+library A;
+/// My function.
+/// Short description.
+///
+/// Longer description.
+int myFunc() {}
+''');
+ addTestSource('import "/libA.dart"; main() {^}');
+
+ await computeSuggestions();
+
+ CompletionSuggestion suggestion = assertSuggestFunction('myFunc', 'int');
+ expect(suggestion.docSummary, 'My function.\nShort description.');
+ expect(suggestion.docComplete,
+ 'My function.\nShort description.\n\nLonger description.');
+ }
+
test_enum() async {
addSource('/libA.dart', 'library A; enum E { one, two }');
addTestSource('import "/libA.dart"; main() {^}');

Powered by Google App Engine
This is Rietveld 408576698