-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bindings not found by intellisense/autocomplete #140
Comments
I have no experience with intellisense, rls and the likes so I don't know how to help. Perhaps asking around in the #rust irc channel will get you some answers. While I'm here, I want to point out that you don't have to import each gdnative_foo crate, you can instead just have a dependency on example:
Back to your original question, I'm thinking of removing the code generation from the build and just check the generated files in. The disadvantage is that contributors need to know that they have to run the generator and not modify the generated files. I think that this can be solved by a bit of documentation and checking in CI that the generator produces exactly what is checked in. The advantages are:
@karroffel what do you think? |
Ah, I had been confusing features with modules and wondering why I couldn't access anything under gdnative::editor. Another question. Is there a gdnative equivalent of the "tool" keyword used in gdscript to allow editor integration? If not, that's fine, as I can just use gdscript for working with EditorPlugin. I'm hoping that registering my custom AudioStream will automagically get it included as an option in the AudioStreamPlayer's list of stream options. Thanks! |
@nical I think we mentioned that before, vendoring could be a good option for most usecases. I think there are some crates like Maybe we can do the same. Every Seems like a good thing to me. If I want to do development stuff and use my IDE and get completion I could use the |
This problem has been there for years btw, it's still not fixed in |
Before the 0.7.0 release there was the idea floating around of releasing "vendored" code and not having to run the code generator all the time. This should also make autocomplete work better. (I have heard that IDEA-rust made advances in that area, supporting cases like ours, but I have not tested it) |
So.. is there any way to enable code completion in IDE? |
To make it work in CLion/Intellij Idea:
|
UPDATE: Hi, could we agree on more speciffic steps for the workaround? I did:
It finished successfully, but the intellisense still does not react =(. Did I miss something? |
With rust-analyzer the following settings will make it work:
These settings will work in vim with coc.nvim and vscode. It should be similar for other lsp clients. |
Great! I suppose this could be closed now? |
Yes. Rust-analyzer and IntelliJ support it now. RLS doesn’t but rust-analyzer is in the progress of replacing it. |
I see. Closing then. |
Maybe something like that can be added to the README or the WIP book? |
I think it could be added to the introduction or the get-started section of the WIP book. A github wiki could also be added for relevant small bits of knowledege |
I think README is a good place for now. We'll likely want to mention it in the book eventually as well, probably in the "getting started" guide. |
By the way, I came back to see the intellij config and noticed that it's suggested to apply a patch. That's not necessary. You can go to
Now intellisense should work for the generated files. |
@emigr2k1 Total newbie here... Where should I place this config? Is this a rust-analyzer config, or is this VSCode specific? EDIT: Ok, that was specific to VSCode. For anyone looking for emacs support, the equivalent config emacs is:
|
Sorry to revive this issue, but I am using gdnative = "0.9.3" and having this same problem, intellisense is not loading. I have enabled those properties proMacro and loadOutDirsFormCheck, I am also using the nightliy version of rust-analyiser with vscode and it's pretty hard to work without those features. |
It seems like a few people have these issues at the moment, we're also discussing them in our Discord. I'm not using VSCode myself, but if someone has found a way to make the symbols work, would be appreciated to share them in #789 or the Discord! |
Please excuse my rust newbiness. Any suggestions on getting autocomplete working in rls-vscode for generated bindings? I can see the various generated [feature name]_types.rs in my project's folders under target/debug/build, and my code builds without complaint. But only non-generated types are shown in intellisense.
Since the godot-rust examples are tied to the project with relative path dependencies, I wasn't sure of the preferred method of referencing feature dependencies. My toml dependencies are declared as...
And I'm referencing them as separate crates in my code...
The text was updated successfully, but these errors were encountered: