Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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.forElement(engine.Element element) => |
|
Paul Berry
2014/08/22 16:46:59
Can you help me understand the motivation for this
scheglov
2014/08/22 17:14:54
You're right.
I will rename these factories/functi
| |
| 6628 _locationFromElement(element); | 6628 _locationForElement(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.forMatch(engine.SearchMatch match) => |
| 6634 _locationFromOffset(element, offset, length); | 6634 _locationForMatch(match); |
| 6635 | |
| 6636 /** | |
| 6637 * Create a Location based on an [engine.AstNode]. | |
| 6638 */ | |
| 6639 factory Location.forNode(engine.AstNode node) => | |
| 6640 _locationForNode(node); | |
| 6641 | |
| 6642 /** | |
| 6643 * Create a Location based on an [engine.CompilationUnit]. | |
| 6644 */ | |
| 6645 factory Location.forUnit(engine.CompilationUnit unit, engine.SourceRange range ) => | |
| 6646 _locationForUnit(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 Loading... | |
| 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) => | |
|
Brian Wilkerson
2014/08/22 16:32:17
I guess I wasn't clear. I think this should be an
scheglov
2014/08/22 16:43:02
Sometimes both "first" and "second" are null.
It
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |