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

Unified Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 1909843002: Pull the 'keyword' property into Token. (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
Index: pkg/analysis_server/lib/src/services/correction/util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 1603ef3672bfb917ac931297d3cf3dfe4465224d..564807cac9fde95f641b54787215906970aaa0d7 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -17,7 +17,6 @@ import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
-import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
@@ -1413,16 +1412,13 @@ class CorrectionUtils_InsertDesc {
*/
class TokenUtils {
/**
- * @return the first [KeywordToken] with given [Keyword], may be <code>null</code> if
- * not found.
+ * Return the first keyword [Token] with given [Keyword], may be `null` if
Brian Wilkerson 2016/04/21 13:41:37 nit: Personally, I'd rewrite this as Return the f
+ * not found.
*/
- static KeywordToken findKeywordToken(List<Token> tokens, Keyword keyword) {
+ static Token findKeywordToken(List<Token> tokens, Keyword keyword) {
for (Token token in tokens) {
- if (token is KeywordToken) {
- KeywordToken keywordToken = token;
- if (keywordToken.keyword == keyword) {
- return keywordToken;
- }
+ if (token.keyword == keyword) {
+ return token;
}
}
return null;
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | pkg/analyzer/lib/dart/ast/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698