atom-language-rust icon indicating copy to clipboard operation
atom-language-rust copied to clipboard

Rust's syntax highlighting breaks after `r#impl`

Open alexr00 opened this issue 6 years ago • 1 comments

From @rustka in https://github.com/microsoft/vscode/issues/81085

Rust's syntax highlighting breaks after using impl keyword as a raw identifier.


  • VSCode version: 1.38.1
  • OS version: Linux x64

Steps to reproduce:

  1. Open the editor;
  2. Set language mode to Rust;
  3. Paste the following code:
use r#impl;
fn main() {}
  1. Comment the first line by prefixing it with //; 4.1. This failure could also be prevented by replacing r#impl with r#impl {}, but this is not the real solution for that case.
  2. The syntax highlighting works properly back again.

P.S.: I did test it on Atom editor (v1.40.1) and it seemed to work correctly.

alexr00 avatar Sep 19 '19 07:09 alexr00

Also, after a # the whole line (except some things) is white:

pub fn r#let (&self); // comments
// and              // are one of the
#[allow (dead_code)] // exceptions

RpxdYTX avatar Nov 01 '21 13:11 RpxdYTX