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

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

Issue 1834423002: Sort the files in analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/dart/arglist_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
index 1a1352fd00ea1cd9af6460fd32f1267397be6d71..e3a8f0bfc0841308d0dd7461f69d5e5c571dd00d 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/arglist_contributor.dart
@@ -79,6 +79,32 @@ bool _isAppendingToArgList(DartCompletionRequest request) {
}
/**
+ * Determine if the completion target is the label for a named argument.
+ */
+bool _isEditingNamedArgLabel(DartCompletionRequest request) {
+ AstNode node = request.target.containingNode;
+ if (node is ArgumentList) {
+ var entity = request.target.entity;
+ if (entity is NamedExpression) {
+ int offset = request.offset;
+ if (entity.offset < offset && offset < entity.end) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+/**
+ * Determine if the completion target is an emtpy argument list.
+ */
+bool _isEmptyArgList(DartCompletionRequest request) {
+ AstNode node = request.target.containingNode;
+ return node is ArgumentList &&
+ node.leftParenthesis.next == node.rightParenthesis;
+}
+
+/**
* Determine if the completion target is in the middle or beginning of the list
* of named parameters and is not preceded by a comma. This method assumes that
* _isAppendingToArgList has been called and is false.
@@ -117,32 +143,6 @@ bool _isInsertingToArgListWithSynthetic(DartCompletionRequest request) {
}
/**
- * Determine if the completion target is the label for a named argument.
- */
-bool _isEditingNamedArgLabel(DartCompletionRequest request) {
- AstNode node = request.target.containingNode;
- if (node is ArgumentList) {
- var entity = request.target.entity;
- if (entity is NamedExpression) {
- int offset = request.offset;
- if (entity.offset < offset && offset < entity.end) {
- return true;
- }
- }
- }
- return false;
-}
-
-/**
- * Determine if the completion target is an emtpy argument list.
- */
-bool _isEmptyArgList(DartCompletionRequest request) {
- AstNode node = request.target.containingNode;
- return node is ArgumentList &&
- node.leftParenthesis.next == node.rightParenthesis;
-}
-
-/**
* Return a collection of currently specified named arguments
*/
Iterable<String> _namedArgs(DartCompletionRequest request) {

Powered by Google App Engine
This is Rietveld 408576698