Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
([#11021](https://github.com/Microsoft/vscode-python/issues/11021))
1. Hide "untrusted" interpreters from 'Select interpreter' dropdown list when in DeprecatePythonPath Experiment.
([#11046](https://github.com/Microsoft/vscode-python/issues/11046))
1. Make spacing of icons on notebook toolbars match spacing on other VS code toolbars.
([#10464](https://github.com/Microsoft/vscode-python/issues/10464))
1. Make jupyter server status centered in the UI and use the same font as the rest of VS code.
([#10465](https://github.com/Microsoft/vscode-python/issues/10465))
1. Performa validation of interpreter only when a Notebook is opened instead of when extension activates.
([#10893](https://github.com/Microsoft/vscode-python/issues/10893))
1. Scrolling in cells doesn't happen on new line.
([#10952](https://github.com/Microsoft/vscode-python/issues/10952))
1. Ensure images in workspace folder are supported within markdown cells in a `Notebook`.
([#11040](https://github.com/Microsoft/vscode-python/issues/11040))
1. Make sure ipywidgets have a white background so they display in dark themes.
([#11060](https://github.com/Microsoft/vscode-python/issues/11060))
1. Arrowing down through cells put the cursor in the wrong spot.
([#11094](https://github.com/Microsoft/vscode-python/issues/11094))

### Fixes

Expand Down
1 change: 1 addition & 0 deletions build/conda-functional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ pythreejs
ipyvolume
beakerx
bqplot
K3D
8 changes: 0 additions & 8 deletions build/webpack/webpack.datascience-ui.config.builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ function buildConfiguration(isNotebook) {
{
from: path.join(constants.ExtensionRootDir, 'node_modules/font-awesome/**/*'),
to: path.join(constants.ExtensionRootDir, 'out', 'datascience-ui', 'common', 'node_modules')
},
{
from: path.join(constants.ExtensionRootDir, 'out/ipywidgets/azureml/azuremlindex.js'),
to: path.join(constants.ExtensionRootDir, 'out', 'datascience-ui', bundleFolder)
},
{
from: path.join(constants.ExtensionRootDir, 'out/ipywidgets/azureml/azuremlregistration.js'),
to: path.join(constants.ExtensionRootDir, 'out', 'datascience-ui', bundleFolder)
}
]
);
Expand Down
1 change: 0 additions & 1 deletion news/2 Fixes/10464.md

This file was deleted.

1 change: 0 additions & 1 deletion news/2 Fixes/10465.md

This file was deleted.

1 change: 0 additions & 1 deletion news/2 Fixes/10952.md

This file was deleted.

1 change: 0 additions & 1 deletion news/2 Fixes/11060.md

This file was deleted.

1 change: 0 additions & 1 deletion news/2 Fixes/11094.md

This file was deleted.

97 changes: 77 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1636,10 +1636,22 @@
"description": "Allows a user to import a jupyter notebook into a python file anytime one is opened.",
"scope": "resource"
},
"python.dataScience.loadWidgetScriptsFromThirdPartySource": {
"type": "boolean",
"default": false,
"description": "Enables loading of scripts files for Widgets (ipywidgest, bqplot, beakerx, ipyleaflet, etc) from https://unpkg.com.",
"python.dataScience.widgetScriptSources": {
"type": "array",
"default": [],
"items": {
"type": "string",
"enum": [
"jsdelivr.com",
"unpkg.com"
],
"enumDescriptions": [
"Loads widget (javascript) scripts from https://www.jsdelivr.com/",
"Loads widget (javascript) scripts from https://unpkg.com/"
]
},
"uniqueItems": true,
"markdownDescription": "Defines the location and order of the sources where scripts files for Widgets are downloaded from (e.g. ipywidgest, bqplot, beakerx, ipyleaflet, etc). Not selecting any of these could result in widgets not rendering or function correctly. See [here](https://aka.ms/PVSCIPyWidgets) for more information. Once updated you will need to restart the Kernel.",
"scope": "machine"
},
"python.dataScience.gatherRules": {
Expand Down Expand Up @@ -2995,6 +3007,7 @@
"request": "^2.87.0",
"request-progress": "^3.0.0",
"rxjs": "^5.5.9",
"sanitize-filename": "^1.6.3",
"semver": "^5.5.0",
"stack-trace": "0.0.10",
"string-argv": "^0.3.1",
Expand Down Expand Up @@ -3171,7 +3184,7 @@
"node-has-native-dependencies": "^1.0.2",
"node-html-parser": "^1.1.13",
"nyc": "^15.0.0",
"playwright": "^0.11.1",
"playwright-chromium": "^0.13.0",
"postcss": "^7.0.27",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.1",
Expand All @@ -3195,7 +3208,6 @@
"requirejs": "^2.3.6",
"rewiremock": "^3.13.0",
"rimraf": "^3.0.2",
"sanitize-filename": "^1.6.3",
"sass-loader": "^7.1.0",
"serialize-javascript": "^2.1.2",
"shortid": "^2.2.8",
Expand Down
6 changes: 4 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"Common.reload": "Reload",
"Common.moreInfo": "More Info",
"Common.and": "and",
"Common.ok": "Ok",
"Common.install": "Install",
"Common.learnMore": "Learn more",
"OutputChannelNames.languageServer": "Python Language Server",
Expand Down Expand Up @@ -464,6 +465,7 @@
"DataScience.jupyterSelectURIRemoteDetail": "Specify the URI of an existing server",
"DataScience.gatherQuality": "Did gather work as desired?",
"DataScience.loadClassFailedWithNoInternet": "Error loading {0}:{1}. Internet connection required for loading 3rd party widgets.",
"DataScience.loadThirdPartyWidgetScriptsDisabled": "Loading of Widgets is disabled by default. Click <a href='https://command:python.datascience.loadWidgetScriptsFromThirdPartySource'>here</a> to enable the setting 'python.dataScience.loadWidgetScriptsFromThirdPartySource'. Once enabled you will need to restart the Kernel",
"DataScience.loadThirdPartyWidgetScriptsPostEnabled": "Please restart the Kernel when changing the setting 'loadWidgetScriptsFromThirdPartySource'."
"DataScience.useCDNForWidgets": "Widgets require us to download supporting files from a 3rd party website. Click [here](https://aka.ms/PVSCIPyWidgets) for more information.",
"DataScience.loadThirdPartyWidgetScriptsPostEnabled": "Please restart the Kernel when changing the setting 'python.dataScience.widgetScriptSources'.",
"DataScience.enableCDNForWidgetsSetting": "Widgets require us to download supporting files from a 3rd party website. Click <a href='https://command:python.datascience.enableLoadingWidgetScriptsFromThirdPartySource'>here</a> to enable this or click <a href='https://aka.ms/PVSCIPyWidgets'>here</a> for more information. (Error loading {0}:{1})."
}
17 changes: 17 additions & 0 deletions src/client/common/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,18 @@ export type WebPanelMessage = {
// Wraps the VS Code webview panel
export const IWebPanel = Symbol('IWebPanel');
export interface IWebPanel {
/**
* Convert a uri for the local file system to one that can be used inside webviews.
*
* Webviews cannot directly load resources from the workspace or local file system using `file:` uris. The
* `asWebviewUri` function takes a local `file:` uri and converts it into a uri that can be used inside of
* a webview to load the same resource:
*
* ```ts
* webview.html = `<img src="${webview.asWebviewUri(vscode.Uri.file('/Users/codey/workspace/cat.gif'))}">`
* ```
*/
asWebviewUri(localResource: Uri): Uri;
setTitle(val: string): void;
/**
* Makes the webpanel show up.
Expand Down Expand Up @@ -1082,6 +1094,11 @@ export interface IWebPanelOptions {
listener: IWebPanelMessageListener;
title: string;
rootPath: string;
/**
* Additional paths apart from cwd and rootPath, that webview would allow loading resources/files from.
* E.g. required for webview to serve images from worksapces when nb is in a nested folder.
*/
additionalPaths?: string[];
scripts: string[];
startHttpServer: boolean;
cwd: string;
Expand Down
13 changes: 10 additions & 3 deletions src/client/common/application/webPanels/webPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export class WebPanel implements IWebPanel {
private disposableRegistry: IDisposableRegistry,
private port: number | undefined,
private token: string | undefined,
private options: IWebPanelOptions
private options: IWebPanelOptions,
additionalRootPaths: Uri[] = []
) {
const webViewOptions: WebviewOptions = {
enableScripts: true,
localResourceRoots: [Uri.file(this.options.rootPath), Uri.file(this.options.cwd)],
localResourceRoots: [Uri.file(this.options.rootPath), Uri.file(this.options.cwd), ...additionalRootPaths],
portMapping: port ? [{ webviewPort: RemappedPort, extensionHostPort: port }] : undefined
};
if (options.webViewPanel) {
Expand Down Expand Up @@ -71,6 +72,12 @@ export class WebPanel implements IWebPanel {
this.panel.dispose();
}
}
public asWebviewUri(localResource: Uri) {
if (!this.panel) {
throw new Error('WebView not initialized, too early to get a Uri');
}
return this.panel?.webview.asWebviewUri(localResource);
}

public isVisible(): boolean {
return this.panel ? this.panel.visible : false;
Expand Down Expand Up @@ -161,7 +168,7 @@ export class WebPanel implements IWebPanel {
<meta name="theme" content="${Identifiers.GeneratedThemeName}"/>
<title>VS Code Python React UI</title>
<base href="${uriBase}${uriBase.endsWith('/') ? '' : '/'}"/>
<link rel="stylesheet" href="${rootPath}/../common/node_modules/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="${rootPath}/../common/node_modules/font-awesome/css/font-awesome.min.css">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Loading