YAML editor does not support tagged mappings (!tag / !!map) and reports cascading parse errors
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- yaml
- 領域
- tooling
調査の方向性
まず、新しい test.yaml で最小限の !!map と !example の例を使って問題を再現し、その後、コントロールのマッピングと比較します。YAML エディターがタグ付きノードとパーサーエラーをどのように処理するかを追跡します。タグ付きマッピングが構文エラーなしで受け入れられ、その後に続く有効なマッピングがエラーとして報告されなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 939
- 平均マージ
- 4日 20時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/netbeans のほかの issue
-
Contribution welcome kind:feature Platform
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/netbeans#9614 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
kind:bug LSP needs:triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/netbeans#9548 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Editor Java kind:feature needs:triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
The main Options dialog window has buttons with OK on the left instead of on the right on Linuxオープンkind:bug needs:triage os:linux os:macos Platform UI
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
kind:bug needs:triage
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
apache/netbeans の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openhab/openhab-addons#21921 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
jellyfin/jellyfin-androidtv#5885 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
objectionary/eo-graphs#85 ·
-
XtYaml throws a bare ClassCastException when sheets or asserts is a scalar or holds a non-stringオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
objectionary/xax#246 ·
メンテナーはふだん 1 日以内に返信