jvolkman / intellij-protobuf-editor

Protocol Buffers for IntelliJ-based IDEs
Apache License 2.0
122 stars 15 forks source link

Why plug cannot find this proto? #49

Closed Calo-go closed 3 years ago

Calo-go commented 3 years ago

Hey, Why plug cannot find this proto?

image

jvolkman commented 3 years ago

is proto configured as a source root?

Calo-go commented 3 years ago

is proto configured as a source root?

No. So relative paths don't work?

jvolkman commented 3 years ago

No. Protobuf in general doesn't support relative import paths.

Calo-go commented 3 years ago

I can generate echo.pb.go use the following commond in proto

protoc --go_out=plugins=grpc:. echo.proto

If I use this command as following: protoc --go_out=plugins=grpc:. ./proto/echo.proto It will tell me: google/api/annotations.proto: File not found.

My protoc's version islibprotoc 3.13.0

So can you set the current diretory as imports path by default,like protoc?

jvolkman commented 3 years ago

Right. protoc defaults its search path to the current working directory if you don't specify anything using the --proto_path parameter. Within the editor we don't have the same concept of a current working directory. It's not the same as the file's parent directory, as you found above with the 'File not found' message.

Calo-go commented 3 years ago

ok, get it, thank you.