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
445 changes: 222 additions & 223 deletions .github/instructions/ipywidgets.instructions.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ See [here](https://code.visualstudio.com/api/references/vscode-api#extensions) f
import { extensions } from 'vscode';
import type { JupyterAPI } from '@vscode/jupyter';

const jupyterApi = extensions.getExtension<JupyterAPI>('ms-jupyter.jupyter')?.exports;
const jupyterApi = extensions.getExtension<JupyterAPI>('Deepnote.vscode-deepnote')?.exports;
```

4 changes: 2 additions & 2 deletions build/preDebugWebTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ async function go() {
if (!url) {
const info = await startJupyter(true);
url = info.url;
fs.writeFileSync(path.join(__dirname, '..', 'temp', 'jupyter.pid'), info.server.pid.toString());
fs.writeFileSync(path.join(__dirname, '..', 'temp', 'deepnote.pid'), info.server.pid.toString());
} else {
console.log('Jupyter server URL provided in env args, no need to start one');
}
const settingsJson = fs.readFileSync(settingsFile).toString();
const edits = jsonc.modify(settingsJson, ['jupyter.DEBUG_JUPYTER_SERVER_URI'], url, {});
const edits = jsonc.modify(settingsJson, ['deepnote.DEBUG_JUPYTER_SERVER_URI'], url, {});
const updatedSettingsJson = jsonc.applyEdits(settingsJson, edits);
fs.writeFileSync(settingsFile, updatedSettingsJson);
process.exit(0);
Expand Down
1,208 changes: 581 additions & 627 deletions package.json

Large diffs are not rendered by default.

342 changes: 171 additions & 171 deletions package.nls.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export interface ICommandNameArgumentTypeMapping {
['workbench.extensions.search']: [string];
['editor.action.formatDocument']: [];
['editor.action.rename']: [];
['jupyter.selectJupyterInterpreter']: [];
['deepnote.selectJupyterInterpreter']: [];
['dataScience.ClearUserProviderJupyterServerCache']: [];
['jupyterViewVariables.focus']: [];
['jupyter.selectLocalJupyterServer']: [] | [undefined | string];
['workbench.action.openSettings']: ['jupyter.kernels.excludePythonEnvironments'];
['jupyter.getUsedAzMLServerHandles']: [];
['deepnoteViewVariables.focus']: [];
['deepnote.selectLocalJupyterServer']: [] | [undefined | string];
['workbench.action.openSettings']: ['deepnote.kernels.excludePythonEnvironments'];
['deepnote.getUsedAzMLServerHandles']: [];
[DSCommands.RunCurrentCell]: [];
[DSCommands.RunCurrentCellAdvance]: [];
[DSCommands.CreateNewInteractive]: [];
Expand Down Expand Up @@ -76,7 +76,7 @@ export interface ICommandNameArgumentTypeMapping {
['notebook.cell.collapseCellOutput']: [];
['notebook.cell.expandCellOutput']: [];
['vscode.openWith']: [Uri, string];
['jupyter.filterKernels']: [never];
['deepnote.filterKernels']: [never];
['workbench.action.quickOpen']: [string];
['workbench.extensions.installExtension']: [
Uri | 'ms-toolsai.jupyter' | 'ms-python.python',
Expand All @@ -85,9 +85,9 @@ export interface ICommandNameArgumentTypeMapping {
['workbench.action.files.openFolder']: [];
['workbench.action.openWorkspace']: [];
['extension.open']: [string];
['setContext']: [string, ContextKeyValue] | ['jupyter.vscode.channel', Channel];
['jupyter.reloadVSCode']: [string];
['jupyter.runInDedicatedExtensionHost']: [string];
['setContext']: [string, ContextKeyValue] | ['deepnote.vscode.channel', Channel];
['deepnote.reloadVSCode']: [string];
['deepnote.runInDedicatedExtensionHost']: [string];
['revealLine']: [{ lineNumber: number; at: 'top' | 'center' | 'bottom' }];
['python._loadLanguageServerExtension']: {}[];
['python.SelectAndInsertDebugConfiguration']: [TextDocument, Position, CancellationToken];
Expand Down
2 changes: 1 addition & 1 deletion src/extension.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export async function postActivateLegacy(context: IExtensionContext, serviceCont
sendTelemetryEvent(Telemetry.ExperimentLoad, { duration });

// "initialize" "services"
commands.executeCommand('setContext', 'jupyter.vscode.channel', getVSCodeChannel()).then(noop, noop);
commands.executeCommand('setContext', 'deepnote.vscode.channel', getVSCodeChannel()).then(noop, noop);

// "activate" everything else
serviceContainer.get<IExtensionActivationManager>(IExtensionActivationManager).activate();
Expand Down
6 changes: 3 additions & 3 deletions src/extension.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ async function activateLegacy(
const isDevMode =
!isTestExecution() &&
(context.extensionMode === ExtensionMode.Development ||
workspace.getConfiguration('jupyter').get<boolean>('development', false));
workspace.getConfiguration('deepnote').get<boolean>('development', false));
serviceManager.addSingletonInstance<boolean>(IsDevMode, isDevMode);
if (isDevMode) {
commands.executeCommand('setContext', 'jupyter.development', true).then(noop, noop);
commands.executeCommand('setContext', 'deepnote.development', true).then(noop, noop);
}
commands.executeCommand('setContext', 'jupyter.webExtension', false).then(noop, noop);
commands.executeCommand('setContext', 'deepnote.webExtension', false).then(noop, noop);

// Set the logger home dir (we can compute this in a node app)
setHomeDirectory(homedir());
Expand Down
6 changes: 3 additions & 3 deletions src/extension.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ async function activateLegacy(
// register "services"
const isDevMode =
context.extensionMode === ExtensionMode.Development ||
workspace.getConfiguration('jupyter').get<boolean>('development', false);
workspace.getConfiguration('deepnote').get<boolean>('development', false);

serviceManager.addSingletonInstance<boolean>(IsDevMode, isDevMode);
if (isDevMode) {
commands.executeCommand('setContext', 'jupyter.development', true).then(noop, noop);
commands.executeCommand('setContext', 'deepnote.development', true).then(noop, noop);
}
commands.executeCommand('setContext', 'jupyter.webExtension', true).then(noop, noop);
commands.executeCommand('setContext', 'deepnote.webExtension', true).then(noop, noop);

// Register the rest of the types (platform is first because it's needed by others)
registerPlatformTypes(serviceManager);
Expand Down
2 changes: 1 addition & 1 deletion src/interactive-window/commands/commandRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export class CommandRegistry implements IDisposable, IExtensionSyncActivationSer
private async openVariableView(): Promise<void> {
// For all contributed views vscode creates a command with the format [view ID].focus to focus that view
// It's the given way to focus a single view so using that here, note that it needs to match the view ID
return commands.executeCommand('jupyterViewVariables.focus');
return commands.executeCommand('deepnoteViewVariables.focus');
}

// Open the VS Code outline view
Expand Down
4 changes: 2 additions & 2 deletions src/interactive-window/editor-integration/cellRangeCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class CellRangeCache implements ICellRangeCache {
) {
// set the context to false so our command doesn't run for other files
const hasCellsContext = new ContextKey(EditorContexts.HasCodeCells);
hasCellsContext.set(false).catch((ex) => logger.warn('Failed to set jupyter.HasCodeCells context', ex));
hasCellsContext.set(false).catch((ex) => logger.warn('Failed to set deepnote.HasCodeCells context', ex));
this.updateContextKeys(false);
} else {
this.updateContextKeys(activeEditor.document);
Expand All @@ -71,7 +71,7 @@ export class CellRangeCache implements ICellRangeCache {
private onSettingChanged(e: ConfigurationChangeEvent) {
this.cache.clear();

if (e.affectsConfiguration('jupyter.interactiveWindow.textEditor.executeSelection')) {
if (e.affectsConfiguration('deepnote.interactiveWindow.textEditor.executeSelection')) {
const settings = this.configService.getSettings(undefined);
this.cachedOwnsSetting = settings.sendSelectionToInteractiveWindow;
this.updateContextKeys();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ suite('DataScienceCodeLensProvider Unit Tests', () => {
createCodeLensFactory().getCellRanges(document.object);

// verify context keys set
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.hascodecells', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.hascodecells', true)).atLeast(1);
});

test('Having no code lenses will set context keys to false', async () => {
Expand All @@ -68,8 +68,8 @@ suite('DataScienceCodeLensProvider Unit Tests', () => {
createCodeLensFactory().getCellRanges(document.object);

// verify context keys set
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.hascodecells', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.hascodecells', true)).atLeast(1);
});

test('Having no code lenses but ownership setting true will set context keys correctly', async () => {
Expand All @@ -83,7 +83,7 @@ suite('DataScienceCodeLensProvider Unit Tests', () => {
createCodeLensFactory().getCellRanges(document.object);

// verify context keys set
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'jupyter.hascodecells', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.ownsSelection', true)).atLeast(1);
verify(mockedVSCodeNamespaces.commands.executeCommand('setContext', 'deepnote.hascodecells', true)).atLeast(1);
});
});
2 changes: 1 addition & 1 deletion src/kernels/errors/kernelErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ function getCombinedErrorMessage(prefix: string = '', message: string = '') {
if (
!doesErrorHaveMarkdownLinks(errorMessage) &&
errorMessage.length &&
errorMessage.indexOf('command:jupyter.viewOutput') === -1
errorMessage.indexOf('command:deepnote.viewOutput') === -1
) {
return `${errorMessage.endsWith('.') ? errorMessage : errorMessage + '.'} \n${
DataScience.viewJupyterLogForFurtherInfo
Expand Down
6 changes: 3 additions & 3 deletions src/kernels/errors/kernelErrorHandler.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ Failed to run jupyter as observable with args notebook --no-browser --notebook-d
[
'Failed to start the Kernel. ',
'hello word does not have attribute named abc. ',
'View Jupyter [log](command:jupyter.viewOutput) for further details.'
'View Jupyter [log](command:deepnote.viewOutput) for further details.'
].join('\n')
);
});
Expand All @@ -837,7 +837,7 @@ Failed to run jupyter as observable with args notebook --no-browser --notebook-d
[
'Failed to restart the Kernel. ',
'hello word does not have attribute named abc. ',
'View Jupyter [log](command:jupyter.viewOutput) for further details.'
'View Jupyter [log](command:deepnote.viewOutput) for further details.'
].join('\n')
);
});
Expand Down Expand Up @@ -1101,7 +1101,7 @@ Failed to run jupyter as observable with args notebook --no-browser --notebook-d
verify(uriStorage.remove(deepEqual(serverProviderHandle))).never();
});
function verifyErrorMessage(message: string, linkInfo?: string) {
message = message.includes('command:jupyter.viewOutput')
message = message.includes('command:deepnote.viewOutput')
? message
: `${message} \n${DataScience.viewJupyterLogForFurtherInfo}`;
if (linkInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class JupyterInterpreterSelectionCommand implements IExtensionSyncActivat
) {}
public activate() {
this.disposables.push(
commands.registerCommand('jupyter.selectJupyterInterpreter', () => {
commands.registerCommand('deepnote.selectJupyterInterpreter', () => {
this.service.selectInterpreter().catch(noop);
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ suite('Jupyter Interpreter Command', () => {
test('Activation should register command', async () => {
const disposable = mock(Disposable);
when(
mockedVSCodeNamespaces.commands.registerCommand('jupyter.selectJupyterInterpreter', anything())
mockedVSCodeNamespaces.commands.registerCommand('deepnote.selectJupyterInterpreter', anything())
).thenReturn(instance(disposable));

await interpreterCommand.activate();

verify(mockedVSCodeNamespaces.commands.registerCommand('jupyter.selectJupyterInterpreter', anything())).once();
verify(mockedVSCodeNamespaces.commands.registerCommand('deepnote.selectJupyterInterpreter', anything())).once();
});
test('Command handler must be jupyter interpreter selection', async () => {
const disposable = mock(Disposable);
let handler: Function | undefined;
when(mockedVSCodeNamespaces.commands.registerCommand('jupyter.selectJupyterInterpreter', anything())).thenCall(
when(mockedVSCodeNamespaces.commands.registerCommand('deepnote.selectJupyterInterpreter', anything())).thenCall(
(_, cb: Function) => {
handler = cb;
return instance(disposable);
Expand All @@ -44,7 +44,7 @@ suite('Jupyter Interpreter Command', () => {

await interpreterCommand.activate();

verify(mockedVSCodeNamespaces.commands.registerCommand('jupyter.selectJupyterInterpreter', anything())).once();
verify(mockedVSCodeNamespaces.commands.registerCommand('deepnote.selectJupyterInterpreter', anything())).once();
assert.isFunction(handler);

// Invoking handler must select jupyter interpreter.
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/raw/finder/trustedKernelPaths.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TrustedKernelPaths implements ITrustedKernelPaths {
: undefined;
constructor(@inject(IPlatformService) private readonly platform: IPlatformService) {}
private get trustedKernelSpecs(): string[] {
return workspace.getConfiguration('jupyter', undefined).get<string[]>('kernels.trusted', []);
return workspace.getConfiguration('deepnote', undefined).get<string[]>('kernels.trusted', []);
}
public isTrusted(kernelPath: Uri): boolean {
const trusted = this.isTrustedImpl(kernelPath);
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/raw/finder/trustedKernelPaths.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ suite('Trusted Kernel paths', () => {
function createTrustedPathService() {
jupyterConfig = mock<WorkspaceConfiguration>();
when(jupyterConfig.get('kernels.trusted', anything())).thenCall((_, defaultValue) => defaultValue);
when(mockedVSCodeNamespaces.workspace.getConfiguration('jupyter', anything())).thenReturn(
when(mockedVSCodeNamespaces.workspace.getConfiguration('deepnote', anything())).thenReturn(
instance(jupyterConfig)
);
platform = mock<IPlatformService>();
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/raw/finder/trustedKernrelPaths.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suite('Trusted Kernel paths', () => {
function createTrustedPathService() {
jupyterConfig = mock<WorkspaceConfiguration>();
when(jupyterConfig.get('kernels.trusted', anything())).thenCall((_, defaultValue) => defaultValue);
when(mockedVSCodeNamespaces.workspace.getConfiguration('jupyter', anything())).thenReturn(
when(mockedVSCodeNamespaces.workspace.getConfiguration('deepnote', anything())).thenReturn(
instance(jupyterConfig)
);
platform = mock<IPlatformService>();
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/raw/session/rawKernelConnection.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ function newRawKernel(kernelProcess: IKernelProcess, clientId: string, username:
username,
model
});
if (workspace.getConfiguration('jupyter').get('enablePythonKernelLogging', false)) {
if (workspace.getConfiguration('deepnote').get('enablePythonKernelLogging', false)) {
realKernel.anyMessage.connect((_, msg) => {
logger.trace(`[AnyMessage Event] [${msg.direction}] [${kernelProcess.pid}] ${JSON.stringify(msg.msg)}`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class InstallPythonControllerCommands implements IExtensionSyncActivation
await commands.executeCommand('python.installPython');
} else if (selection === Common.reload) {
sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'reload' });
await commands.executeCommand('jupyter.reloadVSCode', DataScience.reloadRequired);
await commands.executeCommand('deepnote.reloadVSCode', DataScience.reloadRequired);
} else {
sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'dismissed' });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class IPyWidgetMessageDispatcher implements IIPyWidgetMessageDispatcher {
// Always register this comm target.
// Possible auto start is disabled, and when cell is executed with widget stuff, this comm target will not have
// been registered, in which case kaboom. As we know this is always required, pre-register this.
this.pendingTargetNames.add('jupyter.widget');
this.pendingTargetNames.add('deepnote.widget');
kernelProvider.onDidStartKernel(
(e) => {
if (e.notebook === document) {
Expand Down
Loading
Loading