Skip to content

Commit

Permalink
Ensure we load widgets from the copied directory (#10720)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jul 7, 2022
1 parent 4c36cd4 commit ff9e818
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/kernels/ipywidgets/localIPyWidgetScriptManager.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ export class LocalIPyWidgetScriptManager extends BaseIPyWidgetScriptManager impl
}
}
protected async getWidgetEntryPoints(): Promise<{ uri: Uri; widgetFolderName: string }[]> {
const [sourceNbExtensionsPath] = await Promise.all([
this.nbExtensionsPathProvider.getNbExtensionsParentPath(this.kernel)
]);
if (!sourceNbExtensionsPath) {
const nbExtensionsParentPath = await this.getNbExtensionsParentPath();
if (!nbExtensionsParentPath) {
return [];
}

// Get all of the widget entry points, which would be of the form `nbextensions/<widget folder>/extension.js`
const nbExtensionsFolder = Uri.joinPath(sourceNbExtensionsPath, 'nbextensions');
const nbExtensionsFolder = Uri.joinPath(nbExtensionsParentPath, 'nbextensions');
const extensions = await this.fs.searchLocal('*/extension.js', nbExtensionsFolder.fsPath, true);
return extensions.map((entry) => ({
uri: Uri.joinPath(nbExtensionsFolder, entry),
Expand Down

0 comments on commit ff9e818

Please sign in to comment.