diff --git a/src/platform/common/net/httpClient.ts b/src/platform/common/net/httpClient.ts index a35a206b46d..bca967cdd37 100644 --- a/src/platform/common/net/httpClient.ts +++ b/src/platform/common/net/httpClient.ts @@ -11,9 +11,12 @@ import * as fetch from 'cross-fetch'; @injectable() export class HttpClient implements IHttpClient { - public readonly requestOptions: RequestInit; + public readonly requestOptions: RequestInit = {}; constructor(@inject(IWorkspaceService) workspaceService: IWorkspaceService) { - this.requestOptions = { headers: { proxy: workspaceService.getConfiguration('http').get('proxy', '') } }; + const proxy = workspaceService.getConfiguration('http').get('proxy', ''); + if (proxy) { + this.requestOptions = { headers: { proxy: workspaceService.getConfiguration('http').get('proxy', '') } }; + } } public async downloadFile(uri: string): Promise { diff --git a/src/platform/common/platform/fileSystem.ts b/src/platform/common/platform/fileSystem.ts index d3aaff3c43b..8cfcd11e7a6 100644 --- a/src/platform/common/platform/fileSystem.ts +++ b/src/platform/common/platform/fileSystem.ts @@ -34,7 +34,9 @@ export class FileSystem implements IFileSystem { } async getFiles(dir: vscode.Uri): Promise { + console.log('getFiles', { dir }); const files = await this.vscfs.readDirectory(dir); + console.log({ files }); return files.filter((f) => f[1] === vscode.FileType.File).map((f) => vscode.Uri.file(f[0])); } diff --git a/src/webviews/extension-side/variablesView/variableView.ts b/src/webviews/extension-side/variablesView/variableView.ts index e88b11f1ec9..a004801f5fe 100644 --- a/src/webviews/extension-side/variablesView/variableView.ts +++ b/src/webviews/extension-side/variablesView/variableView.ts @@ -35,7 +35,6 @@ import { Telemetry } from '../../webview-side/common/constants'; import { DataViewerChecker } from '../dataviewer/dataViewerChecker'; import { IJupyterVariableDataProviderFactory, IDataViewerFactory, IDataViewer } from '../dataviewer/types'; import { WebviewViewHost } from '../webviewViewHost'; -import { joinPath } from '../../../platform/vscode-path/resources'; // This is the client side host for the native notebook variable view webview // It handles passing messages to and from the react view as well as the connection @@ -59,14 +58,14 @@ export class VariableView extends WebviewViewHost imp private readonly commandManager: ICommandManager, private readonly documentManager: IDocumentManager ) { - const variableViewDir = joinPath(context.extensionUri, 'out', 'webviews', 'webview-side', 'viewers'); + const variableViewDir = Uri.joinPath(context.extensionUri, 'out', 'webviews', 'webview-side', 'viewers'); super( configuration, workspaceService, (c, d) => new VariableViewMessageListener(c, d), provider, variableViewDir, - [joinPath(variableViewDir, 'variableView.js')] + [Uri.joinPath(variableViewDir, 'variableView.js')] ); // Sign up if the active variable view notebook is changed, restarted or updated diff --git a/src/webviews/extension-side/webviews/webview.ts b/src/webviews/extension-side/webviews/webview.ts index d21807b9aaa..915d26b1db4 100644 --- a/src/webviews/extension-side/webviews/webview.ts +++ b/src/webviews/extension-side/webviews/webview.ts @@ -72,13 +72,24 @@ export abstract class Webview implements IWebview { // eslint-disable-next-line @typescript-eslint/no-explicit-any protected async generateLocalReactHtml() { + console.log('AAAAAA'); if (!this.webviewHost?.webview) { throw new Error('WebView not initialized, too early to get a Uri'); } + console.log('BBBBBB'); const uriBase = this.webviewHost?.webview.asWebviewUri(this.options.cwd).toString(); + console.log({ uriBase }); const uris = this.options.scripts.map((script) => this.webviewHost!.webview!.asWebviewUri(script)); - const testFiles = await this.fs.getFiles(this.options.rootPath); + console.log({ uris }); + let testFiles: Uri[] = []; + try { + testFiles = await this.fs.getFiles(this.options.rootPath); + } catch (e) { + console.log(e); + } + + console.log({ testFiles }); // This method must be called so VSC is aware of files that can be pulled. // Allow js and js.map files to be loaded by webpack in the webview. @@ -103,6 +114,7 @@ export abstract class Webview implements IWebview { ) ) .toString(); + console.log({ rootPath, fontAwesomePath }); // Change to `true` to force on Test middleware for our react code const forceTestMiddleware = 'false'; @@ -148,6 +160,7 @@ export abstract class Webview implements IWebview { try { if (this.webviewHost?.webview) { const localFilesExist = await Promise.all(this.options.scripts.map((s) => this.fs.exists(s))); + console.log({ scripts: this.options.scripts, localFilesExist }); if (localFilesExist.every((exists) => exists === true)) { // Call our special function that sticks this script inside of an html page // and translates all of the paths to vscode-resource URIs