mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Provide setting to not show read-only full settings buffer when opening Settings (fixes #9904)
This commit is contained in:
@@ -28,6 +28,14 @@ import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
|
||||
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
|
||||
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
|
||||
|
||||
export interface IWorkbenchSettingsConfiguration {
|
||||
workbench: {
|
||||
settings: {
|
||||
openDefaultSettings: boolean;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class BaseTwoEditorsAction extends Action {
|
||||
|
||||
constructor(
|
||||
@@ -95,7 +103,16 @@ export class BaseOpenSettingsAction extends BaseTwoEditorsAction {
|
||||
}
|
||||
|
||||
protected open(emptySettingsContents: string, settingsResource: URI): TPromise<void> {
|
||||
return this.openTwoEditors(DefaultSettingsInput.getInstance(this.instantiationService, this.configurationService), settingsResource, emptySettingsContents);
|
||||
const openDefaultSettings = !!this.configurationService.getConfiguration<IWorkbenchSettingsConfiguration>().workbench.settings.openDefaultSettings;
|
||||
|
||||
if (openDefaultSettings) {
|
||||
return this.openTwoEditors(DefaultSettingsInput.getInstance(this.instantiationService, this.configurationService), settingsResource, emptySettingsContents);
|
||||
}
|
||||
|
||||
return this.editorService.openEditor({
|
||||
resource: settingsResource,
|
||||
options: { pinned: true }
|
||||
}).then(() => null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import {TextDiffEditor} from 'vs/workbench/browser/parts/editor/textDiffEditor';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binaryDiffEditor';
|
||||
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
|
||||
import {IConfigurationRegistry, Extensions as ConfigurationExtensions} from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import {ChangeEncodingAction, ChangeEOLAction, ChangeModeAction, EditorStatus} from 'vs/workbench/browser/parts/editor/editorStatus';
|
||||
import {IWorkbenchActionRegistry, Extensions as ActionExtensions} from 'vs/workbench/common/actionRegistry';
|
||||
import {Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor} from 'vs/workbench/browser/actionBarRegistry';
|
||||
@@ -329,37 +328,5 @@ function toKeyCode(index: number): KeyCode {
|
||||
}
|
||||
}
|
||||
|
||||
// Configuration
|
||||
const configurationRegistry = <IConfigurationRegistry>Registry.as(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': 'workbench',
|
||||
'order': 7,
|
||||
'title': nls.localize('workbenchConfigurationTitle', "Workbench"),
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'workbench.editor.showTabs': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('showEditorTabs', "Controls if opened editors should show in tabs or not."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.enablePreview': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('enablePreview', "Controls if opened editors show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.enablePreviewFromQuickOpen': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('enablePreviewFromQuickOpen', "Controls if opened editors from quick open show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.openPositioning': {
|
||||
'type': 'string',
|
||||
'enum': ['left', 'right', 'first', 'last'],
|
||||
'default': 'right',
|
||||
'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'first' or 'last' to open editors independently from the currently active one.")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Editor Commands
|
||||
editorCommands.setup();
|
||||
@@ -54,8 +54,44 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
}
|
||||
});
|
||||
|
||||
// Configuration: Window
|
||||
// Configuration: Workbench
|
||||
const configurationRegistry = <IConfigurationRegistry>Registry.as(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': 'workbench',
|
||||
'order': 7,
|
||||
'title': nls.localize('workbenchConfigurationTitle', "Workbench"),
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'workbench.editor.showTabs': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('showEditorTabs', "Controls if opened editors should show in tabs or not."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.enablePreview': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('enablePreview', "Controls if opened editors show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.enablePreviewFromQuickOpen': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('enablePreviewFromQuickOpen', "Controls if opened editors from quick open show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."),
|
||||
'default': true
|
||||
},
|
||||
'workbench.editor.openPositioning': {
|
||||
'type': 'string',
|
||||
'enum': ['left', 'right', 'first', 'last'],
|
||||
'default': 'right',
|
||||
'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'first' or 'last' to open editors independently from the currently active one.")
|
||||
},
|
||||
'workbench.settings.openDefaultSettings': {
|
||||
'type': 'boolean',
|
||||
'description': nls.localize('openDefaultSettings', "Controls if opening settings also opens an editor showing all default settings."),
|
||||
'default': true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Configuration: Window
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': 'window',
|
||||
'order': 8,
|
||||
|
||||
Reference in New Issue
Block a user