VSCode doesn't seem to find generated code

In my project I use some SPM plugins to do code generation. Specifically I am using protobuf, grpc and a custom code generator.

Now this works well when building or when I open the project in Xcode. However, it does not work in VScode:

When I build in VSCode I don't get errors, it seems that sourcekit-lsp isn't able to find this though? Is there a way to teach the extension to also look for files in .build/plugin/outputs?

I have seen this as well, when implementing the Soto Code Generator build plugin. Although it stopped happening after a while and I'm not sure why. Because I couldn't replicate it, I didn't bug it. If you have a solid repo, please add a bug to the SourceKit-LSP repository.

No chance it fixes itself after a restart of VSCode or running command Developer: Reload Window?

I have seen other issues with build plugins where SourceKit-LSP seems to interfere with the build process. Generated symbols are not being linked with the final target. See SourceKit-LSP appears to interfere with SwiftPM build plugins · Issue #676 · apple/sourcekit-lsp · GitHub.

Thanks. I tried reloading and restarts multiple times without success. For me it's also very easy to reproduce: I created a small example project that reproduces this problem consistently on my side.

The reason I didn't file an issue yet is because I am not sure whether this is a bug or a me-problem (as: maybe I need to configure lsp somehow so that it looks into the build folder?).

I'll create a GH issue with my reproduction. I assume that protobuf and grpc are quite commonly used, so this should be kind of an important use case. For now I am probably going to stick to Xcode :cry:

Edit: seems there's already an open issue -- I'll comment on that