Setup lint for iOS
Summary: uncrustify was not recommended to add in xplat thus I have added clangformat for xplat/sonar/iOS Reviewed By: zertosh Differential Revision: D19879977 fbshipit-source-id: 76f6dadf5d55a61a5342802cfde2821cbff38525
This commit is contained in:
committed by
Facebook Github Bot
parent
44f5e35675
commit
35ed3ce1a4
@@ -11,13 +11,12 @@
|
|||||||
|
|
||||||
#import "FlipperCppBridgingResponder.h"
|
#import "FlipperCppBridgingResponder.h"
|
||||||
|
|
||||||
@implementation FlipperCppBridgingConnection
|
@implementation FlipperCppBridgingConnection {
|
||||||
{
|
|
||||||
std::shared_ptr<facebook::flipper::FlipperConnection> conn_;
|
std::shared_ptr<facebook::flipper::FlipperConnection> conn_;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::flipper::FlipperConnection>)conn
|
- (instancetype)initWithCppConnection:
|
||||||
{
|
(std::shared_ptr<facebook::flipper::FlipperConnection>)conn {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
conn_ = conn;
|
conn_ = conn;
|
||||||
}
|
}
|
||||||
@@ -26,19 +25,24 @@
|
|||||||
|
|
||||||
#pragma mark - SonarConnection
|
#pragma mark - SonarConnection
|
||||||
|
|
||||||
- (void)send:(NSString *)method withParams:(NSDictionary *)params
|
- (void)send:(NSString*)method withParams:(NSDictionary*)params {
|
||||||
{
|
conn_->send(
|
||||||
conn_->send([method UTF8String], facebook::cxxutils::convertIdToFollyDynamic(params, true));
|
[method UTF8String],
|
||||||
|
facebook::cxxutils::convertIdToFollyDynamic(params, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
|
- (void)receive:(NSString*)method withBlock:(SonarReceiver)receiver {
|
||||||
{
|
const auto lambda =
|
||||||
const auto lambda = [receiver](const folly::dynamic &message,
|
[receiver](
|
||||||
|
const folly::dynamic& message,
|
||||||
std::shared_ptr<facebook::flipper::FlipperResponder> responder) {
|
std::shared_ptr<facebook::flipper::FlipperResponder> responder) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
FlipperCppBridgingResponder* const objCResponder =
|
FlipperCppBridgingResponder* const objCResponder =
|
||||||
[[FlipperCppBridgingResponder alloc] initWithCppResponder:responder];
|
[[FlipperCppBridgingResponder alloc]
|
||||||
receiver(facebook::cxxutils::convertFollyDynamicToId(message), objCResponder);
|
initWithCppResponder:responder];
|
||||||
|
receiver(
|
||||||
|
facebook::cxxutils::convertFollyDynamicToId(message),
|
||||||
|
objCResponder);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
conn_->receive([method UTF8String], lambda);
|
conn_->receive([method UTF8String], lambda);
|
||||||
@@ -48,5 +52,4 @@
|
|||||||
conn_->error([message UTF8String], [stacktrace UTF8String]);
|
conn_->error([message UTF8String], [stacktrace UTF8String]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
typedef void (^SonarReceiver)(NSDictionary*, id<FlipperResponder>);
|
typedef void (^SonarReceiver)(NSDictionary*, id<FlipperResponder>);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Represents a connection between the Desktop and mobile plugins with corresponding identifiers.
|
Represents a connection between the Desktop and mobile plugins with
|
||||||
|
corresponding identifiers.
|
||||||
*/
|
*/
|
||||||
@protocol FlipperConnection
|
@protocol FlipperConnection
|
||||||
|
|
||||||
@@ -23,8 +24,8 @@ Invoke a method on the Sonar desktop plugin with with a matching identifier.
|
|||||||
- (void)send:(NSString*)method withParams:(NSDictionary*)params;
|
- (void)send:(NSString*)method withParams:(NSDictionary*)params;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Register a receiver to be notified of incoming calls of the given method from the Sonar desktop
|
Register a receiver to be notified of incoming calls of the given method from
|
||||||
plugin with a matching identifier.
|
the Sonar desktop plugin with a matching identifier.
|
||||||
*/
|
*/
|
||||||
- (void)receive:(NSString*)method withBlock:(SonarReceiver)receiver;
|
- (void)receive:(NSString*)method withBlock:(SonarReceiver)receiver;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user