Skip to content

Commit 0662a87

Browse files
DanTupCommit Queue
authored and
Commit Queue
committed
[beta] [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods
This avoids accidentally using the converter when talking to plugins, (at least for now) URIs are never expected, and file paths should always be used regardless of which mode the server is in. This unfortunately touches a _lot_ of code, so I've pushed in many separate patch sets to Gerrit. Fixes Dart-Code/Dart-Code#5156 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/373745 Cherry-pick-request: #56126 Change-Id: I93a47ccc5f5e6ee9d9402938acf47590e140f49d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374361 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent bccfb95 commit 0662a87

File tree

128 files changed

+6214
-3972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6214
-3972
lines changed

Diff for: pkg/analysis_server/benchmark/integration/input_converter.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ abstract class CommonInputConverter extends Converter<String, Operation?> {
9494
// Track overlays in parallel with the analysis server
9595
// so that when an overlay is removed, the file can be updated on disk
9696
var request = Request.fromJson(json)!;
97-
var params = AnalysisUpdateContentParams.fromRequest(request);
97+
var params = AnalysisUpdateContentParams.fromRequest(request,
98+
clientUriConverter: null);
9899
params.files.forEach((String filePath, change) {
99100
if (change is AddContentOverlay) {
100101
var content = change.content;

Diff for: pkg/analysis_server/lib/protocol/protocol.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class Response extends RequestOrResponse {
517517
jsonObject[ID] = id;
518518
var error = this.error;
519519
if (error != null) {
520-
jsonObject[ERROR] = error.toJson();
520+
jsonObject[ERROR] = error.toJson(clientUriConverter: null);
521521
}
522522
var result = this.result;
523523
if (result != null) {
@@ -537,8 +537,9 @@ class Response extends RequestOrResponse {
537537
RequestError? decodedError;
538538
var error = json[Response.ERROR];
539539
if (error is Map) {
540-
decodedError =
541-
RequestError.fromJson(ResponseDecoder(null), '.error', error);
540+
decodedError = RequestError.fromJson(
541+
ResponseDecoder(null), '.error', error,
542+
clientUriConverter: null);
542543
}
543544

544545
Map<String, Object?>? decodedResult;

0 commit comments

Comments
 (0)