rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.08k stars 1.57k forks source link

Macro string literal completion edits not replacing prior text #17479

Open RoloEdits opened 2 months ago

RoloEdits commented 2 months ago

rust-analyzer version: rust-analyzer 0.0.0 (498b94b730 2024-06-17)

rustc version: rustc 1.74.0 (79e9716c9 2023-11-13)

editor or extension: helix

code snippet to reproduce:

// add your code here
use chrono::serde::ts_milliseconds;
use chrono::{DateTime, Utc};
use serde::Deserialize;

#[derive(Deserialize)]
struct A {
    #[serde(with = "ts_mill")]
    time: DateTime<Utc>,
}

fn main() {
    println!("Hello, world!");
}

helix_auto_complete_in_string

Originally thought it was a helix issue, but was directed here after some discussion. https://github.com/helix-editor/helix/discussions/11020

Veykril commented 2 months ago

Hmm, we shouldn't trigger those there at all actually given we are inside a string token. It's not really possibly for us to treat this completion correctly inside a string.