mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Remove old extension settings code
This commit is contained in:
parent
7e9474edbe
commit
f303b02376
|
@ -3,43 +3,41 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Delayer } from 'vs/base/common/async';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { Range, IRange } from 'vs/editor/common/core/range';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IPreferencesService, ISettingsGroup, ISetting, IPreferencesEditorModel, IFilterResult, ISettingsEditorModel, IExtensionSetting, IScoredResults } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { SettingsEditorModel, DefaultSettingsEditorModel, WorkspaceConfigurationEditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
|
||||
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { SettingsGroupTitleWidget, EditPreferenceWidget, SettingsHeaderWidget, DefaultSettingsHeaderWidget, FloatingClickWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations';
|
||||
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { overrideIdentifierFromKey, IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ITextModel, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model';
|
||||
import { CodeLensProviderRegistry, CodeLensProvider, ICodeLensSymbol } from 'vs/editor/common/modes';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { getDomNodePagePosition } from 'vs/base/browser/dom';
|
||||
import { IssueType, ISettingsSearchIssueReporterData, ISettingSearchResult } from 'vs/platform/issue/common/issue';
|
||||
import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { ContextSubMenu } from 'vs/base/browser/contextmenu';
|
||||
import { getDomNodePagePosition } from 'vs/base/browser/dom';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import { Delayer } from 'vs/base/common/async';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
|
||||
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { IRange, Range } from 'vs/editor/common/core/range';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness } from 'vs/editor/common/model';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ConfigurationTarget, IConfigurationService, overrideIdentifierFromKey } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationScope, Extensions as ConfigurationExtensions, IConfigurationPropertySchema, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ISettingSearchResult, ISettingsSearchIssueReporterData, IssueType } from 'vs/platform/issue/common/issue';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations';
|
||||
import { DefaultSettingsHeaderWidget, EditPreferenceWidget, FloatingClickWidget, SettingsGroupTitleWidget, SettingsHeaderWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets';
|
||||
import { IWorkbenchSettingsConfiguration } from 'vs/workbench/parts/preferences/common/preferences';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue';
|
||||
import { IFilterResult, IPreferencesEditorModel, IPreferencesService, IScoredResults, ISetting, ISettingsEditorModel, ISettingsGroup } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { DefaultSettingsEditorModel, SettingsEditorModel, WorkspaceConfigurationEditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
|
||||
|
||||
export interface IPreferencesRenderer<T> extends IDisposable {
|
||||
readonly preferencesModel: IPreferencesEditorModel<T>;
|
||||
|
@ -244,7 +242,6 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
|
|||
private issueWidgetRenderer: IssueWidgetRenderer;
|
||||
private feedbackWidgetRenderer: FeedbackWidgetRenderer;
|
||||
private bracesHidingRenderer: BracesHidingRenderer;
|
||||
private extensionCodelensRenderer: ExtensionCodelensRenderer;
|
||||
private filterResult: IFilterResult;
|
||||
|
||||
private readonly _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
|
||||
|
@ -271,7 +268,6 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
|
|||
this.feedbackWidgetRenderer = this._register(instantiationService.createInstance(FeedbackWidgetRenderer, editor));
|
||||
this.bracesHidingRenderer = this._register(instantiationService.createInstance(BracesHidingRenderer, editor, preferencesModel));
|
||||
this.hiddenAreasRenderer = this._register(instantiationService.createInstance(HiddenAreasRenderer, editor, [this.settingsGroupTitleRenderer, this.filteredMatchesRenderer, this.bracesHidingRenderer]));
|
||||
this.extensionCodelensRenderer = this._register(instantiationService.createInstance(ExtensionCodelensRenderer, editor));
|
||||
|
||||
this._register(this.editSettingActionRenderer.onUpdateSetting(e => this._onUpdatePreference.fire(e)));
|
||||
this._register(this.settingsGroupTitleRenderer.onHiddenAreasChanged(() => this.hiddenAreasRenderer.render()));
|
||||
|
@ -309,7 +305,6 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
|
|||
this.settingHighlighter.clear(true);
|
||||
this.bracesHidingRenderer.render(filterResult, this.preferencesModel.settingsGroups);
|
||||
this.editSettingActionRenderer.render(filterResult.filteredGroups, this._associatedPreferencesModel);
|
||||
this.extensionCodelensRenderer.render(filterResult);
|
||||
} else {
|
||||
this.settingHighlighter.clear(true);
|
||||
this.filteredMatchesRenderer.render(null, this.preferencesModel.settingsGroups);
|
||||
|
@ -319,7 +314,6 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
|
|||
this.settingsGroupTitleRenderer.showGroup(0);
|
||||
this.bracesHidingRenderer.render(null, this.preferencesModel.settingsGroups);
|
||||
this.editSettingActionRenderer.render(this.preferencesModel.settingsGroups, this._associatedPreferencesModel);
|
||||
this.extensionCodelensRenderer.render(null);
|
||||
}
|
||||
|
||||
this.hiddenAreasRenderer.render();
|
||||
|
@ -948,51 +942,6 @@ export class HighlightMatchesRenderer extends Disposable {
|
|||
}
|
||||
}
|
||||
|
||||
export class ExtensionCodelensRenderer extends Disposable implements CodeLensProvider {
|
||||
private filterResult: IFilterResult;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._register(CodeLensProviderRegistry.register({ pattern: '**/settings.json' }, this));
|
||||
}
|
||||
|
||||
public render(filterResult: IFilterResult): void {
|
||||
this.filterResult = filterResult;
|
||||
}
|
||||
|
||||
public provideCodeLenses(model: ITextModel, token: CancellationToken): ICodeLensSymbol[] {
|
||||
if (!this.filterResult || !this.filterResult.filteredGroups) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const newExtensionGroup = arrays.first(this.filterResult.filteredGroups, g => g.id === 'newExtensionsResult');
|
||||
if (!newExtensionGroup) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return newExtensionGroup.sections[0].settings
|
||||
.filter((s: IExtensionSetting) => {
|
||||
// Skip any non IExtensionSettings that somehow got in here
|
||||
return s.extensionName && s.extensionPublisher;
|
||||
})
|
||||
.map((s: IExtensionSetting) => {
|
||||
const extId = s.extensionPublisher + '.' + s.extensionName;
|
||||
return <ICodeLensSymbol>{
|
||||
command: {
|
||||
title: nls.localize('newExtensionLabel', "Show Extension \"{0}\"", extId),
|
||||
id: 'workbench.extensions.action.showExtensionsWithId',
|
||||
arguments: [extId.toLowerCase()]
|
||||
},
|
||||
range: new Range(s.keyRange.startLineNumber, 1, s.keyRange.startLineNumber, 1)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public resolveCodeLens(model: ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ICodeLensSymbol {
|
||||
return codeLens;
|
||||
}
|
||||
}
|
||||
|
||||
export interface IIndexedSetting extends ISetting {
|
||||
index: number;
|
||||
groupId: string;
|
||||
|
|
Loading…
Reference in a new issue