Visual Studio workspace-specific settings and proto path
I use Pbkit for Protobuf support. There are other extensions available.
I’d experienced problems with the tool when (correctly) import‘ing protobufs under a proto_path and learned that there’s a solution and also learned that it’s possible to use workspace-specific settings.
With a ${workspaceFolder}/protos folder containing:
protos
└── greet
├── v1
│ └── greet.proto
└── v2
└── greet.proto
And, in which protos/greet/v2/greet.proto contains:
import "greet/v1/greet.proto";
I had been receiving import and reference errors until I read the Stack overflow answer.
Now I’ve created .vscode/settings.json (workspace-specific settings) which is very useful:
{
"protoc": {
"options": [
"--proto_path=${workspaceFolder}/protos"
]
}
}