Skip to content

Pass parent to plugin.print.canAttachComment #18054

@fisker

Description

@fisker

Funny story, I was looking at the Property print.
I found we are printing .value instead of .key, they I realized that .key and .value are different. It was changed many years ago.

So, for shorthand properties, the key won't get printed. If a comment gets attached to the key, it will get lost. Then I checked comment handling this function, this was added for this reason as I expected.

Similar things may happen to the new added MatchObjectPatternProperty and ComponentParameter.

To prevent comment attach to the non-printable node, we better use canAttachComment to do it, to solve the problem we need pass parent to it.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions