Skip to content
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

the fontStyle for Rust is displayed incorrectly. #835

Open
acathe opened this issue Dec 8, 2024 · 1 comment
Open

the fontStyle for Rust is displayed incorrectly. #835

acathe opened this issue Dec 8, 2024 · 1 comment
Labels

Comments

@acathe
Copy link

acathe commented Dec 8, 2024

Describe the bug

After using rust-analyzer, the fontStyle for Rust is displayed incorrectly.

To Reproduce

Steps to reproduce the behavior:

  1. Install the One Dark Pro theme;
  2. Install rust-analyzer;
  3. Use cargo to create a Rust project (ensure rust-analyzer can analyze the code correctly);
  4. Create a function with a mut parameter and notice that the parameter is not italicized;
  5. Create an impl with &mut self and notice that the function is not bold.

Expected behavior

According to the design of One Dark Pro, function parameters should be italicized, but they are currently displayed in regular font.

Screenshots & Example Code

Screenshot 2024-12-09 05 55 18
struct temp;

#[allow(dead_code)]
impl temp {
    fn should_bold(&self, should_italic: i32) {
        let _ = should_italic;
    }

    fn should_bold_too(&mut self, should_italic_too: &mut i32) {
        //! but it's not bold

        let _ = should_italic_too; // but it's not italic
    }
}

Desktop (please complete the following information):

  • OS: mac, ssh to debian
  • VSCODE Version v1.95.3
  • Theme version v3.17.7

Additional context

When rust-analyzer cannot analyze the code, the code display is normal. You can create a temporary page using Command+N and then set it to Rust format. At this point, using the above code, mut is displayed correctly.

Screenshot 2024-12-09 06 03 29

It seems that the issue lies in rust-analyzer's handling of mut variables, which adds an underline to mut variables to prompt the developer. One Dark Pro seems unable to display these underlined texts correctly.

@acathe
Copy link
Author

acathe commented Dec 13, 2024

I tried disabling the underline, but it didn’t resolve the issue. Now, I am attempting to adjust other options to make it visually consistent with One Dark Pro.

{
    "editor.semanticTokenColorCustomizations": {
        "rules": {
            "method:rust": {
                "bold": true
            },
            "parameter:rust": {
                "italic": true
            }
        }
    }
}

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

No branches or pull requests

1 participant