extensions/json-language-features/client/src/languageStatus.ts/createLanguageStatusItem
export function createLanguageStatusItem(documentSelector: string[], statusRequest: (uri: string) => Promise<JSONLanguageStatus>): Disposable {
	const statusItem = languages.createLanguageStatusItem('json.projectStatus', documentSelector);
	statusItem.name = localize('statusItem.name', "JSON Validation Status");
	statusItem.severity = LanguageStatusSeverity.Information;

	const showSchemasCommand = commands.registerCommand('_json.showAssociatedSchemaList', showSchemaList);

	const activeEditorListener = window.onDidChangeActiveTextEditor(() => {
		updateLanguageStatus();
	});

	async function updateLanguageStatus() {
		const document = window.activeTextEditor?.document;
		if (document && documentSelector.indexOf(document.languageId) !== -1) {
			try {
				statusItem.text = '$(loading~spin)';
				statusItem.detail = localize('pending.detail', 'Loading JSON info');
				statusItem.command = undefined;

				const schemas = (await statusRequest(document.uri.toString())).schemas;
				statusItem.detail = undefined;
				if (schemas.length === 0) {
					statusItem.text = localize('status.noSchema.short', "No Schema Validation");
					statusItem.detail = localize('status.noSchema', 'no JSON schema configured');
				} else if (schemas.length === 1) {
					statusItem.text = localize('status.withSchema.short', "Schema Validated");
					statusItem.detail = localize('status.singleSchema', 'JSON schema configured');
				} else {
					statusItem.text = localize('status.withSchemas.short', "Schema Validated");
					statusItem.detail = localize('status.multipleSchema', 'multiple JSON schemas configured');
				}
				statusItem.command = {
					command: '_json.showAssociatedSchemaList',
					title: localize('status.openSchemasLink', 'Show Schemas'),
					arguments: [{ schemas, uri: document.uri.toString() } as ShowSchemasInput]
				};
			} catch (e) {
				statusItem.text = localize('status.error', 'Unable to compute used schemas');
				statusItem.detail = undefined;
				statusItem.command = undefined;
			}
		} else {
			statusItem.text = localize('status.notJSON', 'Not a JSON editor');
			statusItem.detail = undefined;
			statusItem.command = undefined;
		}
	}

	updateLanguageStatus();

	return Disposable.from(statusItem, activeEditorListener, showSchemasCommand);
}