From 9605ef0124c8f0948355031f8a4efc7dc999c817 Mon Sep 17 00:00:00 2001 From: Julia Silge Date: Wed, 4 Dec 2024 16:32:11 -0700 Subject: [PATCH] Use "positron" as the publisher for our extensions (#5597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-authored-by: Jonathan --- extensions/jupyter-adapter/package.json | 2 +- extensions/positron-code-cells/package.json | 2 +- .../positron-code-cells/src/test/context.test.ts | 2 +- extensions/positron-connections/package.json | 2 +- extensions/positron-connections/src/extension.ts | 2 +- .../positron-connections/src/test/connection.test.ts | 2 +- extensions/positron-duckdb/package.json | 2 +- extensions/positron-duckdb/src/test/extension.test.ts | 2 +- extensions/positron-ipywidgets/package.json | 2 +- extensions/positron-javascript/package.json | 2 +- extensions/positron-notebook-controllers/package.json | 4 ++-- extensions/positron-notebooks/package.json | 2 +- extensions/positron-proxy/package.json | 2 +- .../positron-python/src/client/positron/session.ts | 4 ++-- .../src/client/positron/webAppCommands.ts | 4 ++-- .../src/test/positron/session.unit.test.ts | 2 +- .../src/test/positron/webAppCommands.unit.test.ts | 4 ++-- extensions/positron-r/src/session.ts | 4 ++-- extensions/positron-reticulate/package.json | 4 ++-- extensions/positron-rstudio-keymap/package.json | 2 +- extensions/positron-run-app/package.json | 2 +- extensions/positron-run-app/src/test/api.test.ts | 10 +++++----- extensions/positron-supervisor/package.json | 2 +- extensions/positron-viewer/package.json | 2 +- extensions/positron-zed/package.json | 2 +- extensions/positron-zed/src/test/extension.test.ts | 2 +- .../viewParts/notebookKernelQuickPickStrategy.ts | 4 ++-- .../contrib/notebook/common/notebookCommon.ts | 4 ++-- .../browser/SelectPositronNotebookKernelAction.ts | 2 +- .../test/common/positronWorkbenchTestServices.ts | 2 +- 30 files changed, 42 insertions(+), 42 deletions(-) diff --git a/extensions/jupyter-adapter/package.json b/extensions/jupyter-adapter/package.json index eab045c0295..9f83d1b8603 100644 --- a/extensions/jupyter-adapter/package.json +++ b/extensions/jupyter-adapter/package.json @@ -2,7 +2,7 @@ "name": "jupyter-adapter", "displayName": "%displayName%", "description": "%description%", - "publisher": "vscode", + "publisher": "positron", "version": "0.0.1", "engines": { "vscode": "^1.61.0" diff --git a/extensions/positron-code-cells/package.json b/extensions/positron-code-cells/package.json index c08bc7cb25e..a1c74def034 100644 --- a/extensions/positron-code-cells/package.json +++ b/extensions/positron-code-cells/package.json @@ -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" diff --git a/extensions/positron-code-cells/src/test/context.test.ts b/extensions/positron-code-cells/src/test/context.test.ts index 974c46efe54..852a66b9e7c 100644 --- a/extensions/positron-code-cells/src/test/context.test.ts +++ b/extensions/positron-code-cells/src/test/context.test.ts @@ -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); diff --git a/extensions/positron-connections/package.json b/extensions/positron-connections/package.json index aa48873d3f5..3ff03beeae3 100644 --- a/extensions/positron-connections/package.json +++ b/extensions/positron-connections/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-connections/src/extension.ts b/extensions/positron-connections/src/extension.ts index 74096e56e91..d3aab1d7aa1 100644 --- a/extensions/positron-connections/src/extension.ts +++ b/extensions/positron-connections/src/extension.ts @@ -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; } diff --git a/extensions/positron-connections/src/test/connection.test.ts b/extensions/positron-connections/src/test/connection.test.ts index 0bd53175541..d61d8d1c6ad 100644 --- a/extensions/positron-connections/src/test/connection.test.ts +++ b/extensions/positron-connections/src/test/connection.test.ts @@ -28,7 +28,7 @@ suite('Connections pane works for R', () => { 'con <- connections::connection_open(RSQLite::SQLite(), tempfile())', ); - const ext = vscode.extensions.getExtension('vscode.positron-connections'); + const ext = vscode.extensions.getExtension('positron.positron-connections'); const provider = ext?.exports; assert(provider !== undefined); diff --git a/extensions/positron-duckdb/package.json b/extensions/positron-duckdb/package.json index fb788588e4f..593e830f6c1 100644 --- a/extensions/positron-duckdb/package.json +++ b/extensions/positron-duckdb/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-duckdb/src/test/extension.test.ts b/extensions/positron-duckdb/src/test/extension.test.ts index c7f7bcc98e6..617506ee0c1 100644 --- a/extensions/positron-duckdb/src/test/extension.test.ts +++ b/extensions/positron-duckdb/src/test/extension.test.ts @@ -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(query: string): Promise> { diff --git a/extensions/positron-ipywidgets/package.json b/extensions/positron-ipywidgets/package.json index f172446cb6f..cb8b5f11aff 100644 --- a/extensions/positron-ipywidgets/package.json +++ b/extensions/positron-ipywidgets/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.75.0" }, diff --git a/extensions/positron-javascript/package.json b/extensions/positron-javascript/package.json index 6d1e15a059a..5a875cef1d0 100644 --- a/extensions/positron-javascript/package.json +++ b/extensions/positron-javascript/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-notebook-controllers/package.json b/extensions/positron-notebook-controllers/package.json index db093796c96..5697010b4ea 100644 --- a/extensions/positron-notebook-controllers/package.json +++ b/extensions/positron-notebook-controllers/package.json @@ -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" @@ -46,7 +46,7 @@ { "command": "positron.restartKernel", "group": "navigation/execute@5", - "when": "notebookKernel =~ /^vscode.positron-notebook-controllers\\//" + "when": "notebookKernel =~ /^positron.positron-notebook-controllers\\//" } ] } diff --git a/extensions/positron-notebooks/package.json b/extensions/positron-notebooks/package.json index 04543bdd862..46aa887f056 100644 --- a/extensions/positron-notebooks/package.json +++ b/extensions/positron-notebooks/package.json @@ -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" }, diff --git a/extensions/positron-proxy/package.json b/extensions/positron-proxy/package.json index 0c2583e9e15..a7beca0d901 100644 --- a/extensions/positron-proxy/package.json +++ b/extensions/positron-proxy/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "1.0.0", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-python/src/client/positron/session.ts b/extensions/positron-python/src/client/positron/session.ts index ba0db2b0817..fe7e8bd4898 100644 --- a/extensions/positron-python/src/client/positron/session.ts +++ b/extensions/positron-python/src/client/positron/session.ts @@ -469,7 +469,7 @@ export class PythonRuntimeSession implements positron.LanguageRuntimeSession, vs const config = vscode.workspace.getConfiguration('positronKernelSupervisor'); if (config.get('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'); } @@ -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'); } diff --git a/extensions/positron-python/src/client/positron/webAppCommands.ts b/extensions/positron-python/src/client/positron/webAppCommands.ts index bf9d3a01c19..d78b6c71ad0 100644 --- a/extensions/positron-python/src/client/positron/webAppCommands.ts +++ b/extensions/positron-python/src/client/positron/webAppCommands.ts @@ -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 { - const runAppExt = vscode.extensions.getExtension('vscode.positron-run-app'); + const runAppExt = vscode.extensions.getExtension('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; diff --git a/extensions/positron-python/src/test/positron/session.unit.test.ts b/extensions/positron-python/src/test/positron/session.unit.test.ts index 7006367e91c..4fe1db3d8e9 100644 --- a/extensions/positron-python/src/test/positron/session.unit.test.ts +++ b/extensions/positron-python/src/test/positron/session.unit.test.ts @@ -114,7 +114,7 @@ suite('Python Runtime Session', () => { } as Partial 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: '', diff --git a/extensions/positron-python/src/test/positron/webAppCommands.unit.test.ts b/extensions/positron-python/src/test/positron/webAppCommands.unit.test.ts index ad4d072e3d8..d29fd365a79 100644 --- a/extensions/positron-python/src/test/positron/webAppCommands.unit.test.ts +++ b/extensions/positron-python/src/test/positron/webAppCommands.unit.test.ts @@ -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. @@ -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: '', diff --git a/extensions/positron-r/src/session.ts b/extensions/positron-r/src/session.ts index c39423d4521..f9f03b6c978 100644 --- a/extensions/positron-r/src/session.ts +++ b/extensions/positron-r/src/session.ts @@ -578,7 +578,7 @@ export class RSession implements positron.LanguageRuntimeSession, vscode.Disposa const config = vscode.workspace.getConfiguration('positronKernelSupervisor'); if (config.get('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'); } @@ -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'); } diff --git a/extensions/positron-reticulate/package.json b/extensions/positron-reticulate/package.json index 5567a353038..f7ede315ff0 100644 --- a/extensions/positron-reticulate/package.json +++ b/extensions/positron-reticulate/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, @@ -37,7 +37,7 @@ "extensionDependencies": [ "ms-python.python", "positron.positron-r", - "vscode.jupyter-adapter" + "positron.jupyter-adapter" ], "devDependencies": { "@types/glob": "^7.2.0", diff --git a/extensions/positron-rstudio-keymap/package.json b/extensions/positron-rstudio-keymap/package.json index 2203abda747..92070b24b54 100644 --- a/extensions/positron-rstudio-keymap/package.json +++ b/extensions/positron-rstudio-keymap/package.json @@ -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" diff --git a/extensions/positron-run-app/package.json b/extensions/positron-run-app/package.json index 171331576b1..7f9a61687e5 100644 --- a/extensions/positron-run-app/package.json +++ b/extensions/positron-run-app/package.json @@ -3,7 +3,7 @@ "displayName": "%displayName%", "description": "%description%", "version": "0.0.1", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-run-app/src/test/api.test.ts b/extensions/positron-run-app/src/test/api.test.ts index 34b7a97e061..fa960195e7a 100644 --- a/extensions/positron-run-app/src/test/api.test.ts +++ b/extensions/positron-run-app/src/test/api.test.ts @@ -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'); @@ -102,7 +102,7 @@ suite('PositronRunApp', () => { }); async function getRunAppApi(): Promise { - const extension = vscode.extensions.getExtension('vscode.positron-run-app'); + const extension = vscode.extensions.getExtension('positron.positron-run-app'); if (!extension) { throw new Error('Could not find Positron Run App extension'); } diff --git a/extensions/positron-supervisor/package.json b/extensions/positron-supervisor/package.json index f20f5ede94d..2e5e38564e2 100644 --- a/extensions/positron-supervisor/package.json +++ b/extensions/positron-supervisor/package.json @@ -2,7 +2,7 @@ "name": "positron-supervisor", "displayName": "%displayName%", "description": "%description%", - "publisher": "vscode", + "publisher": "positron", "version": "0.0.1", "engines": { "vscode": "^1.61.0" diff --git a/extensions/positron-viewer/package.json b/extensions/positron-viewer/package.json index c0e255278b1..008f4952427 100644 --- a/extensions/positron-viewer/package.json +++ b/extensions/positron-viewer/package.json @@ -6,7 +6,7 @@ "externalUriOpener" ], "version": "1.0.0", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.70.0" }, diff --git a/extensions/positron-zed/package.json b/extensions/positron-zed/package.json index c14ab9d538e..88591b37f97 100644 --- a/extensions/positron-zed/package.json +++ b/extensions/positron-zed/package.json @@ -3,7 +3,7 @@ "displayName": "Zed", "description": "Positron Zed", "version": "1.0.0", - "publisher": "vscode", + "publisher": "positron", "engines": { "vscode": "^1.65.0" }, diff --git a/extensions/positron-zed/src/test/extension.test.ts b/extensions/positron-zed/src/test/extension.test.ts index 325929bb60b..10e16e09b80 100644 --- a/extensions/positron-zed/src/test/extension.test.ts +++ b/extensions/positron-zed/src/test/extension.test.ts @@ -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'); diff --git a/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.ts b/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.ts index 40a78447054..44d81e207eb 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.ts @@ -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); @@ -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[] = []; diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index f12d11098ed..98916d27545 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -81,8 +81,8 @@ export const ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER: readonly string[] = [ */ export const RENDERER_EQUIVALENT_EXTENSIONS: ReadonlyMap> = 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'])], ]); diff --git a/src/vs/workbench/contrib/positronNotebook/browser/SelectPositronNotebookKernelAction.ts b/src/vs/workbench/contrib/positronNotebook/browser/SelectPositronNotebookKernelAction.ts index 440a4213ba2..21d62d80a8c 100644 --- a/src/vs/workbench/contrib/positronNotebook/browser/SelectPositronNotebookKernelAction.ts +++ b/src/vs/workbench/contrib/positronNotebook/browser/SelectPositronNotebookKernelAction.ts @@ -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 }]; diff --git a/src/vs/workbench/test/common/positronWorkbenchTestServices.ts b/src/vs/workbench/test/common/positronWorkbenchTestServices.ts index 028f06ec31e..74247a40aac 100644 --- a/src/vs/workbench/test/common/positronWorkbenchTestServices.ts +++ b/src/vs/workbench/test/common/positronWorkbenchTestServices.ts @@ -26,7 +26,7 @@ export class TestNotebookService implements Partial { getPreferredRenderer(_mimeType: string): NotebookOutputRendererInfo | undefined { return { id: 'positron-ipywidgets', - extensionId: new ExtensionIdentifier('vscode.positron-ipywidgets'), + extensionId: new ExtensionIdentifier('positron.positron-ipywidgets'), }; }