Skip to content

Commit

Permalink
Port #6503 and #6504 to release (#6507)
Browse files Browse the repository at this point in the history
* Don't pass registrationData twice when registering notebook serializer (#6503)

* If in Python daily insiders and VS Code Insiders opt into native interactive window (#6504)

* If in Python daily insiders and VS Code Insiders opt into native interactive window

* Oops

* Remove unused import

* Changelog

* Format
  • Loading branch information
joyceerhl authored Jul 2, 2021
1 parent b60e3a1 commit 0acfc63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
([#6183](https://github.com/Microsoft/vscode-jupyter/issues/6183))
1. Added a preview to run by line and debugging in native notebooks. Set the `jupyter.experimental.debugging` setting to true, install ipykernel 6 on your selected kernel and a `debug` button will appear. Pressing it will start a debugging session and let you set and hit breakpoints.
([#5607](https://github.com/microsoft/vscode-jupyter/issues/5607))
1. Add `jupyter.enableNativeInteractiveWindow` setting to opt into the preview native interactive window experience, with support for VS Code customizations like keybindings, themes, snippets and more.([#1388](https://github.com/microsoft/vscode-jupyter/issues/1388))

### Fixes

Expand Down
5 changes: 1 addition & 4 deletions src/client/common/application/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ export class VSCodeNotebook implements IVSCodeNotebook {
serializer: NotebookSerializer,
options?: NotebookDocumentContentOptions
): Disposable {
return workspace.registerNotebookSerializer(notebookType, serializer, options, {
displayName: 'Jupyter',
filenamePattern: ['*.ipynb']
});
return workspace.registerNotebookSerializer(notebookType, serializer, options);
}
public createNotebookController(
id: string,
Expand Down
11 changes: 9 additions & 2 deletions src/client/datascience/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,15 @@ export function registerTypes(serviceManager: IServiceManager, inNotebookApiExpe
serviceManager.addSingleton<IExtensionSingleActivationService>(IExtensionSingleActivationService, MigrateJupyterInterpreterStateService);
serviceManager.addSingleton<IExtensionSingleActivationService>(IExtensionSingleActivationService, VariableViewActivationService);
serviceManager.addSingleton<IInteractiveWindowListener>(IInteractiveWindowListener, DataScienceSurveyBannerLogger);
const jupyterConfiguration = workspace.getConfiguration('jupyter');
if (jupyterConfiguration.get<boolean>('experiments.enabled') === true && jupyterConfiguration.get<boolean>('enableNativeInteractiveWindow') === true) {
const configuration = workspace.getConfiguration();
if (
configuration.get<boolean>('jupyter.experiments.enabled') === true &&
!configuration.get<string[]>('jupyter.experiments.optOutFrom')?.includes('All') &&
// If in Daily Insiders channel and in VS Code Insiders, opt in by default
((configuration.get<string>('python.insidersChannel') === 'daily' && isVSCInsiders) ||
// If user explicitly asked to be in the experiment, also opt in
configuration.get<boolean>('jupyter.enableNativeInteractiveWindow') === true)
) {
serviceManager.addSingleton<IInteractiveWindowProvider>(IInteractiveWindowProvider, NativeInteractiveWindowProvider);
serviceManager.addSingleton<IDataScienceCommandListener>(IDataScienceCommandListener, NativeInteractiveWindowCommandListener);
} else {
Expand Down

0 comments on commit 0acfc63

Please sign in to comment.