@@ -8,24 +8,38 @@ option (gogoproto.protosizer_all) = true;
88option (gogoproto.sizer_all ) = false ;
99option go_package = "protocol" ;
1010
11- // ParseUASTRequest is a request to parse a file and get its UAST.
12- message ParseUASTRequest {
11+ // ParseRequest is a request to parse a file and get its UAST.
12+ message ParseRequest {
1313 option (gogoproto.goproto_getters ) = false ;
1414 option (gogoproto.typedecl ) = false ;
1515 string filename = 1 ;
1616 string language = 2 ;
1717 string content = 3 ;
18+ github.com.bblfsh.sdk.protocol.Encoding encoding = 4 ;
1819}
1920
20- // ParseUASTResponse is the reply to ParseUASTRequest .
21- message ParseUASTResponse {
21+ // ParseResponse is the reply to ParseRequest .
22+ message ParseResponse {
2223 option (gogoproto.goproto_getters ) = false ;
2324 option (gogoproto.typedecl ) = false ;
2425 github.com.bblfsh.sdk.protocol.Status status = 1 ;
2526 repeated string errors = 2 ;
2627 github.com.bblfsh.sdk.uast.Node uast = 3 [(gogoproto.customname ) = "UAST" ];
2728}
2829
30+ // Encoding is the encoding used for the content string. Currently only
31+ // UTF-8 or Base64 encodings are supported. You should use UTF-8 if you can
32+ // and Base64 as a fallback.
33+ enum Encoding {
34+ option (gogoproto.enumdecl ) = false ;
35+ option (gogoproto.goproto_enum_prefix ) = false ;
36+ option (gogoproto.goproto_enum_stringer ) = false ;
37+ // UTF8 encoding
38+ UTF8 = 0 [(gogoproto.enumvalue_customname ) = "UTF8" ];
39+ // Base64 encoding
40+ BASE64 = 1 [(gogoproto.enumvalue_customname ) = "Base64" ];
41+ }
42+
2943// Status is the status of a response.
3044enum Status {
3145 option (gogoproto.enumdecl ) = false ;
@@ -40,7 +54,7 @@ enum Status {
4054}
4155
4256service ProtocolService {
43- // ParseUAST uses DefaultParser to process the given UAST parsing request.
44- rpc ParseUAST (github.com.bblfsh.sdk.protocol.ParseUASTRequest ) returns (github.com.bblfsh.sdk.protocol.ParseUASTResponse );
57+ // Parse uses DefaultParser to process the given parsing request to get the UAST .
58+ rpc Parse (github.com.bblfsh.sdk.protocol.ParseRequest ) returns (github.com.bblfsh.sdk.protocol.ParseResponse );
4559}
4660
0 commit comments