Skip to content

Commit

Permalink
Remove Jupyter interactive window config properties (#2788)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeM authored Apr 18, 2024
1 parent e24b59b commit edddc2f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/vs/workbench/api/common/configurationExtensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { MarkdownString } from 'vs/base/common/htmlContent';

// --- Start Positron ---
// Ignore properties contributed by vscode-jupyter related in favor of Positron code cells and console.
// TODO(seem): We can remove this if we eventually decide to unbundle vscode-jupyter.
const IGNORED_JUPYTER_CONFIGURATION_PROPERTIES = new Set([
'jupyter.decorateCells',
'jupyter.enableCellCodeLens',
'jupyter.interactiveWindow.cellMarker.codeRegex',
'jupyter.interactiveWindow.cellMarker.decorateCells',
'jupyter.interactiveWindow.cellMarker.default',
'jupyter.interactiveWindow.cellMarker.markdownRegex',
'jupyter.interactiveWindow.codeLens.commands',
'jupyter.interactiveWindow.codeLens.enable',
'jupyter.interactiveWindow.codeLens.enableGotoCell',
'jupyter.interactiveWindow.codeLes.debugCommands',
'jupyter.interactiveWindow.creationMode',
'jupyter.interactiveWindow.textEditor.autoAddNewCell',
'jupyter.interactiveWindow.textEditor.autoMoveToNextCell',
'jupyter.interactiveWindow.textEditor.cellFolding',
'jupyter.interactiveWindow.textEditor.executeSelection',
'jupyter.interactiveWindow.textEditor.magicCommandsAsComments',
'jupyter.interactiveWindow.viewColumn',
]);
// --- End Positron ---
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);

Expand Down Expand Up @@ -236,6 +259,14 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => {
configuration.properties = {};
}
for (const key in properties) {
// --- Start Positron ---
// Don't add Jupyter Interactive Window configuration properties.
// TODO(seem): We can remove this if we eventually decide to unbundle vscode-jupyter.
if (IGNORED_JUPYTER_CONFIGURATION_PROPERTIES.has(key)) {
delete properties[key];
continue;
}
// --- End Positron ---
const propertyConfiguration = properties[key];
const message = validateProperty(key, propertyConfiguration);
if (message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ import { ResolvedKeybinding } from 'vs/base/common/keybindings';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';

// --- Start Positron ---
// TODO(seem): We can remove this if we eventually decide to unbundle vscode-jupyter.
export const IGNORED_JUPYTER_COMMANDS = new Set([
// Disable commands that open an Interactive Window, since we have the Positron Console.
'jupyter.createnewinteractive',
'jupyter.debugFileInteractive',
'jupyter.execSelectionInteractive',
'jupyter.runFileInteractive',
'jupyter.runfromline',
'jupyter.runtoline',
// Disable this command which configures the Jupyter extension to run in a separate extension
// host process. We don't currently support running multiple extension host processes.
'jupyter.runInDedicatedExtensionHost',
]);
// --- End Positron ---

Expand Down

0 comments on commit edddc2f

Please sign in to comment.