Skip to content

Commit

Permalink
Merge pull request #283 from KxSystems/KXI-42983
Browse files Browse the repository at this point in the history
KXI-42983 - On install/upgrade install Packaging autocomplete schema definitions
  • Loading branch information
Philip-Carneiro-KX authored May 1, 2024
2 parents 7ab628c + c3b3941 commit 7c587c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { env } from "node:process";
import path from "path";
import {
commands,
ConfigurationTarget,
EventEmitter,
ExtensionContext,
extensions,
languages,
TextDocumentContentProvider,
Uri,
Expand Down Expand Up @@ -404,6 +406,28 @@ export async function activate(context: ExtensionContext) {
await connectBuildTools();

Telemetry.sendEvent("Extension.Activated");
const yamlExtension = extensions.getExtension("redhat.vscode-yaml");
if (yamlExtension) {
const actualSchema = await workspace.getConfiguration().get("yaml.schemas");
const schemaJSON = {
"https://code.kx.com/insights/enterprise/packaging/schemas/pipeline.json":
"*pipelines/*.yaml",
"https://code.kx.com/insights/enterprise/packaging/schemas/table.json":
"tables/*.yaml",
"https://code.kx.com/insights/enterprise/packaging/schemas/deploymentconfig.json":
"deployment_config.yaml",
"https://code.kx.com/insights/enterprise/packaging/schemas/router.json":
"router.yaml",
"https://code.kx.com/insights/enterprise/packaging/schemas/shard.json":
"*shard.yaml",
};
Object.assign(actualSchema, schemaJSON);
await yamlExtension.activate().then(() => {
workspace
.getConfiguration()
.update("yaml.schemas", actualSchema, ConfigurationTarget.Global);
});
}
}

export async function deactivate(): Promise<void> {
Expand Down

0 comments on commit 7c587c4

Please sign in to comment.