Skip to content

Commit

Permalink
Hide Python Getting Started page in the Install Extension workflow (#…
Browse files Browse the repository at this point in the history
…10794)

* hide the getting started page when installing Python Extension via the Jupyter command

* add news

Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro.local>
  • Loading branch information
IanMatthewHuff and Ian Huff authored Jul 14, 2022
1 parent dd892b5 commit 2f994c3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions news/1 Enhancements/10793.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't show the Python getting started page when installing via the Jupyter kernel picker command.
5 changes: 4 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
['vscode.openWith']: [Uri, string];
['jupyter.filterKernels']: [never];
['workbench.action.quickOpen']: [string];
['workbench.extensions.installExtension']: [Uri | 'ms-toolsai.jupyter' | 'ms-python.python'];
['workbench.extensions.installExtension']: [
Uri | 'ms-toolsai.jupyter' | 'ms-python.python',
{ context: { skipWalkthrough: boolean } }
];
['workbench.action.files.openFolder']: [];
['workbench.action.openWorkspace']: [];
['extension.open']: [string];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ import { isPythonKernelConnection } from '../../../kernels/helpers';
import { IExtensionSingleActivationService } from '../../../platform/activation/types';
import { IPythonApiProvider, IPythonExtensionChecker } from '../../../platform/api/types';
import { IApplicationShell, ICommandManager } from '../../../platform/common/application/types';
import {
Commands,
JupyterNotebookView,
PythonExtension,
PYTHON_LANGUAGE,
Telemetry
} from '../../../platform/common/constants';
import { Commands, JupyterNotebookView, PYTHON_LANGUAGE, Telemetry } from '../../../platform/common/constants';
import { ContextKey } from '../../../platform/common/contextKey';
import { IDisposableRegistry, IsWebExtension } from '../../../platform/common/types';
import { sleep } from '../../../platform/common/utils/async';
Expand Down Expand Up @@ -177,8 +171,7 @@ export class InstallPythonControllerCommands implements IExtensionSingleActivati
// Now start to indicate that we are performing the install and locating kernels
const reporter = this.progressReporter.createProgressIndicator(DataScience.installingPythonExtension());
try {
// Directly install the python extension
await this.commandManager.executeCommand('workbench.extensions.installExtension', PythonExtension);
await this.extensionChecker.directlyInstallPythonExtension();

// Don't move forward until we have hooked the API
// Note extensions.installExtension seems to return "mostly" after the install is done, but at that
Expand Down
4 changes: 3 additions & 1 deletion src/platform/api/pythonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export class PythonExtensionChecker implements IPythonExtensionChecker {

// Directly install the python extension instead of just showing the extension open page
public async directlyInstallPythonExtension(): Promise<void> {
return this.commandManager.executeCommand('workbench.extensions.installExtension', PythonExtension);
return this.commandManager.executeCommand('workbench.extensions.installExtension', PythonExtension, {
context: { skipWalkthrough: true }
});
}

// Notify the user that Python is require, and open up the Extension installation page to the
Expand Down

0 comments on commit 2f994c3

Please sign in to comment.