Import external proto file Visual Studio Code error
Closed this issue · 4 comments
Hi @kroksys, thanks for filing this issue! Just as a heads-up, I transferred the issue to our vscode-buf
repository, since this is specific to the plugin.
In terms of the issue you're seeing, the vscode-buf
plugin uses our buf
CLI, specifically buf lint
, and since buf
has its own compiler, it does not take a direct dependency on protoc
, so it does not have the same settings or flags. In terms of your issue, I have a couple of questions regarding your setup:
- Do you currently have your import, in this case,
google/api/annotations.proto
, vendored or is this a part of a buf module? It may be helpful to provide your file and directory structure for your Protobuf files to help provide a bit more information here. - If this is a part of a buf module, have you configured the dependency as part of your
deps
(https://docs.buf.build/configuration/v1/buf-yaml#deps) and have you updated your dependencies/populated yourbuf.lock
usingbuf mod update
(https://docs.buf.build/tour/add-a-dependency#depend-on-googleapis)?
I am having this issue as well with google/type/interval.proto
. Here is my buf.yaml
version: v1
breaking:
use:
- FILE
lint:
use:
- MINIMAL
except:
- ENUM_VALUE_PREFIX
# Recommended best practice is to use the buf.yaml to configure files/rules that should be ignored.
# https://buf.build/docs/lint/overview/#allow_comment_ignores
allow_comment_ignores: false
rpc_allow_same_request_response: true
rpc_allow_google_protobuf_empty_requests: true
rpc_allow_google_protobuf_empty_responses: true
deps:
- buf.build/googleapis/googleapis:01f6828d2b8868fc9d314f9ac86677d3253fa33b
![Screenshot 2023-09-22 at 2 50 48 PM](https://private-user-images.githubusercontent.com/2791730/270031399-6ed5585f-cb56-4ceb-a07a-7fc2cf491c9b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzODczNDYsIm5iZiI6MTcyNTM4NzA0NiwicGF0aCI6Ii8yNzkxNzMwLzI3MDAzMTM5OS02ZWQ1NTg1Zi1jYjU2LTRjZWItYTA3YS03ZmMyY2Y0OTFjOWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhN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VhNmM0YTlhMDFlYWY5ZWI0ZDI4YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.X9vPNXc4lMKPPMWt75YZsR_SjCEAjWZtbFy6ukmnvqM)
Weirdly, buf build
and buf lint
seem to be okay with it?
@willsoto I was getting the exact same was not found or had errors
error and in my case it was from the vscode-proto3 extension, not from buf. Removing that extension gets rid of the errors.
Sounds like this has been resolved, so I'm going to close this issue. Feel free to re-open if I'm wrong!