LSP issue while inside of agb::entry #389
-
Rust-analyzer doesn't seem to recognize the Gba struct passed to the agb::entry function, but works perfectly when passing it to any other function. I have tried this in both VSCode and Neovim. When writing a whole line the LSP knows what everything is and is able to navigate to definitions but is not able to provide code completion while writing the line. Has anyone experienced this issue? Some examples: #[agb::entry]
fn main(mut gba: Gba) -> ! {
let mut bitmap = gba.display.video.bitmap3();
for x in 0..display::WIDTH {
let y = syscall::sqrt(x << 6);
let y = (display::HEIGHT - y).clamp(0, display::HEIGHT - 1);
bitmap.draw_point(x, y, 0x001F);
}
gba.// <- The LSP has no clue of what this is
loop {
syscall::halt();
}
} #[agb::entry]
fn main(mut gba: Gba) -> ! {
let mut bitmap = gba.display.video.bitmap3();
for x in 0..display::WIDTH {
let y = syscall::sqrt(x << 6);
let y = (display::HEIGHT - y).clamp(0, display::HEIGHT - 1);
bitmap.draw_point(x, y, 0x001F);
}
hi_lsp(gba);
loop {
syscall::halt();
}
}
fn hi_lsp(mut gba: Gba){
gba.// <- here the LSP understands that this is a Gba struct
} |
Beta Was this translation helpful? Give feedback.
Answered by
corwinkuiper
Feb 11, 2023
Replies: 1 comment
-
In general, rust-analyzer has a hard time with macros, especially proc macros. Our games tend to pass to another function. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xoko14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In general, rust-analyzer has a hard time with macros, especially proc macros. Our games tend to pass to another function.