Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor preference tree layouting #13819

Merged
merged 6 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/src/common/preferences/preference-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export interface PreferenceSchema {
[name: string]: any,
scope?: 'application' | 'window' | 'resource' | PreferenceScope,
overridable?: boolean;
/**
* The title of the preference schema.
* It is used in the preference UI to associate a localized group of preferences.
*/
title?: string;
properties: PreferenceSchemaProperties
}
export namespace PreferenceSchema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
for (const c of configurations) {
const config = this.readConfiguration(c, rawPlugin.packagePath);
if (config) {
Object.values(config.properties).forEach(property => property.title = config.title);
msujew marked this conversation as resolved.
Show resolved Hide resolved
contributions.configuration.push(config);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ import { PreferenceOpenHandler } from './preference-open-handler';
import { CliPreferences, CliPreferencesPath } from '../common/cli-preferences';
import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
import { PreferenceFrontendContribution } from './preference-frontend-contribution';
import { PreferenceLayoutProvider } from './util/preference-layout';

export function bindPreferences(bind: interfaces.Bind, unbind: interfaces.Unbind): void {
bindPreferenceProviders(bind, unbind);
bindPreferencesWidgets(bind);

bind(PreferenceTreeGenerator).toSelf().inSingletonScope();
bind(PreferenceLayoutProvider).toSelf().inSingletonScope();

bindViewContribution(bind, PreferencesContribution);

Expand Down
3 changes: 2 additions & 1 deletion packages/preferences/src/browser/preference-tree-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import {
} from '@theia/core/lib/browser';
import { Emitter } from '@theia/core';
import { PreferencesSearchbarWidget } from './views/preference-searchbar-widget';
import { PreferenceTreeGenerator, COMMONLY_USED_SECTION_PREFIX } from './util/preference-tree-generator';
import { PreferenceTreeGenerator } from './util/preference-tree-generator';
import * as fuzzy from '@theia/core/shared/fuzzy';
import { PreferencesScopeTabBar } from './views/preference-scope-tabbar-widget';
import { Preference } from './util/preference-types';
import { Event } from '@theia/core/lib/common';
import { COMMONLY_USED_SECTION_PREFIX } from './util/preference-layout';

export interface PreferenceTreeNodeProps extends NodeProps {
visibleChildren: number;
Expand Down
Loading
Loading