mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-22 08:09:42 +01:00
@@ -337,6 +337,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
|
||||
|
||||
public openConfigFile(sideBySide: boolean): TPromise<boolean> {
|
||||
const resource = uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '/.vscode/launch.json'));
|
||||
let configFileCreated = false;
|
||||
|
||||
return this.fileService.resolveContent(resource).then(content => true, err =>
|
||||
this.getInitialConfigFileContent().then(content => {
|
||||
@@ -344,10 +345,11 @@ export class ConfigurationManager implements debug.IConfigurationManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
configFileCreated = true;
|
||||
return this.fileService.updateContent(resource, content).then(() => true);
|
||||
}
|
||||
)).then(configFileCreated => {
|
||||
if (!configFileCreated) {
|
||||
)).then(errorFree => {
|
||||
if (!errorFree) {
|
||||
return false;
|
||||
}
|
||||
this.telemetryService.publicLog('debugConfigure');
|
||||
@@ -355,8 +357,9 @@ export class ConfigurationManager implements debug.IConfigurationManager {
|
||||
return this.editorService.openEditor({
|
||||
resource: resource,
|
||||
options: {
|
||||
forceOpen: true
|
||||
}
|
||||
forceOpen: true,
|
||||
pinned: configFileCreated // pin only if config file is created #8727
|
||||
},
|
||||
}, sideBySide).then(() => true);
|
||||
}, (error) => {
|
||||
throw new Error(nls.localize('DebugConfig.failed', "Unable to create 'launch.json' file inside the '.vscode' folder ({0}).", error));
|
||||
|
||||
@@ -202,6 +202,7 @@ class ConfigureTaskRunnerAction extends Action {
|
||||
return TPromise.as(undefined);
|
||||
}
|
||||
let sideBySide = !!(event && (event.ctrlKey || event.metaKey));
|
||||
let configFileCreated = false;
|
||||
return this.fileService.resolveFile(this.contextService.toResource('.vscode/tasks.json')).then((success) => {
|
||||
return success;
|
||||
}, (err:any) => {
|
||||
@@ -247,6 +248,7 @@ class ConfigureTaskRunnerAction extends Action {
|
||||
if (editorConfig.editor.insertSpaces) {
|
||||
content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize));
|
||||
}
|
||||
configFileCreated = true;
|
||||
return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content);
|
||||
});
|
||||
});
|
||||
@@ -258,7 +260,8 @@ class ConfigureTaskRunnerAction extends Action {
|
||||
return this.editorService.openEditor({
|
||||
resource: stat.resource,
|
||||
options: {
|
||||
forceOpen: true
|
||||
forceOpen: true,
|
||||
pinned: configFileCreated // pin only if config file is created #8727
|
||||
}
|
||||
}, sideBySide);
|
||||
}, (error) => {
|
||||
|
||||
Reference in New Issue
Block a user