Enter before indented Java line comment removes indentation
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Reproduce el problema en NetBeans Java Editor utilizando el ejemplo y con el cursor al inicio de un comentario de línea indentado. Rastrea el manejo de la tecla Enter para los comentarios de línea y compáralo con los comentarios de bloque y las instrucciones ordinarias. Se considera terminado cuando la indentación se conserva al insertar una línea antes de cualquiera de los dos comentarios, con cobertura de regresión para los casos reportados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 939
- Merge medio
- 4 d 21 h
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/netbeans
-
Contribution welcome kind:feature Platform
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/netbeans#9614 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
kind:bug LSP needs:triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/netbeans#9548 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Editor Java kind:feature needs:triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxAbiertokind:bug needs:triage os:linux os:macos Platform UI
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Incorrect DTD for wstcref-FilesAbiertokind:bug needs:triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/netbeans
Issues similares
-
Fix Math.ceilDiv wrong result for exact positive divisionsPosiblemente ocupada @pamod-madubashana la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
scala-native/scala-native#5094 ·
Los mantenedores suelen responder en 1 día
-
[Bug] AI unread message badge counts a batch of new bubbles as one messagePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/rocketmq-dashboard#5784 ·
Los mantenedores suelen responder en 3 días
-
[i18n] 安装实例完成后的成功提示未正确本地化Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
PCL-Community/PCL-CE#3658 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
apache/skywalking#14127 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día