the fontStyle for Rust is displayed incorrectly.

オープン
#835 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, vscode
領域
design, tooling

調査の方向性

まず、rust-analyzer を有効にした VS Code で Rust の例を再現し、次に One Dark Pro テーマの Rust 関連トークンのスタイルを確認します。通常の Rust ドキュメントの場合と照らし合わせて動作を確認してください。完了条件は、mutable パラメーターが斜体で表示され、該当する関数が太字で表示され、下線によってフォントのスタイルが誤って設定されないことです。

索引モデルが issue の本文から書いたものです。

説明

bug

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.

主要言語
TypeScript
スター
1.8k
フォーク
307
平均マージ
1時間 53分
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Binaryify/OneDark-Pro のほかの issue

Binaryify/OneDark-Pro の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。