redhat-developer / redhat-developer/vscode-java
java formatter: unable to wrap/break long Strings
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.3k
- Forks
- 546
- Merge medio
- 20 h 1 min
- PR fusionados (30 d)
- 11
Descripción
I come from Intellij idea and I'm used to break long lines with the formatter. I managed to export/import most of the settings, but I can not manage it that vscode breaks long String lines, splitting the Strings with "firstPart" + "secondPart".
These are my related settings in the codeFormatterSettings.json:
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="180"/>
<setting id="org.eclipse.jdt.core.formatter.formatter_wrap_long_strings" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_strings" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
Please ask if I should upload the whole file.
This is an example line of code:
String strSystemPrompt =
"You are a system that generates a concise and informative answer in less than 100 words for the given question, which is marked with QUESTION. Use the given search results marked with SEARCH RESULT as only knowledge base. Answer questions in the language of the question, i.e. german questions in german and only english questions in english.";
This is the expected output:
String strSystemPrompt =
"You are a system that generates a concise and informative answer in less than 100 words for the given question, which is marked with QUESTION. Use the given search" +
"results marked with SEARCH RESULT as only knowledge base. Answer questions in the language of the question, i.e. german questions in german and only english" +
"questions in english.";
Am I missing something, is it not supported, or is it a bug?
VSCode version 1.98.2
Java Language support:
Version
1.40.0
Last Updated
2025-03-06, 08:33:26
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.
Línea de trabajo
Empieza reproduciendo el comportamiento del formateador con la configuración mostrada en codeFormatterSettings.json y el ejemplo de Java del issue. Comprueba si las opciones indicadas para cadenas largas y concatenación de cadenas llegan al formateador de Java utilizado por la VS Code extension. Se considera terminado cuando los literales de cadena Java largos se dividen en cadenas concatenadas como se muestra en la salida esperada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100