Is your enhancement related to a problem? Please describe.
yaml-language-server turns JSON pointer references into links based on vscode-json-languageservice. YAML has a native support to references though: anchors. It makes sense to support anchors instead of or in addition to JSON pointers.
Describe the solution you would like
The links provider should provide links for anchors. The solution is fairly simple. In src/languageservice/services/yamlLinks.ts:
- Iterate over the AST
- Register an anchor by name if found
- Create a link to an anchor when an anchor id is found
Do this for every SingleYAMLDocument.
Describe alternatives you have considered
N/A
Additional context
I tried this. yaml-language-server-parser supports anchors, but the conversion to the vscode-json-languageservice compatible AST removes all anchors and anchor references. I tried adding it, but it doesn’t really have a good place inside this AST format.
It’s probably best to wait for the new AST format introduced in #442
Is your enhancement related to a problem? Please describe.
yaml-language-serverturns JSON pointer references into links based onvscode-json-languageservice. YAML has a native support to references though: anchors. It makes sense to support anchors instead of or in addition to JSON pointers.Describe the solution you would like
The links provider should provide links for anchors. The solution is fairly simple. In
src/languageservice/services/yamlLinks.ts:Do this for every
SingleYAMLDocument.Describe alternatives you have considered
N/A
Additional context
I tried this.
yaml-language-server-parsersupports anchors, but the conversion to thevscode-json-languageservicecompatible AST removes all anchors and anchor references. I tried adding it, but it doesn’t really have a good place inside this AST format.It’s probably best to wait for the new AST format introduced in #442