async function activateYamlExtension()

in client/src/yaml-support/yaml-schema.ts [74:91]


async function activateYamlExtension(): Promise<{ registerContributor: YamlSchemaContributor } | undefined> {
	const ext = vscode.extensions.getExtension(VSCODE_YAML_EXTENSION_ID);
	if (!ext) {
		vscode.window.showWarningMessage('Please install \'YAML Support by Red Hat\' via the Extensions pane.');
		return undefined;
	}
	const yamlPlugin = await ext.activate();

	if (!yamlPlugin || !yamlPlugin.registerContributor) {
		vscode.window.showWarningMessage('The installed Red Hat YAML extension doesn\'t support Registering Contributers. Please upgrade \'YAML Support by Red Hat\' via the Extensions pane.');
		return undefined;
	}

	if (ext.packageJSON.version && !semver.gte(ext.packageJSON.version, '0.0.15')) {
		vscode.window.showWarningMessage('The installed Red Hat YAML extension doesn\'t support multiple schemas. Please upgrade \'YAML Support by Red Hat\' via the Extensions pane.');
	}
	return yamlPlugin;
}