| 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 library protocol; | 5 library protocol; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/computer/element.dart' show | 10 import 'package:analysis_server/src/computer/element.dart' show |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 int index = 0; | 61 int index = 0; |
| 62 while (index < edits.length && edits[index].offset > sourceEdit.offset) { | 62 while (index < edits.length && edits[index].offset > sourceEdit.offset) { |
| 63 index++; | 63 index++; |
| 64 } | 64 } |
| 65 edits.insert(index, sourceEdit); | 65 edits.insert(index, sourceEdit); |
| 66 } | 66 } |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Adds [edit] to the [FileEdit] for the given [file]. | 69 * Adds [edit] to the [FileEdit] for the given [file]. |
| 70 */ | 70 */ |
| 71 void _addEditToSourceChange(SourceChange change, String file, SourceEdit edit) { | 71 void _addEditToSourceChange(SourceChange change, String file, int fileStamp, |
| 72 SourceEdit edit) { |
| 72 SourceFileEdit fileEdit = change.getFileEdit(file); | 73 SourceFileEdit fileEdit = change.getFileEdit(file); |
| 73 if (fileEdit == null) { | 74 if (fileEdit == null) { |
| 74 fileEdit = new SourceFileEdit(file); | 75 fileEdit = new SourceFileEdit(file, fileStamp); |
| 75 change.addFileEdit(fileEdit); | 76 change.addFileEdit(fileEdit); |
| 76 } | 77 } |
| 77 fileEdit.add(edit); | 78 fileEdit.add(edit); |
| 78 } | 79 } |
| 79 | 80 |
| 80 /** | 81 /** |
| 81 * Create an AnalysisError based on error information from the analyzer | 82 * Create an AnalysisError based on error information from the analyzer |
| 82 * engine. Access via AnalysisError.fromEngine(). | 83 * engine. Access via AnalysisError.fromEngine(). |
| 83 */ | 84 */ |
| 84 AnalysisError _analysisErrorFromEngine(engine.LineInfo lineInfo, | 85 AnalysisError _analysisErrorFromEngine(engine.LineInfo lineInfo, |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); | 1011 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
| 1011 hash = hash ^ (hash >> 11); | 1012 hash = hash ^ (hash >> 11); |
| 1012 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); | 1013 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
| 1013 } | 1014 } |
| 1014 | 1015 |
| 1015 static int hash2(a, b) => finish(combine(combine(0, a), b)); | 1016 static int hash2(a, b) => finish(combine(combine(0, a), b)); |
| 1016 | 1017 |
| 1017 static int hash4(a, b, c, d) => | 1018 static int hash4(a, b, c, d) => |
| 1018 finish(combine(combine(combine(combine(0, a), b), c), d)); | 1019 finish(combine(combine(combine(combine(0, a), b), c), d)); |
| 1019 } | 1020 } |
| OLD | NEW |