Go to Definition doesn't work?
When I run the command "Go to definition", there are no results. There is a message below the search box that says, "The active editor does not provide symbol information".
Am I doing something wrong, or is there a setup step I missed, or do I misunderstand what "Go to Definition" means for this package?
vscode-pbkit 0.0.7v VS Code 1.85.2 Mac OS 14.1.2
Can you create a minimal reproducible repository so I can test it out?
@disjukr same problem on the latest versions of macos and vscode
@kononovk Was it working well before and then the problem occurred? Or did you just install it for the first time and it’s not working? Can you provide a repository link where I can reproduce the issue?
I just have installed it for the first time. The issue reproduce when the protobuf repository included in. main repo as a sumbodule an any proto files my file structure:
protos (submodule):
-- dir1
a.proto
-- dir2
b.proto
In the a.proto I created a proto-message that uses a type from b.proto and try to go to definition to this type.
Can you let me know what’s working and what’s not? Is 'Go to Definition' not working at all? I'm curious if 'Go to Definition' works within the same file, for example.
If it works within the same file but not when trying to go to a definition in another file, it might be because pbkit doesn’t know how to understand your project structure.
Check where the VSCode workspace root is and how the import statements are structured.
Since pbkit supports buf workspace, creating a buf.work.yaml file might solve the issue.
It doesn't work for me either. But I think it stopped working after we've migrated to buf.yaml v2 where the buf.work.yaml is no longer needed.
Buf now has a v2 configuration available, where this file is no longer used. See the v2 buf.yaml reference and the v1 to v2 migration guide for details about the new configuration and migration instructions.
EDIT: I did further testing and it only works within the same file, as in, if a struct is referenced within the same file it was defined. I'm not able to use "Go to Definition" over a type that's defined in another file.
Oh, thank you. I wasn't aware that buf config v2 had been released and that it had broken workspace backward compatibility. That seems to be the cause of the issue. I'll quickly try adding buf config v2 support to pbkit.
fixed at
- vscode-pbkit: v0.0.8
- pbkit: v0.0.72
https://github.com/pbkit/vscode-pbkit/commit/d27a69be600a92acd801e9ddaf6c2c8167df1af6