Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

YAML editor does not support tagged mappings (!tag / !!map) and reports cascading parse errors

オープン
#9,447 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
yaml
領域
tooling

調査の方向性

まず、新しい test.yaml で最小限の !!map と !example の例を使って問題を再現し、その後、コントロールのマッピングと比較します。YAML エディターがタグ付きノードとパーサーエラーをどのように処理するかを追跡します。タグ付きマッピングが構文エラーなしで受け入れられ、その後に続く有効なマッピングがエラーとして報告されなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

kind:bug needs:triage yaml
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 !example may optionally generate a warning, but should not cause syntax errors.
  • Standard YAML tags such as !!map should be accepted without syntax errors.
Language / Project Type / NetBeans Component

YAML Editor

How to reproduce
  1. Open Apache NetBeans IDE 30.
  2. Create a new file named test.yaml.
  3. Paste the following content:
a: !!map
  b: 1

c:
  d: 2
  1. Save the file.
  2. 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

主要言語
Java
スター
3.1k
フォーク
939
平均マージ
4日 20時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/netbeans のほかの issue

apache/netbeans の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。