redhat-developer / redhat-developer/vscode-java

Provide a way to let Formatter profile settings take precedence over VS Code's

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

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

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

説明

I have a configured formatter profile which has, among others, the following property:

<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>

If I go to a file and change, using the the option on the bottom right of VSCode to use a different attribute (ex.: space: 8) to code automatically formats to that selection, ignoring the formatted profile.

The problem is that after doing that, the formatter option for tabulations stop working. There should be a way to force format according the formatter profile, or to remove these individual file formatter options. Right now, I have some files where I pressed this and I don't know which ones, and can't force them to be formatted properly

Environment
  • Operating System: Windows 10 Pro
  • JDK version: 1.8.0_172
  • Visual Studio Code version: 1.28.0
  • Java extension version: 0.32
Steps To Reproduce
  1. Create and apply a formatter profile with tabulation char TAB and size: 4
  2. Open .java file and format it. It applies this profile format
  3. Using VSCode bottom right menu, change tabulation char and size. Ex.: SPACE and size: 8. The file applies this profile format.
  4. Now you can't change this specific file to apply the profile configured tabulation char and size.
Current Result

The project applies to manually selected configuration. Can't revert to use profile format.

Expected

One of the following:

  • Allow to format all project according to profile formatter
  • Force format a single file to apply profile formatter
  • Ignore profile formatter for a list of files (but this needs to be visible/editable on settings)

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

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

はじめの一歩

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

調査の方向性

まず、Java 拡張機能の .java ファイルで、formatter-profile と VS Code 右下のフォーマットに関する変更を再現します。ファイル単位で選択されたフォーマットオプションがプロファイルをどのように上書きするかを追跡します。完了条件は、ユーザーが 1 つのファイルまたはプロジェクトに対してプロファイルのフォーマットを復元または強制でき、アクティブな上書きが表示または編集可能になっていることです。

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

評価

技術スタック
java, typescript, vscode
領域
developer-experience, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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