Heya, when I use "generate getter" on the value
field using Rust analyzer:
#[derive(Clone, Debug)]
pub struct MyStruct {
value: u32,
}
The following code gets generated (notice the $0
before the function name):
impl MyStruct {
pub fn $0value(&self) -> u32 {
self.value
}
}
I need help figuring out:
- if it is a bug (should this line check if
ctx.config.snippet_cap
is a certain value?) - where the would-be bug is (rust-analyzer, LSP, LSP-rust-analyzer, or some config setting)
I'm not sure how to avoid the $0
being inserted as part of the code (it looks like where the caret is intended to be placed). The $0
looks intentional, similar to rust-analyzer#7793. #11006 might also be related.
I've been playing with LSP-rust-analyzer settings but can't seem to resolve it.
My tools and versions are:
Rust Analyzer: rust-analyzer 0.0.0 (89b994049 2023-02-14)
Sublime text: Build 4147
LSP-rust-analyzer: v1.3.1