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

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

Issue 1867063003: show only named argument suggestions - fixes #25198, fixes #23992 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/optype.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
index 019c1ea1af61c6ec179a7aec62a16438deb59c6e..5ba7fa1c599bc6151fa5f91b3c4aad22b5bb2ed1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
@@ -13,6 +13,8 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/src/dart/ast/token.dart';
+import 'package:analysis_server/src/services/completion/dart/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/dart/optype.dart';
const ASYNC = 'async';
const ASYNC_STAR = 'async*';
@@ -50,6 +52,13 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
@override
visitArgumentList(ArgumentList node) {
+ if (request is DartCompletionRequestImpl) {
+ //TODO(danrubel) consider adding opType to the API then remove this cast
+ OpType opType = (request as DartCompletionRequestImpl).opType;
+ if (opType.includeOnlyNamedArgumentSuggestions) {
+ return;
+ }
+ }
if (entity == node.rightParenthesis) {
_addExpressionKeywords(node);
Token previous = (entity as Token).previous;
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/optype.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698