Ignore the launch.json save error when clicking run/debug codelens (#673)
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
This commit is contained in:
parent
a9da070895
commit
631236e908
|
@ -150,9 +150,15 @@ async function constructDebugConfig(mainClass: string, projectName: string, work
|
||||||
|
|
||||||
// Persist the default debug configuration only if the workspace exists.
|
// Persist the default debug configuration only if the workspace exists.
|
||||||
if (workspace) {
|
if (workspace) {
|
||||||
// Insert the default debug configuration to the beginning of launch.json.
|
try {
|
||||||
rawConfigs.splice(0, 0, debugConfig);
|
// Insert the default debug configuration to the beginning of launch.json.
|
||||||
await launchConfigurations.update("configurations", rawConfigs, vscode.ConfigurationTarget.WorkspaceFolder);
|
rawConfigs.splice(0, 0, debugConfig);
|
||||||
|
await launchConfigurations.update("configurations", rawConfigs, vscode.ConfigurationTarget.WorkspaceFolder);
|
||||||
|
} catch (error) {
|
||||||
|
// When launch.json has unsaved changes before invoking the update api, it will throw the error below:
|
||||||
|
// 'Unable to write into launch configuration file because the file is dirty. Please save it first and then try again.'
|
||||||
|
// It's safe to ignore it because the only impact is the configuration is not saved, but you can continue to start the debugger.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue