Skip to content

Add label for scheme contributions#315

Merged
JPinkney merged 2 commits intoredhat-developer:masterfrom
evidolob:scheme-contribution-with-label
Jul 16, 2020
Merged

Add label for scheme contributions#315
JPinkney merged 2 commits intoredhat-developer:masterfrom
evidolob:scheme-contribution-with-label

Conversation

@evidolob
Copy link
Copy Markdown
Collaborator

In case when two(or more) extensions wants to contribute JSON Scheme for same file, we need a way to chose which scheme LS will use. This PR solve that problem by adding additional optional parameter for registerContributor method.
That parameter is label, it should contains yaml key value pair, that pair will be used to check file content and LS receive only one JSON scheme, if label is match.

Fix: redhat-developer/yaml-language-server#267

evidolob added 2 commits July 15, 2020 11:14
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Copy link
Copy Markdown
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it looks good to me. Is there any way I can try this out?

@evidolob
Copy link
Copy Markdown
Collaborator Author

evidolob commented Jul 16, 2020

@JPinkney Yes, you can try with k8s extension, try to provide scheme for some custom CRD. If you provide label, your scheme should be used.
Or I can create PR for vscode-tekton which will be used new API.

@JPinkney JPinkney merged commit 9a70e50 into redhat-developer:master Jul 16, 2020
bleach31 pushed a commit to bleach31/vscode-yaml that referenced this pull request Jan 25, 2022
* redhat-developer#283 use space for completion text instead of tab

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Add missing 'copied from' comment, remove unused import

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Avoid using 'any'

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Fix getting indentation

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Add changelog

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a better way to contribute custom scheme

2 participants