Skip to content

Insert extra symbol, error occurs. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Chanyon opened this issue Aug 23, 2022 · 2 comments
Closed

Insert extra symbol, error occurs. #11

Chanyon opened this issue Aug 23, 2022 · 2 comments

Comments

@Chanyon
Copy link

Chanyon commented Aug 23, 2022

Input code

KeyEvent {
                code: code @ (KeyCode::Up | KeyCode::Down | KeyCode::Left | KeyCode::Right | KeyCode::End | KeyCode::Home),
                modifiers: event::KeyModifiers::NONE,
            } => {
                self.output.move_cursor(code);
            }

Output code

KeyEvent {
                code: code @ (
                    | KeyCode::Up
                    | KeyCode::Down
                    | KeyCode::Left
                    | KeyCode::Right
                    | KeyCode::End
                    | KeyCode::Home
                ),
                modifiers: event::KeyModifiers::NONE,
            } => {
                self.output.move_cursor(code);
            }

Additional context

Insert extra symbols after format.

bug
.

@jinxdash
Copy link
Owner

It looks like rust-analyzer's custom parser does not support leading | in patterns. I filed an issue here.
In the meantime I recommend removing the leading | and ignoring that code by placing // prettier-ignore above it.

@jinxdash
Copy link
Owner

This issue has been fixed in rust-analyzer.
From what I understand the fix should be part of next week's release, or tomorrow if you use rust-analyzer nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants