Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add label for scheme contributions #315

Merged

Conversation

evidolob
Copy link
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

Copy link
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
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 <[email protected]>

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

Signed-off-by: Yevhen Vydolob <[email protected]>

* Avoid using 'any'

Signed-off-by: Yevhen Vydolob <[email protected]>

* Fix getting indentation

Signed-off-by: Yevhen Vydolob <[email protected]>

* Add changelog

Signed-off-by: Yevhen Vydolob <[email protected]>
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