redhat-developer / redhat-developer/vscode-yaml
Feature request: add "Copy YAML JSONPath" command
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Is your enhancement related to a problem? Please describe.
My situation is that I work with OpenAPI specs frequently, and they are often described with YAML. We have tooling that lets us point at specific parts of the spec using a JSON Path.
When the spec is defined in JSON, I use the copy-json-path extension's Copy Json Path command to copy something like components.schemas.Foo to my clipboard.
Describe the solution you would like
A command like Copy YAML JSONPath, similar to the one mentioned above. I am not opinionated on the format, naming, etc.
The breadcrumbs at the top of the screen you already display are basically what I want, so just joining that with a . or something (and calling it something other than a "jsonpath", like perhaps "Copy YAML key path", if this would be meaningfully different from a compliant jsonpath) would be all that I really want/need.
Describe alternatives you have considered
- https://marketplace.visualstudio.com/items?itemName=b-shan.jsonyamlkeynavigator (I haven't tried this extension, because it has so few downloads, and I would prefer this functionality to come from your extension, which is well-supported and already installed on my & my colleagues' machines).
Additional context
https://github.com/vmware-labs/yaml-jsonpath might be a useful library to help with this, if you don't already use it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by locating the code that renders the existing YAML breadcrumbs and the extension's command registrations; define the copied key-path format from that behavior. Done means a YAML-focused command is available and copies the selected node's path to the clipboard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, yaml
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100