mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix: Switching powershell notebooks reset kernel.json and failed to resolve kernel paths. (#13026)
* Set python path in kernel specs when running on SAW devices. * Use tab spacer for kernel json. * Update path to jupyter kernelspec. * removing the kernelspec write * Changed powershell kernel.json to use appdata folder * Addressed PR and added try catches around the code. * removed redundant try catch * removed redundant try catch * removed another try catch * removed space * Fix for multiple powershell notebook failing issue Co-authored-by: Cory Rivera <corivera@microsoft.com>
This commit is contained in:
@@ -80,8 +80,6 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
|
|
||||||
private readonly _runningOnSAW: boolean;
|
private readonly _runningOnSAW: boolean;
|
||||||
|
|
||||||
private _kernelSpecsUpdated = false;
|
|
||||||
|
|
||||||
constructor(extensionPath: string, outputChannel: vscode.OutputChannel) {
|
constructor(extensionPath: string, outputChannel: vscode.OutputChannel) {
|
||||||
this.extensionPath = extensionPath;
|
this.extensionPath = extensionPath;
|
||||||
this.outputChannel = outputChannel;
|
this.outputChannel = outputChannel;
|
||||||
@@ -717,7 +715,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async updateKernelSpecPaths(kernelsFolder: string): Promise<void> {
|
public async updateKernelSpecPaths(kernelsFolder: string): Promise<void> {
|
||||||
if (!this._runningOnSAW || this._kernelSpecsUpdated) {
|
if (!this._runningOnSAW) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let fileNames = await fs.readdir(kernelsFolder);
|
let fileNames = await fs.readdir(kernelsFolder);
|
||||||
@@ -726,7 +724,6 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
let folderPaths = filePaths.filter((value, index) => value && fileStats[index].isDirectory());
|
let folderPaths = filePaths.filter((value, index) => value && fileStats[index].isDirectory());
|
||||||
let kernelFiles = folderPaths.map(folder => path.join(folder, 'kernel.json'));
|
let kernelFiles = folderPaths.map(folder => path.join(folder, 'kernel.json'));
|
||||||
await Promise.all(kernelFiles.map(file => this.updateKernelSpecPath(file)));
|
await Promise.all(kernelFiles.map(file => this.updateKernelSpecPath(file)));
|
||||||
this._kernelSpecsUpdated = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateKernelSpecPath(kernelPath: string): Promise<void> {
|
private async updateKernelSpecPath(kernelPath: string): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user