Enter before indented Java line comment removes indentation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Riproduci il problema in NetBeans Java Editor utilizzando l’esempio e con il cursore all’inizio di un commento di riga indentato. Traccia la gestione del tasto Enter per i commenti di riga e confrontala con quella dei commenti a blocco e delle istruzioni ordinarie. Il lavoro è completato quando l’indentazione viene mantenuta inserendo una riga prima di uno dei due commenti, con copertura di regressione per i casi segnalati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 939
- Merge medio
- 4g 21h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/netbeans
-
Contribution welcome kind:feature Platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/netbeans#9614 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
kind:bug LSP needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/netbeans#9548 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Editor Java kind:feature needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxApertakind:bug needs:triage os:linux os:macos Platform UI
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
kind:bug needs:triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/netbeans
Issue simili
-
Fix Math.ceilDiv wrong result for exact positive divisionsForse già presa @pamod-madubashana l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
scala-native/scala-native#5094 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] AI unread message badge counts a batch of new bubbles as one messageForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
apache/rocketmq-dashboard#5784 ·
I maintainer di solito rispondono entro 3 giorni
-
[i18n] 安装实例完成后的成功提示未正确本地化Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
PCL-Community/PCL-CE#3658 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
apache/skywalking#14127 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno