Skip to content

Commit 48464ea

Browse files
committed
clean up
1 parent d4c2ccd commit 48464ea

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

src/vs/workbench/parts/preferences/browser/preferencesActions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ export class OpenGlobalKeybindingsFileAction extends Action {
125125
}
126126
}
127127

128-
export class OpenRawDefaultKeybindingsAction extends Action {
128+
export class OpenDefaultKeybindingsFileAction extends Action {
129129

130-
public static readonly ID = 'workbench.action.openRawDefaultKeybindings';
131-
public static readonly LABEL = nls.localize('openRawDefaultKeybindings', "Open Default Keyboard Shortcuts File");
130+
public static readonly ID = 'workbench.action.openDefaultKeybindingsFile';
131+
public static readonly LABEL = nls.localize('openDefaultKeybindingsFile', "Open Default Keyboard Shortcuts File");
132132

133133
constructor(
134134
id: string,
@@ -139,7 +139,7 @@ export class OpenRawDefaultKeybindingsAction extends Action {
139139
}
140140

141141
public run(event?: any): TPromise<any> {
142-
return this.preferencesService.openRawDefaultKeybindings();
142+
return this.preferencesService.openDefaultKeybindingsFile();
143143
}
144144
}
145145

src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { PreferencesEditor } from 'vs/workbench/parts/preferences/browser/prefer
1919
import { SettingsEditor2 } from 'vs/workbench/parts/preferences/browser/settingsEditor2';
2020
import { DefaultPreferencesEditorInput, PreferencesEditorInput, KeybindingsEditorInput, SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
2121
import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybindingsEditor';
22-
import { OpenRawDefaultKeybindingsAction, OpenRawDefaultSettingsAction, OpenSettingsAction, OpenGlobalSettingsAction, OpenGlobalKeybindingsFileAction, OpenWorkspaceSettingsAction, OpenFolderSettingsAction, ConfigureLanguageBasedSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OpenGlobalKeybindingsAction, OpenSettings2Action } from 'vs/workbench/parts/preferences/browser/preferencesActions';
22+
import { OpenDefaultKeybindingsFileAction, OpenRawDefaultSettingsAction, OpenSettingsAction, OpenGlobalSettingsAction, OpenGlobalKeybindingsFileAction, OpenWorkspaceSettingsAction, OpenFolderSettingsAction, ConfigureLanguageBasedSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OpenGlobalKeybindingsAction, OpenSettings2Action } from 'vs/workbench/parts/preferences/browser/preferencesActions';
2323
import {
2424
IKeybindingsEditor, IPreferencesSearchService, CONTEXT_KEYBINDING_FOCUS, CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_SEARCH,
2525
KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_SEARCH, CONTEXT_SETTINGS_EDITOR, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, CONTEXT_SETTINGS_SEARCH_FOCUS, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, CONTEXT_SETTINGS_FIRST_ROW_FOCUS, CONTEXT_SETTINGS_ROW_FOCUS, CONTEXT_TOC_ROW_FOCUS, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST
@@ -195,7 +195,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(OpenSettingsAction, Op
195195
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenSettings2Action, OpenSettings2Action.ID, OpenSettings2Action.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.US_COMMA }), 'Preferences: Open Settings (Preview)', category);
196196
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL), 'Preferences: Open User Settings', category);
197197
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsAction, OpenGlobalKeybindingsAction.ID, OpenGlobalKeybindingsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_S) }), 'Preferences: Open Keyboard Shortcuts', category);
198-
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRawDefaultKeybindingsAction, OpenRawDefaultKeybindingsAction.ID, OpenRawDefaultKeybindingsAction.LABEL), 'Preferences: Open Raw Default Settings', category);
198+
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenDefaultKeybindingsFileAction, OpenDefaultKeybindingsFileAction.ID, OpenDefaultKeybindingsFileAction.LABEL), 'Preferences: Open Default Keyboard Shortcuts File', category);
199199
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsFileAction, OpenGlobalKeybindingsFileAction.ID, OpenGlobalKeybindingsFileAction.LABEL, { primary: null }), 'Preferences: Open Keyboard Shortcuts File', category);
200200
registry.registerWorkbenchAction(new SyncActionDescriptor(ConfigureLanguageBasedSettingsAction, ConfigureLanguageBasedSettingsAction.ID, ConfigureLanguageBasedSettingsAction.LABEL), 'Preferences: Configure Language Specific Settings...', category);
201201

src/vs/workbench/services/preferences/browser/preferencesService.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,26 +224,24 @@ export class PreferencesService extends Disposable implements IPreferencesServic
224224
const openDefaultKeybindings = !!this.configurationService.getValue('workbench.settings.openDefaultKeybindings');
225225

226226
// Create as needed and open in editor
227-
if (openDefaultKeybindings) {
228-
return this.createIfNotExists(editableKeybindings, emptyContents).then(() => {
227+
return this.createIfNotExists(editableKeybindings, emptyContents).then(() => {
228+
if (openDefaultKeybindings) {
229229
const activeEditorGroup = this.editorGroupService.activeGroup;
230230
const sideEditorGroup = this.editorGroupService.addGroup(activeEditorGroup.id, GroupDirection.RIGHT);
231-
232231
return TPromise.join([
233232
this.editorService.openEditor({ resource: this.defaultKeybindingsResource, options: { pinned: true, preserveFocus: true }, label: nls.localize('defaultKeybindings', "Default Keybindings"), description: '' }),
234233
this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true } }, sideEditorGroup.id)
235234
]).then(editors => void 0);
236-
});
237-
}
238-
return this.createIfNotExists(editableKeybindings, emptyContents).then(() => {
239-
return this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true } }).then(editors => void 0);
235+
} else {
236+
return this.editorService.openEditor({ resource: editableKeybindings, options: { pinned: true } }).then(() => void 0);
237+
}
240238
});
241239
}
242240

243241
return this.editorService.openEditor(this.instantiationService.createInstance(KeybindingsEditorInput), { pinned: true }).then(() => null);
244242
}
245243

246-
openRawDefaultKeybindings(): TPromise<IEditor> {
244+
openDefaultKeybindingsFile(): TPromise<IEditor> {
247245
return this.editorService.openEditor({ resource: this.defaultKeybindingsResource });
248246
}
249247

src/vs/workbench/services/preferences/common/preferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export interface IPreferencesService {
152152
openFolderSettings(folder: URI, options?: IEditorOptions, group?: IEditorGroup): TPromise<IEditor>;
153153
switchSettings(target: ConfigurationTarget, resource: URI): TPromise<void>;
154154
openGlobalKeybindingSettings(textual: boolean): TPromise<void>;
155-
openRawDefaultKeybindings(): TPromise<IEditor>;
155+
openDefaultKeybindingsFile(): TPromise<IEditor>;
156156

157157
configureSettingsForLanguage(language: string): void;
158158
}

0 commit comments

Comments
 (0)