godot-rust / godot-rust/gdnative-book

Documentation on rust-analyzer seems outdated / anything to improve integration?

Open
#57 7 comments 0 reactions 0 assignees View on GitHub
error
Dominant language
CSS
Stars
67
Forks
43
PR merge metrics
No merged PRs in 30d

Description

The section [How do I get auto-completion with rust-analyzer?](https://godot-rust.github.io/book/faq/configuration.html#how-do-i-get-auto-completion-with-rust-analyzer) seems outdated, because [`rust-analyzer.cargo.loadOutDirsFromCheck` no longer exists](https://github.com/rust-analyzer/rust-analyzer/issues/6448#issuecomment-961403175).

In practice this is impacting my productivity quite a lot, because auto-completion within a native class exported function doesn't seem to work at all. Often, my IDE is in a state reporting simply "all broken"

![image](https://user-images.githubusercontent.com/3620703/143691057-fe1b00a1-c569-40ad-aa52-b5fc8d11dca5.png)

... and if this happens when I'm having a weak moment it can take a while to spot the actual error.

To avoid getting impacted by this issue I have now started to implement more complex methods as free floating functions like
```rust
fn process(this: &mut MyClass, delta: f64) -> Option<()> {
// ...
}
```
and forward calls from the methods, which is of course unnecessary boilerplate.

------

To narrow down the problem we probably need to answer the questions:

1. Is this just something broken with my setup, or is everyone using rust-analyzer facing these issues?

2. If it is setup related, what are the tricks to get it going, which we could update in the book?

3. If it turns out that it is fundamentally not working, the question may be if we can do something on library / macro side to improve it. Following [the links posted](https://github.com/rust-analyzer/rust-analyzer/issues/6448#issuecomment-961441435) by the rust-analyzer maintainer leads to a [similar issue](https://github.com/rust-analyzer/rust-analyzer/issues/10520) for `tokio-tracing`, caused by the usage of `syn` and [this proposal](https://github.com/tokio-rs/tracing/issues/1633) to solve it on their side. @Bromeon Is this proposal applicable to godot-rust as well?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the “How do I get auto-completion with rust-analyzer?” section in the FAQ configuration page and compare its guidance with rust-analyzer issues 6448 and 10520. Investigate whether the problem is setup-specific or related to godot-rust macros, including the linked syn proposal. Done means the book contains verified current instructions or clearly documents the limitation and available workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.