JetBrains / JetBrains/resharper-unity

Feature Request: Provide context about Unity YAML inline

Open
#1,748 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

You're not supposed to manually edit Unity's various YAML files (`.asset`, `.meta`, etc.). That's fine.

But given that I use source control for my Unity projects, I find myself manually *reading* Unity's YAML files a lot, generally when it's time to commit them. Thanks to Unity's heavy use of GUIDs, I don't always know what I'm committing.

So I'd like to put in a feature request; the ability to highlight or mouse over certain elements of Unity YAML and have relevant information displayed.

Let's take this YAML file as an example. It represents a `ScriptableObject` of some type.

```yaml
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ecd0f51e6cdda4338b8adc4542076829, type: 3}
m_Name: Desktop
m_EditorClassIdentifier:
_developerDescription:
_id:
_value:
_serializedList:
- {fileID: 11400000, guid: 05d0270e6c5ea72d5aa75332be0ecbb8, type: 2}
- {fileID: 11400000, guid: 4d4a3e41f042b2befb441a705b0425a6, type: 2}
- {fileID: 11400000, guid: 3b2568a66644670ff941c9868cf2a4f0, type: 2}
- {fileID: 11400000, guid: 22857a81d9b49c9adad2cda07a4a9d33, type: 2}
- {fileID: 11400000, guid: 319036e99d561aa93992c1901cbcbcae, type: 2}
- {fileID: 11400000, guid: c79b0d0d4afd5b67bba877b18d76423e, type: 2}
- {fileID: 11400000, guid: 824198287f143671ea712f9a62572f00, type: 2}
- {fileID: 11400000, guid: d662fdea5604365719bed4de7fdc3af6, type: 2}
- {fileID: 11400000, guid: 9000437866c6f85b294737110966f2ee, type: 2}
- {fileID: 11400000, guid: 3bc71e70d4014be3f9986ebb1c85d093, type: 2}
- {fileID: 11400000, guid: 4200bab888de0696f9f99fcad5050a5c, type: 2}
_added: {fileID: 0}
_removed: {fileID: 0}
_cleared: {fileID: 0}
```

Here are some specific examples of things I'd appreciate:

- Annotate this file in the Explorer view with the name of the class it belongs to (in this case, a class named `AtomList`)
- When hovering over a property name whose equivalent C# field has a doc comment, display that doc comment (plus some special cases for common built-in fields like `m_ObjectHideFlags`)
- When hovering over an asset reference (like the elements of `_value._serializedList`), display the name of the asset (and maybe let the user open it in Unity or in Rider)
- When hovering over a value that is known to represent an `enum`, show the value of the `enum`
- When hovering over a `guid` field, show what asset the GUID refers to. GUIDs sometimes appear outside of the usual `fileID`/`guid`/`type` triplets.

I'd be open to contributing this, but I don't know what it would entail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.