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

Unified Diff: pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart

Issue 1410893002: Disable completion in comment text. (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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
index e65fbc8ccce784d34d8c23638e2018e966165bad..6753a400f85c1ec0fec3f1daa767a0ed1483d165 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
@@ -24,6 +24,11 @@ import 'package:analyzer/src/generated/utilities_dart.dart';
class LocalReferenceContributor extends DartCompletionContributor {
@override
bool computeFast(DartCompletionRequest request) {
+ // Don't suggest in comments.
+ if (request.target.isCommentText) {
+ return true;
+ }
+
OpType optype = request.optype;
// Collect suggestions from the specific child [AstNode] that contains

Powered by Google App Engine
This is Rietveld 408576698