| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 if (jsonDecoder is ResponseDecoder) { | 411 if (jsonDecoder is ResponseDecoder) { |
| 412 requestId = jsonDecoder.response.id; | 412 requestId = jsonDecoder.response.id; |
| 413 } | 413 } |
| 414 RefactoringKind kind = REQUEST_ID_REFACTORING_KINDS.remove(requestId); | 414 RefactoringKind kind = REQUEST_ID_REFACTORING_KINDS.remove(requestId); |
| 415 if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { | 415 if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) { |
| 416 return new ExtractLocalVariableFeedback.fromJson(jsonDecoder, jsonPath, json
); | 416 return new ExtractLocalVariableFeedback.fromJson(jsonDecoder, jsonPath, json
); |
| 417 } | 417 } |
| 418 if (kind == RefactoringKind.EXTRACT_METHOD) { | 418 if (kind == RefactoringKind.EXTRACT_METHOD) { |
| 419 return new ExtractMethodFeedback.fromJson(jsonDecoder, jsonPath, json); | 419 return new ExtractMethodFeedback.fromJson(jsonDecoder, jsonPath, json); |
| 420 } | 420 } |
| 421 if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) { |
| 422 return new InlineLocalVariableFeedback.fromJson(jsonDecoder, jsonPath, json)
; |
| 423 } |
| 421 if (kind == RefactoringKind.RENAME) { | 424 if (kind == RefactoringKind.RENAME) { |
| 422 return new RenameFeedback.fromJson(jsonDecoder, jsonPath, json); | 425 return new RenameFeedback.fromJson(jsonDecoder, jsonPath, json); |
| 423 } | 426 } |
| 424 return null; | 427 return null; |
| 425 } | 428 } |
| 426 | 429 |
| 427 | 430 |
| 428 /** | 431 /** |
| 429 * Create a [RefactoringOptions] corresponding the given [kind]. | 432 * Create a [RefactoringOptions] corresponding the given [kind]. |
| 430 */ | 433 */ |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); | 1004 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
| 1002 hash = hash ^ (hash >> 11); | 1005 hash = hash ^ (hash >> 11); |
| 1003 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); | 1006 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
| 1004 } | 1007 } |
| 1005 | 1008 |
| 1006 static int hash2(a, b) => finish(combine(combine(0, a), b)); | 1009 static int hash2(a, b) => finish(combine(combine(0, a), b)); |
| 1007 | 1010 |
| 1008 static int hash4(a, b, c, d) => | 1011 static int hash4(a, b, c, d) => |
| 1009 finish(combine(combine(combine(combine(0, a), b), c), d)); | 1012 finish(combine(combine(combine(combine(0, a), b), c), d)); |
| 1010 } | 1013 } |
| OLD | NEW |