Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@
"default": [],
"description": "Custom tags for the parser to use"
},
"yaml.kubernetesSchemaURLs": {
"type": "array",
"default": [],
"description": "URLs to Kubernetes schemas"
},
"yaml.schemaStore.enable": {
"type": "boolean",
"default": true,
Expand Down
11 changes: 11 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ namespace DynamicCustomSchemaRequestRegistration {
export const type: NotificationType<{}> = new NotificationType('yaml/registerCustomSchemaRequest');
}

// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace KubernetesSchemaURLsNotification {
// eslint-disable-next-line @typescript-eslint/ban-types
export const type: NotificationType<string[]> = new NotificationType('yaml/kubernetesSchemaURLs');
}

// eslint-disable-next-line @typescript-eslint/no-namespace
namespace ResultLimitReachedNotification {
// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down Expand Up @@ -161,6 +167,7 @@ export function startClient(
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations());
findConflicts();
});
client.sendNotification(KubernetesSchemaURLsNotification.type, getKubernetesSchemaURLs());
// Tell the server that the client is ready to provide custom schema content
client.sendNotification(DynamicCustomSchemaRequestRegistration.type);
// Tell the server that the client supports schema requests sent directly to it
Expand Down Expand Up @@ -229,6 +236,10 @@ function findConflicts(): void {
}
}

function getKubernetesSchemaURLs(): string[] {
return workspace.getConfiguration('yaml').get('kubernetesSchemaURLs') || [];
}

function getSchemaAssociations(): ISchemaAssociation[] {
const associations: ISchemaAssociation[] = [];
extensions.all.forEach((extension) => {
Expand Down