adamvoss / vscode-yaml

YAML language support, including JSON Schema validation, for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=adamvoss.yaml
MIT License
29 stars 5 forks source link

Auto-completion by context #5

Open sbwoodside opened 7 years ago

sbwoodside commented 7 years ago

Would it be possible to have auto-completion based on the YAML context. For example, if I'm typing a key in an associative array, it would complete based on other keys, if I'm typing a value, other values, etc?

adamvoss commented 7 years ago

Yes, it would be possible. The JSON implementation could be used as a reference for seeing how to interact with the Schema to get suggestions. The Language Server Protocol document is probably the best source for documentation on how the completion API works to know what needs to be implemented.

vojtechhabarta commented 7 years ago

I know this is hard to implement because parser probably doesn't provide enough information while in the middle of editing but it would be very useful feature.

JPinkney commented 7 years ago

@sbwoodside @vojtechhabarta In our extension https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml we have this feature implemented if you want to try it out.