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

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

Issue 1522003003: suppress all dart contributor suggestions in comments (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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/domain_completion_test.dart
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 619136b1adf1064c4b821e927431a53f41209f44..e4f25b761179db9f9e18a5ecc21da5c79ba38818 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -342,8 +342,9 @@ class CompletionTest extends AbstractAnalysisTest {
Future getSuggestions() {
return waitForTasksFinished().then((_) {
- Request request = new CompletionGetSuggestionsParams(
- testFile, completionOffset).toRequest('0');
+ Request request =
+ new CompletionGetSuggestionsParams(testFile, completionOffset)
+ .toRequest('0');
Response response = handleSuccessfulRequest(request);
completionId = response.id;
assertValidId(completionId);
@@ -532,6 +533,77 @@ class CompletionTest extends AbstractAnalysisTest {
});
}
+ test_inComment_block_beforeNode() async {
+ addTestFile('''
+ main(aaa, bbb) {
+ /* text ^ */
+ print(42);
+ }
+ ''');
+ await getSuggestions();
+ expect(suggestions, isEmpty);
+ }
+
+ test_inComment_endOfLine_beforeNode() async {
+ addTestFile('''
+ main(aaa, bbb) {
+ // text ^
+ print(42);
+ }
+ ''');
+ await getSuggestions();
+ expect(suggestions, isEmpty);
+ }
+
+ test_inComment_endOfLine_beforeToken() async {
+ addTestFile('''
+ main(aaa, bbb) {
+ // text ^
+ }
+ ''');
+ await getSuggestions();
+ expect(suggestions, isEmpty);
+ }
+
+ test_inDartDoc1() async {
+ addTestFile('''
+ /// ^
+ main(aaa, bbb) {}
+ ''');
+ await getSuggestions();
+ expect(suggestions, isEmpty);
+ }
+
+ test_inDartDoc2() async {
+ addTestFile('''
+ /// Some text^
+ main(aaa, bbb) {}
+ ''');
+ await getSuggestions();
+ expect(suggestions, isEmpty);
+ }
+
+ test_inDartDoc_reference2() async {
+ addTestFile('''
+ /// The [^]
+ main(aaa, bbb) {}
+ ''');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'main',
+ relevance: DART_RELEVANCE_LOCAL_FUNCTION);
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
+ }
+
+ test_inDartDoc_reference3() async {
+ addTestFile('''
+ /// The [m^]
+ main(aaa, bbb) {}
+ ''');
+ await getSuggestions();
+ assertHasResult(CompletionSuggestionKind.INVOCATION, 'main',
+ relevance: DART_RELEVANCE_LOCAL_FUNCTION);
+ }
+
test_keyword() {
addTestFile('library A; cl^');
return getSuggestions().then((_) {

Powered by Google App Engine
This is Rietveld 408576698