ksprojects/protobuf-jetbrains-plugin

Top level options with message fields incorrectly report syntax errors

eliaperantoni opened this issue · 2 comments

Describe the bug
A top level option statement of message type, that has a nested message field, will report various errors, depending on how you place semicolons.
This happens even though the protobuf compiler is able to compile.

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repo https://github.com/grpc-ecosystem/grpc-gateway
  2. Add import paths for the repo root folder and the third_party/googleapis subdirectory
  3. Create a protobuf file with this content:
syntax = "proto3";
package proto;

import "protoc-gen-swagger/options/annotations.proto";

option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
    info: {
        title: "MySite";
        description: "MySite REST API";
        version: "x.y.z";
    };
    host: "mysite";
    base_path: "/grpc";
};

Expected behavior
No errors reported as the file can compile just fine (protobuf.js also works)

Screenshots
bug

Plugin (please complete the following information):

  • OS: Manjaro x64
  • Plugin version: 0.13.0
  • IDE: GoLand 2019.3.2

Additional context
I found out that this

option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
    host: "onocontroller:7576"
    base_path: "/grpc"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger).info = {
    title: "ONO"
    description: "ONO Lean Logistics REST API"
    version: "x.y.z"
};

has the same effect but does not trigger any syntax error.

Same as #143.

Sorry, tried searching but didn't found anything similar :/