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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart

Issue 684863003: Issue 21333. Constant names are not special anymore in the style guide (Dart version). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/rename_class_member.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/refactoring/naming_conventions.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
index 617ced0e9425e452be2a43609da5fc48f4c8cb88..51fb74cffd8f052e21cb5d598e2b317e7bd01eea 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
@@ -24,40 +24,6 @@ RefactoringStatus validateClassName(String name) {
* WARNING if the name is discouraged;
* FATAL if the name is illegal.
*/
-RefactoringStatus validateConstantName(String name) {
- // null
- if (name == null) {
- return new RefactoringStatus.fatal("Constant name must not be null.");
- }
- // is not identifier
- RefactoringStatus status =
- _validateIdentifier(name, "Constant name", 'an uppercase letter or underscore');
- if (!status.isOK) {
- return status;
- }
- // is private, OK
- int startIndex = 0;
- if (name.codeUnitAt(0) == CHAR_UNDERSCORE) {
- startIndex++;
- }
- // does not start with lower case
- for (int i = startIndex; i < name.length; i++) {
- int c = name.codeUnitAt(i);
- if (!isUpperCase(c) && !isDigit(c) && c != CHAR_UNDERSCORE) {
- return new RefactoringStatus.warning(
- "Constant name should be all uppercase with underscores.");
- }
- }
- // OK
- return new RefactoringStatus();
-}
-
-/**
- * Returns the [RefactoringStatus] with severity:
- * OK if the name is valid;
- * WARNING if the name is discouraged;
- * FATAL if the name is illegal.
- */
RefactoringStatus validateConstructorName(String name) {
if (name != null && name.isEmpty) {
return new RefactoringStatus();
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698