GEBIT / protobuf-dt

A plugin for Eclipse to edit Protocol Buffer (.proto) files
https://marketplace.eclipse.org/content/protocol-buffer-editor
Eclipse Public License 1.0
5 stars 2 forks source link

The editor should scan project dependencies for *.proto files #1

Closed GVladi closed 3 months ago

GVladi commented 5 months ago

The editor already supports importing of well-known protobuf types, like google.protobuf.Any:

import "google/protobuf/any.proto";
...
google.protobuf.Any some_value = 1;

as the plugin contains the proto files with the well-known Protobuf types.

The editor should also support importing of any other proto files. It should scan the project dependencies (scope compile?) for *.proto files. For instance, the com.google.api.grpc:proto-google-common-protos JAR brings proto files for the google.type.Decimal type.

The IntelliJ Protobuf Editor generates proto_path arguments as follows:

... --proto_path /home/me/.m2/repository/com/google/api/grpc/proto-google-common-protos/2.39.1/proto-google-common-protos-2.39.1.jar!/
S1artie commented 3 months ago

This was implemented in release 2.5.0

alerosmile commented 3 months ago

@S1artie How is this supposed to work? I have a Maven project (containing proto files only) with com.google.api.grpc:proto-google-common-protos as a dependency but import "google/api/annotations.proto" is not resolved.

S1artie commented 3 months ago

@alerosmile You were right, the scan did only cover "direct" dependencies, but did not include dependencies within dependency containers, which is how Maven dependencies are managed. Sorry about that! It was fixed now in version 2.5.3, in my tests, Maven dependencies did now import correctly as well.

alerosmile commented 3 months ago

@S1artie Thanks a lot! Works for me now.