YAML editor does not support tagged mappings (!tag / !!map) and reports cascading parse errors
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- yaml
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề trong một test.yaml mới bằng các ví dụ tối thiểu !!map và !example, sau đó so sánh mapping đối chứng. Theo dõi cách trình chỉnh sửa YAML xử lý các node được gắn thẻ và lỗi parser. Hoàn tất khi các mapping được gắn thẻ được chấp nhận mà không có lỗi cú pháp và các mapping hợp lệ tiếp theo không bị báo là lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 939
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/netbeans
-
Contribution welcome kind:feature Platform
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/netbeans#9614 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind:bug LSP needs:triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/netbeans#9548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Editor Java kind:feature needs:triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxĐang mởkind:bug needs:triage os:linux os:macos Platform UI
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Incorrect DTD for wstcref-FilesĐang mởkind:bug needs:triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/netbeans
Issue tương tự
-
BoxAttachmentMulti parsing leaks IOException / ArrayIndexOutOfBoundsException on malformed content instead of IllegalArgumentExceptionCó thể đã có người làm @Kshot3000 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ergoplatform/ergo-appkit#272 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
utopia-rise/godot-jvm#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
spring-projects/spring-grpc#442 ·