YAML editor does not support tagged mappings (!tag / !!map) and reports cascading parse errors
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
- 64/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- yaml
- Área
- tooling
Línea de trabajo
Comienza reproduciendo el problema en un nuevo test.yaml con los ejemplos mínimos !!map y !example, y luego compara el mapeo de control. Rastrea cómo el editor de YAML gestiona los nodos etiquetados y los errores del parser. El trabajo está terminado cuando los mapeos etiquetados se aceptan sin errores de sintaxis y los mapeos válidos posteriores no se informan como errores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Apache NetBeans version
Apache NetBeans 30
What happened
The YAML editor reports syntax errors for valid YAML documents that use tagged mappings.
For example, the following YAML is marked as invalid:
customTaggedMapping: !example
name: test
enabled: true
plainMapping:
name: test
enabled: true
The editor reports:
Mapping values are not allowed here.
on the nested mapping entries.
The same behavior occurs when using the standard YAML tag !!map:
standardTaggedMapping: !!map
name: test
enabled: true
I also tested the flow-style equivalent:
customTaggedMapping: !example { name: test, enabled: true }
standardTaggedMapping: !!map { name: test, enabled: true }
plainMapping: { name: test, enabled: true }
In this case NetBeans reports:
Expected '<document start>', but found '<block mapping start>'
for the second and third lines.
The YAML validates in external YAML validators and is accepted by the application consuming the file. The issue appears to be that NetBeans does not correctly parse tagged nodes and subsequently loses synchronization with the document structure, causing additional valid mappings to be reported as errors.
Expected behavior:
- Tagged mappings should be accepted as valid YAML syntax.
- Unknown custom tags such as
!examplemay optionally generate a warning, but should not cause syntax errors. - Standard YAML tags such as
!!mapshould be accepted without syntax errors.
Language / Project Type / NetBeans Component
YAML Editor
How to reproduce
- Open Apache NetBeans IDE 30.
- Create a new file named
test.yaml. - Paste the following content:
a: !!map
b: 1
c:
d: 2
- Save the file.
- Observe that NetBeans reports:
Mapping values are not allowed here.
on the line:
b: 1
As an additional test, replace the contents with:
a: !example
b: 1
c:
d: 2
The same error is reported.
As a control test, the following YAML is accepted:
a:
b: 1
c:
d: 2
Minimal reproducer:
a: !!map
b: 1
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux version 7.0.12-201.fc44.x86_64 running on amd64; UTF-8; en_US (nb)
JDK
OpenJDK Runtime Environment 25.0.3
Apache NetBeans packaging
Other
Anything else
The problem occurs every time with tagged mappings.
One observation is that the parser appears to become confused after encountering a tagged node. Subsequent valid mappings are then reported as invalid as well, suggesting the YAML parser/editor loses synchronization with the document structure after the tagged mapping is encountered.
Because the issue also occurs with the standard YAML tag !!map, this does not appear to be limited to application-specific tags such as !example.
Are you willing to submit a pull request?
No
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 939
- Merge medio
- 4 d 20 h
- PR fusionados (30 d)
- 25
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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
objectionary/eo-graphs#85 ·
-
BoxAttachmentMulti parsing leaks IOException / ArrayIndexOutOfBoundsException on malformed content instead of IllegalArgumentExceptionPosiblemente ocupada @Kshot3000 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ergoplatform/ergo-appkit#272 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
utopia-rise/godot-jvm#1004 ·
Los mantenedores suelen responder en 1 día