Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[proto]: Importing the proto file in VSCode got not found error by IDE

Simply I have these directories

enter image description here

in proof.proto I am importing the common_message.proto to be able to use the predefined message and Everything works fine -> [compiling proto files with no problem]

but the only thing that annoys me is that my vs-code always show this to me

enter image description here

and I am using the

enter image description here

as my linter extension

NOTE: that I am compiling proto files with protoc with no problems the importation has no errors (all good) but the error on IDE kinda annoy me

I want to know that if there is a way that I can get rid of the error?

THANK YOU

like image 335
Thiti-Dev Avatar asked Nov 19 '25 10:11

Thiti-Dev


1 Answers

You can solve the problem by set up "protoc" options.

Go into settings > Extensions > vscode-proto3 configuration and then click Edit in settings.json. (you can just edit .vscode/settings.json too.)

After that, give --proto_path options like below codes.

{
    "protoc": {
        "options": [
            "--proto_path=<path of your proto files>"
        ]
    }
}
like image 145
jaylee Avatar answered Nov 22 '25 01:11

jaylee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!