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

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

Issue 1044463004: Gracefully degrade if no source for completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Gracefully degrade if no source for completion Created 5 years, 8 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
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 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 part 'generated_protocol.dart'; 10 part 'generated_protocol.dart';
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 "Unanalyzed files cannot be a priority: '$fileNames'")); 819 "Unanalyzed files cannot be a priority: '$fileNames'"));
820 820
821 /** 821 /**
822 * Initialize a newly created instance to represent an error condition caused 822 * Initialize a newly created instance to represent an error condition caused
823 * by a [request] that cannot be handled by any known handlers. 823 * by a [request] that cannot be handled by any known handlers.
824 */ 824 */
825 Response.unknownRequest(Request request) : this(request.id, 825 Response.unknownRequest(Request request) : this(request.id,
826 error: new RequestError( 826 error: new RequestError(
827 RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request')); 827 RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request'));
828 828
829 /**
830 * Initialize a newly created instance to represent an error condition caused
831 * by a [request] referencing a source that does not exist.
832 */
833 Response.unknownSource(Request request) : this(request.id,
834 error: new RequestError(
835 RequestErrorCode.UNKNOWN_SOURCE, 'Unknown source'));
836
829 Response.unsupportedFeature(String requestId, String message) : this( 837 Response.unsupportedFeature(String requestId, String message) : this(
830 requestId, 838 requestId,
831 error: new RequestError( 839 error: new RequestError(
832 RequestErrorCode.UNSUPPORTED_FEATURE, message)); 840 RequestErrorCode.UNSUPPORTED_FEATURE, message));
833 841
834 /** 842 /**
835 * Return a table representing the structure of the Json object that will be 843 * Return a table representing the structure of the Json object that will be
836 * sent to the client to represent this response. 844 * sent to the client to represent this response.
837 */ 845 */
838 Map<String, Object> toJson() { 846 Map<String, Object> toJson() {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 893 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
886 hash = hash ^ (hash >> 11); 894 hash = hash ^ (hash >> 11);
887 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 895 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
888 } 896 }
889 897
890 static int hash2(a, b) => finish(combine(combine(0, a), b)); 898 static int hash2(a, b) => finish(combine(combine(0, a), b));
891 899
892 static int hash4(a, b, c, d) => 900 static int hash4(a, b, c, d) =>
893 finish(combine(combine(combine(combine(0, a), b), c), d)); 901 finish(combine(combine(combine(combine(0, a), b), c), d));
894 } 902 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698