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/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
8 | 8 |
9 part of protocol; | 9 part of protocol; |
10 /** | 10 /** |
(...skipping 4378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4389 * | 4389 * |
4390 * { | 4390 * { |
4391 * "severity": AnalysisErrorSeverity | 4391 * "severity": AnalysisErrorSeverity |
4392 * "type": AnalysisErrorType | 4392 * "type": AnalysisErrorType |
4393 * "location": Location | 4393 * "location": Location |
4394 * "message": String | 4394 * "message": String |
4395 * "correction": optional String | 4395 * "correction": optional String |
4396 * } | 4396 * } |
4397 */ | 4397 */ |
4398 class AnalysisError implements HasToJson { | 4398 class AnalysisError implements HasToJson { |
4399 /** | |
4400 * Returns a list of AnalysisErrors correponding to the given list of Engine | |
4401 * errors. | |
4402 */ | |
4403 static List<AnalysisError> listFromEngine(engine.LineInfo lineInfo, List<engin
e.AnalysisError> errors) => | |
4404 _analysisErrorListFromEngine(lineInfo, errors); | |
4405 | 4399 |
4406 /** | 4400 /** |
4407 * The severity of the error. | 4401 * The severity of the error. |
4408 */ | 4402 */ |
4409 AnalysisErrorSeverity severity; | 4403 AnalysisErrorSeverity severity; |
4410 | 4404 |
4411 /** | 4405 /** |
4412 * The type of the error. | 4406 * The type of the error. |
4413 */ | 4407 */ |
4414 AnalysisErrorType type; | 4408 AnalysisErrorType type; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4465 String correction; | 4459 String correction; |
4466 if (json.containsKey("correction")) { | 4460 if (json.containsKey("correction")) { |
4467 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c
orrection"]); | 4461 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c
orrection"]); |
4468 } | 4462 } |
4469 return new AnalysisError(severity, type, location, message, correction: co
rrection); | 4463 return new AnalysisError(severity, type, location, message, correction: co
rrection); |
4470 } else { | 4464 } else { |
4471 throw jsonDecoder.mismatch(jsonPath, "AnalysisError"); | 4465 throw jsonDecoder.mismatch(jsonPath, "AnalysisError"); |
4472 } | 4466 } |
4473 } | 4467 } |
4474 | 4468 |
4475 /** | |
4476 * Construct based on error information from the analyzer engine. | |
4477 */ | |
4478 factory AnalysisError.fromEngine(engine.LineInfo lineInfo, engine.AnalysisErro
r error) => | |
4479 _analysisErrorFromEngine(lineInfo, error); | |
4480 | |
4481 Map<String, dynamic> toJson() { | 4469 Map<String, dynamic> toJson() { |
4482 Map<String, dynamic> result = {}; | 4470 Map<String, dynamic> result = {}; |
4483 result["severity"] = severity.toJson(); | 4471 result["severity"] = severity.toJson(); |
4484 result["type"] = type.toJson(); | 4472 result["type"] = type.toJson(); |
4485 result["location"] = location.toJson(); | 4473 result["location"] = location.toJson(); |
4486 result["message"] = message; | 4474 result["message"] = message; |
4487 if (correction != null) { | 4475 if (correction != null) { |
4488 result["correction"] = correction; | 4476 result["correction"] = correction; |
4489 } | 4477 } |
4490 return result; | 4478 return result; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4565 } | 4553 } |
4566 } | 4554 } |
4567 | 4555 |
4568 Map<String, dynamic> toJson() { | 4556 Map<String, dynamic> toJson() { |
4569 Map<String, dynamic> result = {}; | 4557 Map<String, dynamic> result = {}; |
4570 result["error"] = error.toJson(); | 4558 result["error"] = error.toJson(); |
4571 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList()
; | 4559 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList()
; |
4572 return result; | 4560 return result; |
4573 } | 4561 } |
4574 | 4562 |
4575 /** | |
4576 * Add a [Fix] | |
4577 */ | |
4578 void addFix(Fix fix) { | |
4579 fixes.add(fix.change); | |
4580 } | |
4581 | |
4582 @override | 4563 @override |
4583 String toString() => JSON.encode(toJson()); | 4564 String toString() => JSON.encode(toJson()); |
4584 | 4565 |
4585 @override | 4566 @override |
4586 bool operator==(other) { | 4567 bool operator==(other) { |
4587 if (other is AnalysisErrorFixes) { | 4568 if (other is AnalysisErrorFixes) { |
4588 return error == other.error && | 4569 return error == other.error && |
4589 _listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a =
= b); | 4570 _listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a =
= b); |
4590 } | 4571 } |
4591 return false; | 4572 return false; |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5560 if (json is String) { | 5541 if (json is String) { |
5561 try { | 5542 try { |
5562 return new CompletionSuggestionKind(json); | 5543 return new CompletionSuggestionKind(json); |
5563 } catch(_) { | 5544 } catch(_) { |
5564 // Fall through | 5545 // Fall through |
5565 } | 5546 } |
5566 } | 5547 } |
5567 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind"); | 5548 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind"); |
5568 } | 5549 } |
5569 | 5550 |
5570 /** | |
5571 * Construct from an analyzer engine element kind. | |
5572 */ | |
5573 factory CompletionSuggestionKind.fromElementKind(engine.ElementKind kind) => | |
5574 _completionSuggestionKindFromElementKind(kind); | |
5575 | |
5576 @override | 5551 @override |
5577 String toString() => "CompletionSuggestionKind.$name"; | 5552 String toString() => "CompletionSuggestionKind.$name"; |
5578 | 5553 |
5579 String toJson() => name; | 5554 String toJson() => name; |
5580 } | 5555 } |
5581 | 5556 |
5582 /** | 5557 /** |
5583 * Element | 5558 * Element |
5584 * | 5559 * |
5585 * { | 5560 * { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5689 String returnType; | 5664 String returnType; |
5690 if (json.containsKey("returnType")) { | 5665 if (json.containsKey("returnType")) { |
5691 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | 5666 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); |
5692 } | 5667 } |
5693 return new Element(kind, name, flags, location: location, parameters: para
meters, returnType: returnType); | 5668 return new Element(kind, name, flags, location: location, parameters: para
meters, returnType: returnType); |
5694 } else { | 5669 } else { |
5695 throw jsonDecoder.mismatch(jsonPath, "Element"); | 5670 throw jsonDecoder.mismatch(jsonPath, "Element"); |
5696 } | 5671 } |
5697 } | 5672 } |
5698 | 5673 |
5699 /** | |
5700 * Construct based on a value from the analyzer engine. | |
5701 */ | |
5702 factory Element.fromEngine(engine.Element element) => | |
5703 elementFromEngine(element); | |
5704 | |
5705 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0; | 5674 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0; |
5706 bool get isConst => (flags & FLAG_CONST) != 0; | 5675 bool get isConst => (flags & FLAG_CONST) != 0; |
5707 bool get isFinal => (flags & FLAG_FINAL) != 0; | 5676 bool get isFinal => (flags & FLAG_FINAL) != 0; |
5708 bool get isStatic => (flags & FLAG_STATIC) != 0; | 5677 bool get isStatic => (flags & FLAG_STATIC) != 0; |
5709 bool get isPrivate => (flags & FLAG_PRIVATE) != 0; | 5678 bool get isPrivate => (flags & FLAG_PRIVATE) != 0; |
5710 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; | 5679 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; |
5711 | 5680 |
5712 Map<String, dynamic> toJson() { | 5681 Map<String, dynamic> toJson() { |
5713 Map<String, dynamic> result = {}; | 5682 Map<String, dynamic> result = {}; |
5714 result["kind"] = kind.toJson(); | 5683 result["kind"] = kind.toJson(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5765 * CONSTRUCTOR | 5734 * CONSTRUCTOR |
5766 * FIELD | 5735 * FIELD |
5767 * FUNCTION | 5736 * FUNCTION |
5768 * FUNCTION_TYPE_ALIAS | 5737 * FUNCTION_TYPE_ALIAS |
5769 * GETTER | 5738 * GETTER |
5770 * LABEL | 5739 * LABEL |
5771 * LIBRARY | 5740 * LIBRARY |
5772 * LOCAL_VARIABLE | 5741 * LOCAL_VARIABLE |
5773 * METHOD | 5742 * METHOD |
5774 * PARAMETER | 5743 * PARAMETER |
5775 * PREFIX | |
5776 * SETTER | 5744 * SETTER |
5777 * TOP_LEVEL_VARIABLE | 5745 * TOP_LEVEL_VARIABLE |
5778 * TYPE_PARAMETER | 5746 * TYPE_PARAMETER |
5779 * UNIT_TEST_GROUP | 5747 * UNIT_TEST_GROUP |
5780 * UNIT_TEST_TEST | 5748 * UNIT_TEST_TEST |
5781 * UNKNOWN | 5749 * UNKNOWN |
5782 * } | 5750 * } |
5783 */ | 5751 */ |
5784 class ElementKind { | 5752 class ElementKind { |
5785 static const CLASS = const ElementKind._("CLASS"); | 5753 static const CLASS = const ElementKind._("CLASS"); |
(...skipping 15 matching lines...) Expand all Loading... |
5801 static const LABEL = const ElementKind._("LABEL"); | 5769 static const LABEL = const ElementKind._("LABEL"); |
5802 | 5770 |
5803 static const LIBRARY = const ElementKind._("LIBRARY"); | 5771 static const LIBRARY = const ElementKind._("LIBRARY"); |
5804 | 5772 |
5805 static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE"); | 5773 static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE"); |
5806 | 5774 |
5807 static const METHOD = const ElementKind._("METHOD"); | 5775 static const METHOD = const ElementKind._("METHOD"); |
5808 | 5776 |
5809 static const PARAMETER = const ElementKind._("PARAMETER"); | 5777 static const PARAMETER = const ElementKind._("PARAMETER"); |
5810 | 5778 |
5811 static const PREFIX = const ElementKind._("PREFIX"); | |
5812 | |
5813 static const SETTER = const ElementKind._("SETTER"); | 5779 static const SETTER = const ElementKind._("SETTER"); |
5814 | 5780 |
5815 static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE"); | 5781 static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE"); |
5816 | 5782 |
5817 static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER"); | 5783 static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER"); |
5818 | 5784 |
5819 static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP"); | 5785 static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP"); |
5820 | 5786 |
5821 static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST"); | 5787 static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST"); |
5822 | 5788 |
(...skipping 24 matching lines...) Expand all Loading... |
5847 case "LABEL": | 5813 case "LABEL": |
5848 return LABEL; | 5814 return LABEL; |
5849 case "LIBRARY": | 5815 case "LIBRARY": |
5850 return LIBRARY; | 5816 return LIBRARY; |
5851 case "LOCAL_VARIABLE": | 5817 case "LOCAL_VARIABLE": |
5852 return LOCAL_VARIABLE; | 5818 return LOCAL_VARIABLE; |
5853 case "METHOD": | 5819 case "METHOD": |
5854 return METHOD; | 5820 return METHOD; |
5855 case "PARAMETER": | 5821 case "PARAMETER": |
5856 return PARAMETER; | 5822 return PARAMETER; |
5857 case "PREFIX": | |
5858 return PREFIX; | |
5859 case "SETTER": | 5823 case "SETTER": |
5860 return SETTER; | 5824 return SETTER; |
5861 case "TOP_LEVEL_VARIABLE": | 5825 case "TOP_LEVEL_VARIABLE": |
5862 return TOP_LEVEL_VARIABLE; | 5826 return TOP_LEVEL_VARIABLE; |
5863 case "TYPE_PARAMETER": | 5827 case "TYPE_PARAMETER": |
5864 return TYPE_PARAMETER; | 5828 return TYPE_PARAMETER; |
5865 case "UNIT_TEST_GROUP": | 5829 case "UNIT_TEST_GROUP": |
5866 return UNIT_TEST_GROUP; | 5830 return UNIT_TEST_GROUP; |
5867 case "UNIT_TEST_TEST": | 5831 case "UNIT_TEST_TEST": |
5868 return UNIT_TEST_TEST; | 5832 return UNIT_TEST_TEST; |
5869 case "UNKNOWN": | 5833 case "UNKNOWN": |
5870 return UNKNOWN; | 5834 return UNKNOWN; |
5871 } | 5835 } |
5872 throw new Exception('Illegal enum value: $name'); | 5836 throw new Exception('Illegal enum value: $name'); |
5873 } | 5837 } |
5874 | 5838 |
5875 factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | 5839 factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { |
5876 if (json is String) { | 5840 if (json is String) { |
5877 try { | 5841 try { |
5878 return new ElementKind(json); | 5842 return new ElementKind(json); |
5879 } catch(_) { | 5843 } catch(_) { |
5880 // Fall through | 5844 // Fall through |
5881 } | 5845 } |
5882 } | 5846 } |
5883 throw jsonDecoder.mismatch(jsonPath, "ElementKind"); | 5847 throw jsonDecoder.mismatch(jsonPath, "ElementKind"); |
5884 } | 5848 } |
5885 | 5849 |
5886 /** | |
5887 * Construct based on a value from the analyzer engine. | |
5888 */ | |
5889 factory ElementKind.fromEngine(engine.ElementKind kind) => | |
5890 _elementKindFromEngine(kind); | |
5891 | |
5892 @override | 5850 @override |
5893 String toString() => "ElementKind.$name"; | 5851 String toString() => "ElementKind.$name"; |
5894 | 5852 |
5895 String toJson() => name; | 5853 String toJson() => name; |
5896 } | 5854 } |
5897 | 5855 |
5898 /** | 5856 /** |
5899 * ExecutableFile | 5857 * ExecutableFile |
5900 * | 5858 * |
5901 * { | 5859 * { |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7020 startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["st
artColumn"]); | 6978 startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["st
artColumn"]); |
7021 } else { | 6979 } else { |
7022 throw jsonDecoder.missingKey(jsonPath, "startColumn"); | 6980 throw jsonDecoder.missingKey(jsonPath, "startColumn"); |
7023 } | 6981 } |
7024 return new Location(file, offset, length, startLine, startColumn); | 6982 return new Location(file, offset, length, startLine, startColumn); |
7025 } else { | 6983 } else { |
7026 throw jsonDecoder.mismatch(jsonPath, "Location"); | 6984 throw jsonDecoder.mismatch(jsonPath, "Location"); |
7027 } | 6985 } |
7028 } | 6986 } |
7029 | 6987 |
7030 /** | |
7031 * Create a Location based on an [engine.Element]. | |
7032 */ | |
7033 factory Location.fromElement(engine.Element element) => | |
7034 _locationFromElement(element); | |
7035 | |
7036 /** | |
7037 * Create a Location based on an [engine.SearchMatch]. | |
7038 */ | |
7039 factory Location.fromMatch(engine.SearchMatch match) => | |
7040 _locationFromMatch(match); | |
7041 | |
7042 /** | |
7043 * Create a Location based on an [engine.AstNode]. | |
7044 */ | |
7045 factory Location.fromNode(engine.AstNode node) => | |
7046 _locationFromNode(node); | |
7047 | |
7048 /** | |
7049 * Create a Location based on an [engine.CompilationUnit]. | |
7050 */ | |
7051 factory Location.fromUnit(engine.CompilationUnit unit, engine.SourceRange rang
e) => | |
7052 _locationFromUnit(unit, range); | |
7053 | |
7054 Map<String, dynamic> toJson() { | 6988 Map<String, dynamic> toJson() { |
7055 Map<String, dynamic> result = {}; | 6989 Map<String, dynamic> result = {}; |
7056 result["file"] = file; | 6990 result["file"] = file; |
7057 result["offset"] = offset; | 6991 result["offset"] = offset; |
7058 result["length"] = length; | 6992 result["length"] = length; |
7059 result["startLine"] = startLine; | 6993 result["startLine"] = startLine; |
7060 result["startColumn"] = startColumn; | 6994 result["startColumn"] = startColumn; |
7061 return result; | 6995 return result; |
7062 } | 6996 } |
7063 | 6997 |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7524 className = jsonDecoder._decodeString(jsonPath + ".className", json["cla
ssName"]); | 7458 className = jsonDecoder._decodeString(jsonPath + ".className", json["cla
ssName"]); |
7525 } else { | 7459 } else { |
7526 throw jsonDecoder.missingKey(jsonPath, "className"); | 7460 throw jsonDecoder.missingKey(jsonPath, "className"); |
7527 } | 7461 } |
7528 return new OverriddenMember(element, className); | 7462 return new OverriddenMember(element, className); |
7529 } else { | 7463 } else { |
7530 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember"); | 7464 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember"); |
7531 } | 7465 } |
7532 } | 7466 } |
7533 | 7467 |
7534 /** | |
7535 * Construct based on an element from the analyzer engine. | |
7536 */ | |
7537 factory OverriddenMember.fromEngine(engine.Element member) => | |
7538 _overriddenMemberFromEngine(member); | |
7539 | |
7540 Map<String, dynamic> toJson() { | 7468 Map<String, dynamic> toJson() { |
7541 Map<String, dynamic> result = {}; | 7469 Map<String, dynamic> result = {}; |
7542 result["element"] = element.toJson(); | 7470 result["element"] = element.toJson(); |
7543 result["className"] = className; | 7471 result["className"] = className; |
7544 return result; | 7472 return result; |
7545 } | 7473 } |
7546 | 7474 |
7547 @override | 7475 @override |
7548 String toString() => JSON.encode(toJson()); | 7476 String toString() => JSON.encode(toJson()); |
7549 | 7477 |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8424 path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String
jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json)); | 8352 path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String
jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json)); |
8425 } else { | 8353 } else { |
8426 throw jsonDecoder.missingKey(jsonPath, "path"); | 8354 throw jsonDecoder.missingKey(jsonPath, "path"); |
8427 } | 8355 } |
8428 return new SearchResult(location, kind, isPotential, path); | 8356 return new SearchResult(location, kind, isPotential, path); |
8429 } else { | 8357 } else { |
8430 throw jsonDecoder.mismatch(jsonPath, "SearchResult"); | 8358 throw jsonDecoder.mismatch(jsonPath, "SearchResult"); |
8431 } | 8359 } |
8432 } | 8360 } |
8433 | 8361 |
8434 /** | |
8435 * Construct based on a value from the search engine. | |
8436 */ | |
8437 factory SearchResult.fromMatch(engine.SearchMatch match) => | |
8438 searchResultFromMatch(match); | |
8439 | |
8440 Map<String, dynamic> toJson() { | 8362 Map<String, dynamic> toJson() { |
8441 Map<String, dynamic> result = {}; | 8363 Map<String, dynamic> result = {}; |
8442 result["location"] = location.toJson(); | 8364 result["location"] = location.toJson(); |
8443 result["kind"] = kind.toJson(); | 8365 result["kind"] = kind.toJson(); |
8444 result["isPotential"] = isPotential; | 8366 result["isPotential"] = isPotential; |
8445 result["path"] = path.map((Element value) => value.toJson()).toList(); | 8367 result["path"] = path.map((Element value) => value.toJson()).toList(); |
8446 return result; | 8368 return result; |
8447 } | 8369 } |
8448 | 8370 |
8449 @override | 8371 @override |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8549 if (json is String) { | 8471 if (json is String) { |
8550 try { | 8472 try { |
8551 return new SearchResultKind(json); | 8473 return new SearchResultKind(json); |
8552 } catch(_) { | 8474 } catch(_) { |
8553 // Fall through | 8475 // Fall through |
8554 } | 8476 } |
8555 } | 8477 } |
8556 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind"); | 8478 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind"); |
8557 } | 8479 } |
8558 | 8480 |
8559 /** | |
8560 * Construct based on a value from the search engine. | |
8561 */ | |
8562 factory SearchResultKind.fromEngine(engine.MatchKind kind) => | |
8563 _searchResultKindFromEngine(kind); | |
8564 | |
8565 @override | 8481 @override |
8566 String toString() => "SearchResultKind.$name"; | 8482 String toString() => "SearchResultKind.$name"; |
8567 | 8483 |
8568 String toJson() => name; | 8484 String toJson() => name; |
8569 } | 8485 } |
8570 | 8486 |
8571 /** | 8487 /** |
8572 * ServerService | 8488 * ServerService |
8573 * | 8489 * |
8574 * enum { | 8490 * enum { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8692 return result; | 8608 return result; |
8693 } | 8609 } |
8694 | 8610 |
8695 /** | 8611 /** |
8696 * Adds [edit] to the [FileEdit] for the given [file]. | 8612 * Adds [edit] to the [FileEdit] for the given [file]. |
8697 */ | 8613 */ |
8698 void addEdit(String file, int fileStamp, SourceEdit edit) => | 8614 void addEdit(String file, int fileStamp, SourceEdit edit) => |
8699 _addEditToSourceChange(this, file, fileStamp, edit); | 8615 _addEditToSourceChange(this, file, fileStamp, edit); |
8700 | 8616 |
8701 /** | 8617 /** |
8702 * Adds [edit] to the [FileEdit] for the given [source]. | |
8703 */ | |
8704 void addSourceEdit(engine.AnalysisContext context, | |
8705 engine.Source source, SourceEdit edit) => | |
8706 _addSourceEditToSourceChange(this, context, source, edit); | |
8707 | |
8708 /** | |
8709 * Adds [edit] to the [FileEdit] for the given [element]. | |
8710 */ | |
8711 void addElementEdit(engine.Element element, SourceEdit edit) => | |
8712 _addElementEditToSourceChange(this, element, edit); | |
8713 | |
8714 /** | |
8715 * Adds the given [FileEdit]. | 8618 * Adds the given [FileEdit]. |
8716 */ | 8619 */ |
8717 void addFileEdit(SourceFileEdit edit) { | 8620 void addFileEdit(SourceFileEdit edit) { |
8718 edits.add(edit); | 8621 edits.add(edit); |
8719 } | 8622 } |
8720 | 8623 |
8721 /** | 8624 /** |
8722 * Adds the given [LinkedEditGroup]. | 8625 * Adds the given [LinkedEditGroup]. |
8723 */ | 8626 */ |
8724 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) { | 8627 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8830 if (json.containsKey("id")) { | 8733 if (json.containsKey("id")) { |
8831 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | 8734 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); |
8832 } | 8735 } |
8833 return new SourceEdit(offset, length, replacement, id: id); | 8736 return new SourceEdit(offset, length, replacement, id: id); |
8834 } else { | 8737 } else { |
8835 throw jsonDecoder.mismatch(jsonPath, "SourceEdit"); | 8738 throw jsonDecoder.mismatch(jsonPath, "SourceEdit"); |
8836 } | 8739 } |
8837 } | 8740 } |
8838 | 8741 |
8839 /** | 8742 /** |
8840 * Construct based on a SourceRange. | |
8841 */ | |
8842 SourceEdit.range(engine.SourceRange range, String replacement, {String id}) | |
8843 : this(range.offset, range.length, replacement, id: id); | |
8844 | |
8845 /** | |
8846 * The end of the region to be modified. | 8743 * The end of the region to be modified. |
8847 */ | 8744 */ |
8848 int get end => offset + length; | 8745 int get end => offset + length; |
8849 | 8746 |
8850 Map<String, dynamic> toJson() { | 8747 Map<String, dynamic> toJson() { |
8851 Map<String, dynamic> result = {}; | 8748 Map<String, dynamic> result = {}; |
8852 result["offset"] = offset; | 8749 result["offset"] = offset; |
8853 result["length"] = length; | 8750 result["length"] = length; |
8854 result["replacement"] = replacement; | 8751 result["replacement"] = replacement; |
8855 if (id != null) { | 8752 if (id != null) { |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10117 return false; | 10014 return false; |
10118 } | 10015 } |
10119 | 10016 |
10120 @override | 10017 @override |
10121 int get hashCode { | 10018 int get hashCode { |
10122 int hash = 0; | 10019 int hash = 0; |
10123 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 10020 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
10124 return _JenkinsSmiHash.finish(hash); | 10021 return _JenkinsSmiHash.finish(hash); |
10125 } | 10022 } |
10126 } | 10023 } |
OLD | NEW |