src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts/inspectSetting
export function inspectSetting(key: string, target: SettingsTarget, configurationService: IWorkbenchConfigurationService): IInspectResult {
	const inspectOverrides = URI.isUri(target) ? { resource: target } : undefined;
	const inspected = configurationService.inspect(key, inspectOverrides);
	const targetSelector = target === ConfigurationTarget.USER_LOCAL ? 'userLocalValue' :
		target === ConfigurationTarget.USER_REMOTE ? 'userRemoteValue' :
			target === ConfigurationTarget.WORKSPACE ? 'workspaceValue' :
				'workspaceFolderValue';
	let isConfigured = typeof inspected[targetSelector] !== 'undefined';
	if (!isConfigured) {
		if (target === ConfigurationTarget.USER_LOCAL) {
			isConfigured = !!configurationService.restrictedSettings.userLocal?.includes(key);
		} else if (target === ConfigurationTarget.USER_REMOTE) {
			isConfigured = !!configurationService.restrictedSettings.userRemote?.includes(key);
		} else if (target === ConfigurationTarget.WORKSPACE) {
			isConfigured = !!configurationService.restrictedSettings.workspace?.includes(key);
		} else if (target instanceof URI) {
			isConfigured = !!configurationService.restrictedSettings.workspaceFolder?.get(target)?.includes(key);
		}
	}

	return { isConfigured, inspected, targetSelector };
}