Skip to content

Commit

Permalink
Refactor preference tree layouting (#13819)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Jul 3, 2024
1 parent 71a1235 commit 5a8d3cf
Show file tree
Hide file tree
Showing 10 changed files with 443 additions and 72 deletions.
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);
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

0 comments on commit 5a8d3cf

Please sign in to comment.