@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
50 lines • 3.1 kB
JavaScript
// *****************************************************************************
// Copyright (C) 2018 Ericsson and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0.
//
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
// with the GNU Classpath Exception which is available at
// https://www.gnu.org/software/classpath/license.html.
//
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************
import { bindRootContributionProvider, PreferenceProvider } from '../../common/index.js';
import { PreferenceScope, ValidPreferenceScopes } from '../../common/preferences/preference-scope.js';
import { isObject } from '../../common/types.js';
import { PreferenceSchemaServiceImpl } from '../../common/preferences/preference-schema-service.js';
import { PreferenceContribution, PreferenceSchemaService } from '../../common/preferences/preference-schema.js';
import { DefaultsPreferenceProvider } from '../../common/preferences/defaults-preference-provider.js';
import { SessionPreferenceProvider } from '../../common/preferences/session-preference-provider.js';
import { PreferenceLanguageOverrideService } from '../../common/preferences/preference-language-override-service.js';
import { FrontendConfigPreferenceContribution } from './frontend-config-preference-contributions.js';
import { bindPreferenceConfigurations } from '../../common/preferences/preference-configurations.js';
export function bindPreferenceSchemaProvider(bind) {
bindPreferenceConfigurations(bind);
bind(ValidPreferenceScopes).toConstantValue([
PreferenceScope.Default,
PreferenceScope.User,
PreferenceScope.Workspace,
PreferenceScope.Folder,
PreferenceScope.Session
]);
bind(PreferenceSchemaServiceImpl).toSelf().inSingletonScope();
bind(PreferenceSchemaService).toService(PreferenceSchemaServiceImpl);
bind(PreferenceProvider).to(DefaultsPreferenceProvider).inSingletonScope().whenTargetNamed(PreferenceScope.Default);
bind(PreferenceProvider).to(SessionPreferenceProvider).inSingletonScope().whenTargetNamed(PreferenceScope.Session);
bind(PreferenceLanguageOverrideService).toSelf().inSingletonScope();
bindRootContributionProvider(bind, PreferenceContribution);
bind(PreferenceContribution).to(FrontendConfigPreferenceContribution).inSingletonScope();
}
export var FrontendApplicationPreferenceConfig;
(function (FrontendApplicationPreferenceConfig) {
function is(config) {
return isObject(config.preferences);
}
FrontendApplicationPreferenceConfig.is = is;
})(FrontendApplicationPreferenceConfig || (FrontendApplicationPreferenceConfig = {}));
//# sourceMappingURL=preference-contribution.js.map