rust-lang / rust-analyzer

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

Typing `<` inserts gibberish #12379

Open SludgePhD opened 2 years ago

SludgePhD commented 2 years ago

rust-analyzer version: 84be2eaf9 2022-05-23 stable

rustc version: rustc 1.60.0 (7737e0b5c 2022-04-04)

relevant settings: Didn't find any

Sometimes, typing < to specify generics inserts $0, like here:

let v: Vec

The result is let v: Vec<$0>, which is invalid code.

This started happening on the latest release.

leshow commented 2 years ago

I am getting this also, rustc version 1.59, I tried the pre-release and release versions of RA from vscode, no change.

INFO [5/24/2022, 8:07:12 PM]: PersistentState: { serverVersion: '0.3.1066' }
INFO [5/24/2022, 8:07:12 PM]: Using server binary at /home/leshow/.vscode/extensions/rust-lang.rust-analyzer-0.3.1066-linux-x64/server/rust-analyzer

The $0 seems to be placeholder argument text

lnicola commented 2 years ago

This is fallout from #11830.

Veykril commented 2 years ago

https://github.com/rust-lang/rust-analyzer/pull/12382 will disable this feature by default until we fix it properly (that is we either have to implement or put this behind a new lsp extension, we should probably prefer the latter)