ksprojects / protobuf-jetbrains-plugin

Protobuf Support for JetBrains IDEs
https://plugins.jetbrains.com/plugin/8277
Apache License 2.0
259 stars 46 forks source link

Unresolved custom option reference #130

Closed kshchepanovskyi closed 5 years ago

kshchepanovskyi commented 5 years ago

Describe the bug Custom options cannot be resolved if they are defined in other file, and file that uses them also imports google/protobuf/descriptor.proto.

To Reproduce

a.proto

syntax = "proto2";

import "google/protobuf/descriptor.proto";

extend google.protobuf.FieldOptions {
    // Sensitive data setting, used in toString() generator.
    optional string sensitivity = 52003;
}

b.proto

syntax = "proto3";

import "a.proto";
import "google/protobuf/descriptor.proto"; // if this line is commented out, everything works

message Test {
   string sessionToken = 6 [(pt.live.sensitivity) = "token"]; // sensitivity is not resolved
}

Expected behavior Custom options should be properly resolved.

Plugin (please complete the following information):