vscode-proto3
vscode-proto3 copied to clipboard
Import "foo/bar/msg.proto" was not found or had errors
I opened the example files: imports.proto. and then there went a wrong that Import "foo/bar/msg.proto" was not found or had errors. is it a bug?
I have the same issue, where the import path from the linter does not match the path required by protoc.
The linter checks from the root of the project Whereas protoc checks relative to the .proto file
Very confusing and frustrating to see errors (from the linter) when it is actually correct for the compiler.
Same for me. Compile works but errors shown
Also note that when include path is incorrect then no error is shown, but compile fails
The problem I reported above resolved itself after a VSC restart.
Have you tried adding proto_paths to vscode extension settings ?
"protoc": {
"options": [
"--proto_path=foo/bar"
]
}
cf https://github.com/zxh0/vscode-proto3#fields, quoting "protoc compiler arguments/flags, required for proto validation and compilation"