visual-studio-codeprotocol-buffersproto

[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


Solution

  • 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>"
            ]
        }
    }