Enter before indented Java line comment removes indentation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
例と、インデントされた行コメントの先頭に caret がある状態を使って、NetBeans Java Editor で問題を再現します。行コメントに対する Enter キーの処理を追跡し、ブロックコメントおよび通常の文の場合と比較します。いずれかのコメントの前に行を挿入したときにインデントが保持され、報告されたケースに対する回帰テストが含まれていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Apache NetBeans version
Apache NetBeans 30
What happened
When pressing Enter immediately in front of an indented Java line comment, the indentation of the line comment is not maintained. This is inconsistent with the behavior of pressing Enter before other indented elements.
It is also inconsistent with pressing Enter on an earlier column before the start of the line column, which does maintain the comment's indentation.
It is furthermore inconsistent with the behavior of pressing Enter on front of a block comment (/* ... */), even for a single-line one.
Language / Project Type / NetBeans Component
Java, Editor
How to reproduce
Example:
class Example
{
Example()
{
int x = 5;
// some comment
// second line
int y = 7;
}
}
With the input caret at the beginning of "//" (column 9), pressing Enter (to insert a line before the comment) results in the indentation of the line comment being removed:
class Example
{
Example()
{
int x = 5;
// some comment
// second line
int y = 7;
}
}
The same happens when pressing Enter before subsequent line comments:
class Example
{
Example()
{
int x = 5;
// some comment
// second line
int y = 7;
}
}
This is inconsistent with how indentation behaves for non-comment lines. For example, pressing Enter before int maintains the indentation of the statement.
When pressing Enter at an earlier column, for example on column 8, the indentation of the comment is maintained (however the indentation of the now-empty line before the caret is correspondingly shorter):
class Example
{
Example()
{
int x = 5;
← empty line ends here
// some comment
// second line
int y = 7;
}
}
Compare also with the behavior for a block comment, which remains properely indented when pressing Enter in front of it:
class Example
{
Example()
{
int x = 5;
/* block comment */
int y = 7;
}
}
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
JDK 21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 939
- 平均マージ
- 4日 21時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/netbeans のほかの issue
-
Contribution welcome kind:feature Platform
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/netbeans#9614 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
kind:bug LSP needs:triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/netbeans#9548 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Editor Java kind:feature needs:triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
The main Options dialog window has buttons with OK on the left instead of on the right on Linuxオープンkind:bug needs:triage os:linux os:macos Platform UI
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
kind:bug needs:triage
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
apache/netbeans の issue をすべて見る
似ている issue
-
Fix Math.ceilDiv wrong result for exact positive divisions対応中かも @pamod-madubashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
scala-native/scala-native#5094 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] AI unread message badge counts a batch of new bubbles as one message対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
apache/rocketmq-dashboard#5784 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
PCL-Community/PCL-CE#3658 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
apache/skywalking#14127 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信