vscode-proto3 icon indicating copy to clipboard operation
vscode-proto3 copied to clipboard

Can not jump into protobuf include proto file

Open elricli opened this issue 2 years ago • 3 comments

Can not jump into protobuf builtin proto file, Like:

import "google/protobuf/empty.proto";

Press F12 not working: No definition found for 'empty.proto'

Setting.json:

{
    "protoc": {
        "options": [
            "--proto_path=${workspaceRoot}/third_party",
            "--proto_path=D:\\protoc\\include",
        ],
    }
}

elricli avatar Oct 13 '21 04:10 elricli

Hi, did you ever find a solution to this? I am having the same issue.

lutherjohnrichards avatar Feb 08 '23 05:02 lutherjohnrichards

@elricli @lutherjohnrichards I'm also facing the same issue, did you fixed it for yourselves?

The best thing that worked for me was ln -s

Twizty avatar Aug 04 '23 07:08 Twizty

For those who is struggling with the same issue, I've found a workaround.

This extension checks only current vscode workspace for imports, so you can link your protobuf include directory (for me it is /opt/homebrew/Cellar/protobuf/23.4/include) to your workspace and it will resolve your imports.

My example: I have a gitignored vendor/ directory, so I ran ln -s /opt/homebrew/Cellar/protobuf/23.4/include/google vendor/google, and my imports are resolved.

This is a good place to improve the extension though, maybe I will add support of external directories once I have more spare time

Twizty avatar Aug 04 '23 07:08 Twizty