Skip to content

Commit 90b7869

Browse files
author
Benjamin Pasero
committed
💄
1 parent 7df0672 commit 90b7869

8 files changed

Lines changed: 20 additions & 21 deletions

File tree

src/vs/workbench/electron-browser/actions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ export abstract class BaseNavigationAction extends Action {
10371037
export class NavigateLeftAction extends BaseNavigationAction {
10381038

10391039
public static ID = 'workbench.action.navigateLeft';
1040-
public static LABEL = nls.localize('navigateLeft', "Move to the View on the Left");
1040+
public static LABEL = nls.localize('navigateLeft', "Navigate to the View on the Left");
10411041

10421042
constructor(
10431043
id: string,
@@ -1087,7 +1087,7 @@ export class NavigateLeftAction extends BaseNavigationAction {
10871087
export class NavigateRightAction extends BaseNavigationAction {
10881088

10891089
public static ID = 'workbench.action.navigateRight';
1090-
public static LABEL = nls.localize('navigateRight', "Move to the View on the Right");
1090+
public static LABEL = nls.localize('navigateRight', "Navigate to the View on the Right");
10911091

10921092
constructor(
10931093
id: string,
@@ -1137,7 +1137,7 @@ export class NavigateRightAction extends BaseNavigationAction {
11371137
export class NavigateUpAction extends BaseNavigationAction {
11381138

11391139
public static ID = 'workbench.action.navigateUp';
1140-
public static LABEL = nls.localize('navigateUp', "Move to the View Above");
1140+
public static LABEL = nls.localize('navigateUp', "Navigate to the View Above");
11411141

11421142
constructor(
11431143
id: string,
@@ -1168,7 +1168,7 @@ export class NavigateUpAction extends BaseNavigationAction {
11681168
export class NavigateDownAction extends BaseNavigationAction {
11691169

11701170
public static ID = 'workbench.action.navigateDown';
1171-
public static LABEL = nls.localize('navigateDown', "Move to the View Below");
1171+
public static LABEL = nls.localize('navigateDown', "Navigate to the View Below");
11721172

11731173
constructor(
11741174
id: string,

src/vs/workbench/parts/debug/browser/debugActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ConfigureAction extends AbstractDebugAction {
9898
}
9999

100100
public run(event?: any): TPromise<any> {
101-
if (!this.contextService.getWorkspace()) {
101+
if (!this.contextService.hasWorkspace()) {
102102
this.messageService.show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration."));
103103
return TPromise.as(null);
104104
}
@@ -137,7 +137,7 @@ export class StartAction extends AbstractDebugAction {
137137
const compound = this.debugService.getConfigurationManager().getCompound(this.debugService.getViewModel().selectedConfigurationName);
138138
return state !== State.Initializing && processes.every(p => p.name !== this.debugService.getViewModel().selectedConfigurationName) &&
139139
(!compound || !compound.configurations || processes.every(p => compound.configurations.indexOf(p.name) === -1)) &&
140-
(!this.contextService || !!this.contextService.getWorkspace() || processes.length === 0);
140+
(!this.contextService || this.contextService.hasWorkspace() || processes.length === 0);
141141
}
142142
}
143143

src/vs/workbench/parts/debug/browser/debugViewlet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class DebugViewlet extends Viewlet {
110110
public focus(): void {
111111
super.focus();
112112

113-
if (!this.contextService.getWorkspace()) {
113+
if (!this.contextService.hasWorkspace()) {
114114
this.views[0].focusBody();
115115
}
116116

@@ -123,7 +123,7 @@ export class DebugViewlet extends Viewlet {
123123
if (!this.actions) {
124124
this.actions = [];
125125
this.actions.push(this.instantiationService.createInstance(StartAction, StartAction.ID, StartAction.LABEL));
126-
if (this.contextService.getWorkspace()) {
126+
if (this.contextService.hasWorkspace()) {
127127
this.actions.push(this.instantiationService.createInstance(ConfigureAction, ConfigureAction.ID, ConfigureAction.LABEL));
128128
}
129129
this.actions.push(this.instantiationService.createInstance(ToggleReplAction, ToggleReplAction.ID, ToggleReplAction.LABEL));
@@ -137,7 +137,7 @@ export class DebugViewlet extends Viewlet {
137137
}
138138

139139
public getActionItem(action: IAction): IActionItem {
140-
if (action.id === StartAction.ID && this.contextService.getWorkspace()) {
140+
if (action.id === StartAction.ID && this.contextService.hasWorkspace()) {
141141
this.startDebugActionItem = this.instantiationService.createInstance(StartDebugActionItem, null, action);
142142
return this.startDebugActionItem;
143143
}

src/vs/workbench/parts/debug/electron-browser/debugCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function registerCommands(): void {
199199
primary: undefined,
200200
handler: (accessor) => {
201201
const manager = accessor.get(IDebugService).getConfigurationManager();
202-
if (!accessor.get(IWorkspaceContextService).getWorkspace()) {
202+
if (!accessor.get(IWorkspaceContextService).hasWorkspace()) {
203203
accessor.get(IMessageService).show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration."));
204204
return TPromise.as(null);
205205
}

src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
272272
}
273273

274274
public getCompound(name: string): debug.ICompound {
275-
if (!this.contextService.getWorkspace()) {
275+
if (!this.contextService.hasWorkspace()) {
276276
return null;
277277
}
278278

@@ -302,7 +302,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
302302
}
303303

304304
public getConfiguration(name: string): debug.IConfig {
305-
if (!this.contextService.getWorkspace()) {
305+
if (!this.contextService.hasWorkspace()) {
306306
return null;
307307
}
308308

@@ -315,7 +315,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
315315
}
316316

317317
public resloveConfiguration(config: debug.IConfig): TPromise<debug.IConfig> {
318-
if (!this.contextService.getWorkspace()) {
318+
if (!this.contextService.hasWorkspace()) {
319319
return TPromise.as(config);
320320
}
321321

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export class DebugService implements debug.IDebugService {
410410
// 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905
411411
const process = this.viewModel.focusedProcess;
412412
if (process && session && process.getId() === session.getId() && strings.equalsIgnoreCase(process.configuration.type, 'extensionhost') && this.sessionStates.get(session.getId()) === debug.State.Running &&
413-
process && this.contextService.getWorkspace() && process.configuration.noDebug) {
413+
process && this.contextService.hasWorkspace() && process.configuration.noDebug) {
414414
this.windowsService.closeExtensionHostWindow(this.contextService.getWorkspace().resource.fsPath);
415415
}
416416
if (session && session.getId() === event.body.sessionId) {
@@ -646,7 +646,7 @@ export class DebugService implements debug.IDebugService {
646646
if (commandAndType && commandAndType.command) {
647647
const defaultConfig = noDebug ? { noDebug: true } : {};
648648
return this.commandService.executeCommand(commandAndType.command, config || defaultConfig).then((result: StartSessionResult) => {
649-
if (this.contextService.getWorkspace()) {
649+
if (this.contextService.hasWorkspace()) {
650650
if (result && result.status === 'initialConfiguration') {
651651
return manager.openConfigFile(false, commandAndType.type);
652652
}
@@ -662,7 +662,7 @@ export class DebugService implements debug.IDebugService {
662662
if (config) {
663663
return this.createProcess(config);
664664
}
665-
if (this.contextService.getWorkspace() && commandAndType) {
665+
if (this.contextService.hasWorkspace() && commandAndType) {
666666
return manager.openConfigFile(false, commandAndType.type);
667667
}
668668

@@ -719,7 +719,7 @@ export class DebugService implements debug.IDebugService {
719719
});
720720
});
721721
}, err => {
722-
if (!this.contextService.getWorkspace()) {
722+
if (!this.contextService.hasWorkspace()) {
723723
return this.messageService.show(severity.Error, nls.localize('noFolderWorkspaceDebugError', "The active file can not be debugged. Make sure it is saved on disk and that you have a debug extension installed for that file type."));
724724
}
725725

@@ -803,7 +803,7 @@ export class DebugService implements debug.IDebugService {
803803
this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError);
804804
}
805805

806-
if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || !this.contextService.getWorkspace())) {
806+
if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || !this.contextService.hasWorkspace())) {
807807
// We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden
808808
this.viewModel.changedWorkbenchViewState = true;
809809
this.viewletService.openViewlet(debug.VIEWLET_ID);

src/vs/workbench/parts/tasks/node/processRunnerDetector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ export class ProcessRunnerDetector {
155155
this.taskConfiguration = config;
156156
this._stderr = [];
157157
this._stdout = [];
158-
const workspace = this.contextService.getWorkspace();
159-
this._cwd = workspace ? Paths.normalize(workspace.resource.fsPath, true) : '';
158+
this._cwd = this.contextService.hasWorkspace() ? Paths.normalize(this.contextService.getWorkspace().resource.fsPath, true) : '';
160159
}
161160

162161
public get stderr(): string[] {

src/vs/workbench/services/textfile/common/textFileEditorModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
669669
diag(`doSave(${versionId}) - after updateContent()`, this.resource, new Date());
670670

671671
// Telemetry
672-
if ((this.contextService.getWorkspace() && isEqualOrParent(this.resource.fsPath, this.contextService.toResource('.vscode').fsPath)) ||
672+
if ((this.contextService.hasWorkspace() && isEqualOrParent(this.resource.fsPath, this.contextService.toResource('.vscode').fsPath)) ||
673673
this.resource.fsPath === this.environmentService.appSettingsPath) {
674674
// Do not log write to user settings.json and .vscode folder as a filePUT event as it ruins our JSON usage data
675675
this.telemetryService.publicLog('settingsWritten');

0 commit comments

Comments
 (0)