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

Side by Side Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 462403005: Move Location factories and RefactoringProblemSeverity.max into the generated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename to 'fromX'. Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/spec/generate_files". 7 // "pkg/analysis_server/spec/generate_files".
8 8
9 part of protocol2; 9 part of protocol2;
10 10
(...skipping 6604 matching lines...) Expand 10 before | Expand all | Expand 10 after
6615 } else { 6615 } else {
6616 throw jsonDecoder.missingKey(jsonPath, "startColumn"); 6616 throw jsonDecoder.missingKey(jsonPath, "startColumn");
6617 } 6617 }
6618 return new Location(file, offset, length, startLine, startColumn); 6618 return new Location(file, offset, length, startLine, startColumn);
6619 } else { 6619 } else {
6620 throw jsonDecoder.mismatch(jsonPath, "Location"); 6620 throw jsonDecoder.mismatch(jsonPath, "Location");
6621 } 6621 }
6622 } 6622 }
6623 6623
6624 /** 6624 /**
6625 * Construct based on an element from the analyzer engine. 6625 * Create a Location based on an [engine.Element].
6626 */ 6626 */
6627 factory Location.fromElement(engine.Element element) => 6627 factory Location.fromElement(engine.Element element) =>
6628 _locationFromElement(element); 6628 _locationFromElement(element);
6629 6629
6630 /** 6630 /**
6631 * Create a Location based on an element and offset from the analyzer engine. 6631 * Create a Location based on an [engine.SearchMatch].
6632 */ 6632 */
6633 factory Location.fromOffset(engine.Element element, int offset, int length) => 6633 factory Location.fromMatch(engine.SearchMatch match) =>
6634 _locationFromOffset(element, offset, length); 6634 _locationFromMatch(match);
6635
6636 /**
6637 * Create a Location based on an [engine.AstNode].
6638 */
6639 factory Location.fromNode(engine.AstNode node) =>
6640 _locationFromNode(node);
6641
6642 /**
6643 * Create a Location based on an [engine.CompilationUnit].
6644 */
6645 factory Location.fromUnit(engine.CompilationUnit unit, engine.SourceRange rang e) =>
6646 _locationFromUnit(unit, range);
6635 6647
6636 Map<String, dynamic> toJson() { 6648 Map<String, dynamic> toJson() {
6637 Map<String, dynamic> result = {}; 6649 Map<String, dynamic> result = {};
6638 result["file"] = file; 6650 result["file"] = file;
6639 result["offset"] = offset; 6651 result["offset"] = offset;
6640 result["length"] = length; 6652 result["length"] = length;
6641 result["startLine"] = startLine; 6653 result["startLine"] = startLine;
6642 result["startColumn"] = startColumn; 6654 result["startColumn"] = startColumn;
6643 return result; 6655 return result;
6644 } 6656 }
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
7576 if (json is String) { 7588 if (json is String) {
7577 try { 7589 try {
7578 return new RefactoringProblemSeverity(json); 7590 return new RefactoringProblemSeverity(json);
7579 } catch(_) { 7591 } catch(_) {
7580 // Fall through 7592 // Fall through
7581 } 7593 }
7582 } 7594 }
7583 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity"); 7595 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity");
7584 } 7596 }
7585 7597
7598 /**
7599 * Returns the [RefactoringProblemSeverity] with the maximal severity.
7600 */
7601 static RefactoringProblemSeverity max(RefactoringProblemSeverity a, Refactorin gProblemSeverity b) =>
7602 _maxRefactoringProblemSeverity(a, b);
7603
7586 @override 7604 @override
7587 String toString() => "RefactoringProblemSeverity.$name"; 7605 String toString() => "RefactoringProblemSeverity.$name";
7588 7606
7589 String toJson() => name; 7607 String toJson() => name;
7590 } 7608 }
7591 7609
7592 /** 7610 /**
7593 * RemoveContentOverlay 7611 * RemoveContentOverlay
7594 * 7612 *
7595 * { 7613 * {
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
9071 return false; 9089 return false;
9072 } 9090 }
9073 9091
9074 @override 9092 @override
9075 int get hashCode { 9093 int get hashCode {
9076 int hash = 0; 9094 int hash = 0;
9077 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 9095 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
9078 return _JenkinsSmiHash.finish(hash); 9096 return _JenkinsSmiHash.finish(hash);
9079 } 9097 }
9080 } 9098 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698