Skip to content

Commit

Permalink
Use "positron" as the publisher for our extensions (#5597)
Browse files Browse the repository at this point in the history
Addresses #5268

After experimenting with this, I believe we should _only_ update the
publisher on extensions that we ourselves truly did make, not ones that
we forked and made changes to. As an example, the Black formatter (which
we bundle) depends on the `ms-python.python` extension ID; if we change
our Python extension to be `positron.python` then we can no longer
bundle the Black formatter.

### QA Notes

Most importantly, there should be no errors as the app comes up about
extensions being activated, and both R and Python runtimes should start.

There are more implications for changing this publisher in the long term
as outlined in #5268, but to confirm we have successfully updated it,
you can look for some of the builtin extensions in the Extensions tab
and see that they say they have the "positron" publisher:

![Screenshot 2024-12-03 at 5 27
04 PM](https://github.com/user-attachments/assets/05d98dc5-de39-43c6-a0f4-987e659000cf)

---------

Signed-off-by: Julia Silge <[email protected]>
Co-authored-by: Jonathan <[email protected]>
  • Loading branch information
juliasilge and jmcphers authored Dec 4, 2024
1 parent 1fe6b4b commit 9605ef0
Show file tree
Hide file tree
Showing 30 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion extensions/jupyter-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jupyter-adapter",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"publisher": "positron",
"version": "0.0.1",
"engines": {
"vscode": "^1.61.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-code-cells/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "positron-code-cells",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"publisher": "positron",
"version": "0.0.1",
"engines": {
"vscode": "^1.65.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-code-cells/src/test/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { closeAllEditors } from './utils';
suite('Context', () => {
setup(async () => {
// Testing the context keys requires the extension to be activated.
await vscode.extensions.getExtension('vscode.positron-code-cells')!.activate();
await vscode.extensions.getExtension('positron.positron-code-cells')!.activate();
});
teardown(closeAllEditors);

Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-connections/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function activateImpl(context: vscode.ExtensionContext) {
connectionProvider.expandConnectionNodes(connectionTreeView);
}));

// this allows vscode.extensions.getExtension('vscode.positron-connections').exports
// this allows vscode.extensions.getExtension('positron.positron-connections').exports
// to acccess the ConnectionItemsProvider instance
return connectionProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ suite('Connections pane works for R', () => {
'con <- connections::connection_open(RSQLite::SQLite(), tempfile())',
);

const ext = vscode.extensions.getExtension<ConnectionItemsProvider>('vscode.positron-connections');
const ext = vscode.extensions.getExtension<ConnectionItemsProvider>('positron.positron-connections');
const provider = ext?.exports;
assert(provider !== undefined);

Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-duckdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-duckdb/src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DEFAULT_FORMAT_OPTIONS: FormatOptions = {
// Not sure why it is not possible to use Mocha's 'before' for this
async function activateExtension() {
// Ensure the extension is activated
await vscode.extensions.getExtension('vscode.positron-duckdb')?.activate();
await vscode.extensions.getExtension('positron.positron-duckdb')?.activate();
}

async function runQuery<Type>(query: string): Promise<Array<Type>> {
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-ipywidgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.75.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
4 changes: 2 additions & 2 deletions extensions/positron-notebook-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "positron-notebook-controllers",
"displayName": "Positron Notebook Controllers",
"description": "Notebook Controllers for Positron Language Runtimes",
"publisher": "vscode",
"publisher": "positron",
"version": "0.0.1",
"engines": {
"vscode": "^1.65.0"
Expand Down Expand Up @@ -46,7 +46,7 @@
{
"command": "positron.restartKernel",
"group": "navigation/execute@5",
"when": "notebookKernel =~ /^vscode.positron-notebook-controllers\\//"
"when": "notebookKernel =~ /^positron.positron-notebook-controllers\\//"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-notebooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Positron Notebooks Helpers",
"description": "Positron Notebook Helpers",
"version": "1.0.0",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
4 changes: 2 additions & 2 deletions extensions/positron-python/src/client/positron/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export class PythonRuntimeSession implements positron.LanguageRuntimeSession, vs
const config = vscode.workspace.getConfiguration('positronKernelSupervisor');
if (config.get<boolean>('enable', true) && this.runtimeMetadata.runtimeId !== 'reticulate') {
// Use the Positron kernel supervisor if enabled
const ext = vscode.extensions.getExtension('vscode.positron-supervisor');
const ext = vscode.extensions.getExtension('positron.positron-supervisor');
if (!ext) {
throw new Error('Positron Supervisor extension not found');
}
Expand All @@ -479,7 +479,7 @@ export class PythonRuntimeSession implements positron.LanguageRuntimeSession, vs
this.adapterApi = ext?.exports as JupyterAdapterApi;
} else {
// Otherwise, connect to the Jupyter kernel directly
const ext = vscode.extensions.getExtension('vscode.jupyter-adapter');
const ext = vscode.extensions.getExtension('positron.jupyter-adapter');
if (!ext) {
throw new Error('Jupyter Adapter extension not found');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ async function getAppName(document: vscode.TextDocument, className: string): Pro

/** Get the Positron Run App extension's API. */
async function getPositronRunAppApi(): Promise<PositronRunApp> {
const runAppExt = vscode.extensions.getExtension<PositronRunApp>('vscode.positron-run-app');
const runAppExt = vscode.extensions.getExtension<PositronRunApp>('positron.positron-run-app');
if (!runAppExt) {
throw new Error('vscode.positron-run-app extension not found');
throw new Error('positron.positron-run-app extension not found');
}
const runAppApi = await runAppExt.activate();
return runAppApi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ suite('Python Runtime Session', () => {
} as Partial<JupyterAdapterApi> as JupyterAdapterApi;

sinon.stub(vscode.extensions, 'getExtension').callsFake((extensionId) => {
if (extensionId === 'vscode.kallichore-adapter' || extensionId === 'vscode.jupyter-adapter') {
if (extensionId === 'positron.positron-supervisor' || extensionId === 'positron.jupyter-adapter') {
return {
id: '',
extensionPath: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ suite('Web app commands', () => {
let isFastAPICliInstalled: boolean;

setup(() => {
// Stub `vscode.extensions.getExtension('vscode.positron-run-app')` to return an extension
// Stub `vscode.extensions.getExtension('positron.positron-run-app')` to return an extension
// with:
// 1. `runApplication` that records the last `options` that it was called with.
// 2. `debugApplication` that records the last `options` that it was called with.
Expand All @@ -49,7 +49,7 @@ suite('Web app commands', () => {
},
};
sinon.stub(vscode.extensions, 'getExtension').callsFake((extensionId) => {
if (extensionId === 'vscode.positron-run-app') {
if (extensionId === 'positron.positron-run-app') {
return {
id: '',
extensionPath: '',
Expand Down
4 changes: 2 additions & 2 deletions extensions/positron-r/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export class RSession implements positron.LanguageRuntimeSession, vscode.Disposa
const config = vscode.workspace.getConfiguration('positronKernelSupervisor');
if (config.get<boolean>('enable', true)) {
// Use the Positron kernel supervisor if enabled
const ext = vscode.extensions.getExtension('vscode.positron-supervisor');
const ext = vscode.extensions.getExtension('positron.positron-supervisor');
if (!ext) {
throw new Error('Positron Supervisor extension not found');
}
Expand All @@ -588,7 +588,7 @@ export class RSession implements positron.LanguageRuntimeSession, vscode.Disposa
this.adapterApi = ext?.exports as JupyterAdapterApi;
} else {
// Otherwise, connect to the Jupyter kernel directly
const ext = vscode.extensions.getExtension('vscode.jupyter-adapter');
const ext = vscode.extensions.getExtension('positron.jupyter-adapter');
if (!ext) {
throw new Error('Jupyter Adapter extension not found');
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/positron-reticulate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down Expand Up @@ -37,7 +37,7 @@
"extensionDependencies": [
"ms-python.python",
"positron.positron-r",
"vscode.jupyter-adapter"
"positron.jupyter-adapter"
],
"devDependencies": {
"@types/glob": "^7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-rstudio-keymap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"license": "SEE LICENSE IN LICENSE.md",
"engines": {
"vscode": "^1.75.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-run-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
10 changes: 5 additions & 5 deletions extensions/positron-run-app/src/test/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ suite('PositronRunApp', () => {
sinon.stub(vscode.commands, 'executeCommand')
.withArgs('positronProxy.startPendingProxyServer')
.resolves({
proxyPath: '/proxy/path',
externalUri: vscode.Uri.parse('http://localhost:1234'),
finishProxySetup: () => {},
});
proxyPath: '/proxy/path',
externalUri: vscode.Uri.parse('http://localhost:1234'),
finishProxySetup: () => { },
});

// Stub the preview URL function.
previewUrlStub = sinon.stub(positron.window, 'previewUrl');
Expand Down Expand Up @@ -102,7 +102,7 @@ suite('PositronRunApp', () => {
});

async function getRunAppApi(): Promise<PositronRunAppApiImpl> {
const extension = vscode.extensions.getExtension<PositronRunAppApiImpl>('vscode.positron-run-app');
const extension = vscode.extensions.getExtension<PositronRunAppApiImpl>('positron.positron-run-app');
if (!extension) {
throw new Error('Could not find Positron Run App extension');
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-supervisor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "positron-supervisor",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"publisher": "positron",
"version": "0.0.1",
"engines": {
"vscode": "^1.61.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"externalUriOpener"
],
"version": "1.0.0",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.70.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-zed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Zed",
"description": "Positron Zed",
"version": "1.0.0",
"publisher": "vscode",
"publisher": "positron",
"engines": {
"vscode": "^1.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-zed/src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ suite('Zed Interpreter Extension Test Suite', () => {
});

async function activateZedExtension() {
const extension = vscode.extensions.getExtension('vscode.positron-zed');
const extension = vscode.extensions.getExtension('positron.positron-zed');
assert.ok(extension, 'Zed extension not found');
await extension.activate();
assert.ok(extension.isActive, 'Zed extension failed to activate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class KernelPickerMRUStrategy extends KernelPickerStrategyBase {
// --- Start Positron ---
// Enable kernel source action providers for Positron kernels
const kernel = all.find(kernel => kernel.id === `ms-toolsai.jupyter/${selectedKernelId}` ||
kernel.id === `vscode.positron-notebook-controllers/${selectedKernelId}`);
kernel.id === `positron.positron-notebook-controllers/${selectedKernelId}`);
// --- End Positron ---
if (kernel) {
await this._selecteKernel(notebook, kernel);
Expand Down Expand Up @@ -662,7 +662,7 @@ export class KernelPickerMRUStrategy extends KernelPickerStrategyBase {
// --- Start Positron ---
// Remove the "Positron Notebook Controllers" quickpick item in favor of kernel source action providers
const others = matchResult.all.filter(item => item.extension.value !== JUPYTER_EXTENSION_ID &&
item.extension.value !== 'vscode.positron-notebook-controllers');
item.extension.value !== 'positron.positron-notebook-controllers');
// --- End Positron ---
const quickPickItems: QuickPickInput<KernelQuickPickItem>[] = [];

Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/notebook/common/notebookCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export const ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER: readonly string[] = [
*/
export const RENDERER_EQUIVALENT_EXTENSIONS: ReadonlyMap<string, ReadonlySet<string>> = new Map([
// --- Start Positron ---
// Use vscode.positron-ipywidgets renderer instead of ms-toolsai.jupyter.
['vscode.positron-ipywidgets', new Set(['jupyter-notebook', 'interactive'])],
// Use positron.positron-ipywidgets renderer instead of ms-toolsai.jupyter.
['positron.positron-ipywidgets', new Set(['jupyter-notebook', 'interactive'])],
// --- End Positron ---
['ms-toolsai.jupyter-renderers', new Set(['jupyter-notebook', 'interactive'])],
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SelectPositronNotebookKernelAction extends Action2 {

const gatherKernelPicks = () => {
const kernelMatches = notebookKernelService.getMatchingKernel(notebook);
const positronKernels = kernelMatches.all.filter(k => k.extension.value === 'vscode.positron-notebook-controllers');
const positronKernels = kernelMatches.all.filter(k => k.extension.value === 'positron.positron-notebook-controllers');
if (positronKernels.length === 0) {
quickPick.busy = true;
quickPick.items = [{ label: localize('positronNotebookActions.selectKernel.noKernel', 'No Positron Notebook Kernel found'), picked: true }];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class TestNotebookService implements Partial<INotebookService> {
getPreferredRenderer(_mimeType: string): NotebookOutputRendererInfo | undefined {
return <NotebookOutputRendererInfo>{
id: 'positron-ipywidgets',
extensionId: new ExtensionIdentifier('vscode.positron-ipywidgets'),
extensionId: new ExtensionIdentifier('positron.positron-ipywidgets'),
};
}

Expand Down

0 comments on commit 9605ef0

Please sign in to comment.