redhat-developer / redhat-developer/vscode-java

Formatter File not respected when applying snippets

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

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

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

説明

I have a format xml specified in Java > Format > Settings: Url. When I run the command "Open Java Formatter Settings" my file is opened. No settings in the file are respected, however. Consider just this setting:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
    <profile kind="CodeFormatterProfile" name="BradsProfile" version="12">
        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
    </profile>
</profiles>

In the editor after typing 'if' followed by 2 tabs, I end up with this:

if (condition:var(boolean)) {
    
}

I don't see any errors in "Language Support for Java."

Environment
  • Operating System: Windows 10
  • JDK version: 11.0.14.101
  • Visual Studio Code version: 1.71.0
  • Java extension version: 1.10.0
Steps To Reproduce
  1. Configure formatter file with contents as above
  2. Type if statement as above

Can be as simple as a single .java file

Current Result
if (condition:var(boolean)) {
    
}
Expected Result
if (condition:var(boolean)) 
{
    
}

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

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

はじめの一歩

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

調査の方向性

まず、提供された formatter XML と、示されている Java 拡張機能の設定を使って、単一の .java ファイルで問題を再現します。if-statement スニペットが展開されたときに、formatter ファイルがどのように読み込まれ、適用されるかを追跡します。設定された next_line のブレース位置が尊重され、提供された再現手順で現在のレイアウトが生成されなくなれば完了です。

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

評価

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

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

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