redhat-developer / redhat-developer/vscode-java

Formatting a Java file sometimes eats parts of the code

オープン
#2,173 コメント 13 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

formatter
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

This is similar to a bug that existed in Eclipse maybe 5 or 10 years ago.

Every now and then when you press format, part of the code is deleted. This is really super bad for any IDE, especially when you have auto format on save turned on. "Done with your changes? Sure, let me just save and commit. Why did you commit broken code, it doesn't even compile? %#€""

It seems like the formatter and also code highlighting gets out of sync with reality when this happens, e.g. in this example you can see that return is incorrectly colored.

https://user-images.githubusercontent.com/260340/138037841-aabf6088-d086-41f0-9908-98e3ec7eb555.mov

Environment
  • Operating System: mac os Big Sur
  • JDK version: 17
  • Visual Studio Code version: 1.61.1
  • Java extension version: 0.82.0
Steps To Reproduce
  1. Use VS Code until it happens... there is no reliable way as far as I know

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

提供された録画と、issue に記載されている formatter およびコードハイライトの動作から始め、macOS、JDK 17、VS Code 1.61.1、Java extension 0.82.0 の一覧にある環境を使用します。断続的に発生する失敗を再現するか、発生条件を絞り込み、その後、フォーマットによってコードが削除されなくなり、ハイライトの同期が維持されることを確認します。

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

評価

技術スタック
java, typescript, vscode
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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