Arnavion/k8s-openapi

Types autocomplete and go-to-defenition are not working in IDEA Intellij

Closed this issue · 3 comments

Hey!
Not an issue, but I'm having struggles with autocomplete and go-to-defenition when trying to access something like k8s_openapi::api::core::v1::Pod. IDE just can't find sources after ::api::. IDE - Intellij IDEA.
Sorry to bother you, but I hope somebody had such experience and knows how to fix this.

So it can find api/mod.rs from ::api ? If so, then that means the version feature resolution at least is working correctly, ie it's not a situation like #52. So if it's able to get to api I can't think of anything obvious preventing it from finding core and onwards.

So, intellij-rust team helped me here: intellij-rust/intellij-rust#9093
They have experimental feature that can fix this issue:

Try to enable org.rust.cargo.evaluate.build.scripts experimental feature and reload project model via Refresh Cargo Projects action in Cargo tool window to make it work as expected

and it works :)

Well, I'm not sure I understand their investigation.

As I can see, k8s_openapi crate has a build script that generates some code. Build script support is not enabled by default yet in the plugin. It may lead to such issues since the plugin doesn't know about some sources.

The only code generated by the build script is the k8s_openapi_* macros. It doesn't affect api::core.

But if enabling that option works for you, I'm not going to argue.