Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor doesn't work if you have sub-packages of packages with 'code' #39

Open
Milraun opened this issue May 14, 2023 · 2 comments
Open

Comments

@Milraun
Copy link

Milraun commented May 14, 2023

Refactor generates invalid code if you have a package with code (proto-messages or enums) that has an sub-package.

You can create an repro by tweeking respose/helloworld of the test a bit:

syntax = "proto3";

import "grpc_build/response/sub.proto";

package grpc_build.response.helloworld;


// The response message containing the greetings
message HelloReply {
  string message = 1;
  grpc_build.response.helloworld.sub.SubEnum subEnum = 2;
}

the sub-package in the same directory is:

syntax = "proto3";

package grpc_build.response.helloworld.sub;

enum SubEnum {
  SUB = 0;
}

I'm new to Rust an can't fix it myself (for now). We have a big base of Proto-Models used for different languages, so that changing the protos is not an option.

Thx.

response.zip

@conradludgate
Copy link
Collaborator

Yeah I noticed that a while back. I got a bit too clever with the rewrite in 0.3 it seems 😓 I had an idea to fix it (by concatenating all the contents into a single file), but haven't had the time to plan it out

@tl-carlos-rosa
Copy link

I have a PR that should fix that #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants