Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion protoc_plugin/lib/protoc.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:convert';

import 'package:dart_style/dart_style.dart';
import 'package:protobuf/protobuf.dart';

import 'const_generator.dart' show writeJsonConst;
Expand Down
3 changes: 1 addition & 2 deletions protoc_plugin/lib/src/file_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
part of '../protoc.dart';

final _dartIdentifier = RegExp(r'^\w+$');
final _formatter = DartFormatter();
const String _convertImportPrefix = r'$convert';

const String _fixnumImportPrefix = r'$fixnum';
Expand Down Expand Up @@ -527,7 +526,7 @@ class FileGenerator extends ProtobufContainer {
generator.generate(out);
}

return _formatter.format(out.toString());
return out.toString();
}

void writeBinaryDescriptor(IndentingWriter out, String identifierName,
Expand Down
1 change: 0 additions & 1 deletion protoc_plugin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
fixnum: ^1.0.0
path: ^1.8.0
protobuf: ^2.0.0
dart_style: ^2.0.0

dev_dependencies:
test: ^1.16.0
Expand Down
38 changes: 13 additions & 25 deletions protoc_plugin/test/goldens/grpc_service.pbgrpc
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,22 @@ class TestClient extends $grpc.Client {
TestClient($grpc.ClientChannel channel,
{$grpc.CallOptions? options,
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
: super(channel, options: options, interceptors: interceptors);
: super(channel, options: options,
interceptors: interceptors);

$grpc.ResponseFuture<$0.Output> unary($0.Input request,
{$grpc.CallOptions? options}) {
$grpc.ResponseFuture<$0.Output> unary($0.Input request, {$grpc.CallOptions? options}) {
return $createUnaryCall(_$unary, request, options: options);
}

$grpc.ResponseFuture<$0.Output> clientStreaming(
$async.Stream<$0.Input> request,
{$grpc.CallOptions? options}) {
return $createStreamingCall(_$clientStreaming, request, options: options)
.single;
$grpc.ResponseFuture<$0.Output> clientStreaming($async.Stream<$0.Input> request, {$grpc.CallOptions? options}) {
return $createStreamingCall(_$clientStreaming, request, options: options).single;
}

$grpc.ResponseStream<$0.Output> serverStreaming($0.Input request,
{$grpc.CallOptions? options}) {
return $createStreamingCall(
_$serverStreaming, $async.Stream.fromIterable([request]),
options: options);
$grpc.ResponseStream<$0.Output> serverStreaming($0.Input request, {$grpc.CallOptions? options}) {
return $createStreamingCall(_$serverStreaming, $async.Stream.fromIterable([request]), options: options);
}

$grpc.ResponseStream<$0.Output> bidirectional($async.Stream<$0.Input> request,
{$grpc.CallOptions? options}) {
$grpc.ResponseStream<$0.Output> bidirectional($async.Stream<$0.Input> request, {$grpc.CallOptions? options}) {
return $createStreamingCall(_$bidirectional, request, options: options);
}
}
Expand Down Expand Up @@ -95,21 +88,16 @@ abstract class TestServiceBase extends $grpc.Service {
($0.Output value) => value.writeToBuffer()));
}

$async.Future<$0.Output> unary_Pre(
$grpc.ServiceCall call, $async.Future<$0.Input> request) async {
$async.Future<$0.Output> unary_Pre($grpc.ServiceCall call, $async.Future<$0.Input> request) async {
return unary(call, await request);
}

$async.Stream<$0.Output> serverStreaming_Pre(
$grpc.ServiceCall call, $async.Future<$0.Input> request) async* {
$async.Stream<$0.Output> serverStreaming_Pre($grpc.ServiceCall call, $async.Future<$0.Input> request) async* {
yield* serverStreaming(call, await request);
}

$async.Future<$0.Output> unary($grpc.ServiceCall call, $0.Input request);
$async.Future<$0.Output> clientStreaming(
$grpc.ServiceCall call, $async.Stream<$0.Input> request);
$async.Stream<$0.Output> serverStreaming(
$grpc.ServiceCall call, $0.Input request);
$async.Stream<$0.Output> bidirectional(
$grpc.ServiceCall call, $async.Stream<$0.Input> request);
$async.Future<$0.Output> clientStreaming($grpc.ServiceCall call, $async.Stream<$0.Input> request);
$async.Stream<$0.Output> serverStreaming($grpc.ServiceCall call, $0.Input request);
$async.Stream<$0.Output> bidirectional($grpc.ServiceCall call, $async.Stream<$0.Input> request);
}