From 06947d723df2f11d32f3d6f5bccd4b79d8043c2a Mon Sep 17 00:00:00 2001 From: tomas Date: Fri, 16 Oct 2026 14:59:32 +0000 Subject: [PATCH 1/3] chore(deps): bump prettier from 3.0.0 to 3.9.10 Lockfile-only. package.json already allows ^3.0.0, but the lock has stayed on 3.0.0 since that range was added. The reformat this release requires follows in the next commit. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NMBxX24nF2qRaSRtmgH9mB --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1407f9ae7..2f781c817 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25874,9 +25874,9 @@ } }, "node_modules/prettier": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", - "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz", + "integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==", "dev": true, "license": "MIT", "bin": { From c45f76c60cb676f633ef77600046cb2e9654dae4 Mon Sep 17 00:00:00 2001 From: tomas Date: Fri, 16 Oct 2026 15:01:24 +0000 Subject: [PATCH 2/3] style: reformat with prettier 3.9 Output of `npm run format-fix` after the prettier 3.0.0 -> 3.9.10 bump, with no manual edits. Formatting rules added since 3.0 change line breaks, nested-ternary indentation and leading `|` in multi-line unions. They also add redundant parentheses in 7 places: `a ? (b ?? c) : d` and `(typeof import(...))['name']`. Behaviour cannot change: with parentheses elided, the TypeScript AST of all 53 files is identical before and after. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NMBxX24nF2qRaSRtmgH9mB --- src/api.d.ts | 9 +--- src/commands.ts | 7 +-- .../common/baseJupyterSessionConnection.ts | 6 +-- src/kernels/errors/kernelErrorHandler.node.ts | 5 +- src/kernels/errors/kernelErrorHandler.ts | 4 +- .../execution/cellExecutionMessageHandler.ts | 3 +- src/kernels/execution/helpers.ts | 15 +++--- src/kernels/internalTypes.ts | 5 +- ...terSubCommandExecutionService.unit.test.ts | 30 +++++------- src/kernels/jupyter/types.ts | 3 +- src/kernels/kernel.ts | 12 ++--- .../finder/localKernelSpecFinderBase.node.ts | 4 +- .../session/kernelWorkingDirectory.node.ts | 4 +- .../raw/session/rawKernelConnection.node.ts | 4 +- src/kernels/types.ts | 10 +--- src/notebooks/controllers/kernelConnector.ts | 29 +++-------- .../kernelSource/baseKernelSelector.ts | 5 +- .../remoteNotebookKernelSourceSelector.ts | 8 +-- .../preferredKernelConnectionService.node.ts | 3 +- src/notebooks/debugger/kernelDebugAdapter.ts | 4 +- src/notebooks/deepnote/deepnoteTestHelpers.ts | 2 +- ...federatedAuthSqlBlockCodeGenerator.node.ts | 2 +- ...uthSqlBlockCodeGenerator.node.unit.test.ts | 2 +- .../integrations/integrationWebview.ts | 2 +- .../integrationWebview.unit.test.ts | 8 +-- src/platform/api/python-envs/api.ts | 14 +++--- src/platform/api/pythonApi.ts | 8 +-- .../runInDedicatedExtensionHost.node.ts | 3 +- .../common/application/workspace.base.ts | 4 +- .../common/configuration/service.base.ts | 4 +- src/platform/common/providerBasedQuickPick.ts | 4 +- src/platform/common/utils.ts | 8 +-- src/platform/common/utils/typescript.ts | 14 ++---- ...customEnvironmentVariablesProvider.node.ts | 8 +-- .../environmentActivationService.node.ts | 9 ++-- .../pythonEnvironmentPicker.node.ts | 4 +- .../pythonExecutionFactory.node.ts | 4 +- src/platform/telemetry/index.ts | 39 +++++++-------- .../chat/createVirtualEnv.python.node.ts | 4 +- src/standalone/chat/helper.ts | 8 +-- .../resolveCompletionItem.unit.test.ts | 2 +- .../userServerUrlProvider.ts | 10 ++-- src/standalone/variables/kernelVariables.ts | 2 +- src/telemetry.ts | 49 +++++++++---------- .../datascience/fakeKernelConnection.node.ts | 4 +- .../notebook/controllerPreferredService.ts | 10 ++-- src/test/datascience/notebook/helper.ts | 21 ++++---- .../notebook/nonPythonKernels.vscode.test.ts | 12 ++--- .../notebook/stackTraceParsing.vscode.test.ts | 2 +- .../dataviewer/dataViewerCommandRegistry.ts | 5 +- .../integrations/IntegrationItem.tsx | 4 +- .../webview-side/ipywidgets/kernel/kernel.ts | 4 +- .../webview-side/ipywidgets/kernel/manager.ts | 7 +-- 53 files changed, 190 insertions(+), 263 deletions(-) diff --git a/src/api.d.ts b/src/api.d.ts index 64dad363d..5ffa69b18 100644 --- a/src/api.d.ts +++ b/src/api.d.ts @@ -197,14 +197,7 @@ interface OutputItem { data: Uint8Array; } export type KernelStatus = - | 'unknown' - | 'starting' - | 'idle' - | 'busy' - | 'terminating' - | 'restarting' - | 'autorestarting' - | 'dead'; + 'unknown' | 'starting' | 'idle' | 'busy' | 'terminating' | 'restarting' | 'autorestarting' | 'dead'; /** * Represents a Jupyter Kernel. diff --git a/src/commands.ts b/src/commands.ts index 363547f50..ecb3f9667 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -22,9 +22,7 @@ export type CommandIds = keyof ICommandNameArgumentTypeMapping; type ContextKeyPrimitiveValue = null | undefined | boolean | number | string | Uri; export type ContextKeyValue = - | ContextKeyPrimitiveValue - | Array - | Record; + ContextKeyPrimitiveValue | Array | Record; /** * Mapping between commands and list of arguments. @@ -95,8 +93,7 @@ export interface ICommandNameArgumentTypeMapping { ['notebook.execute']: []; ['notebook.cell.edit']: []; ['notebook.cell.execute']: - | [] - | [{ ranges: { start: number; end: number }[]; document?: Uri; autoReveal?: boolean }]; // TODO update this + [] | [{ ranges: { start: number; end: number }[]; document?: Uri; autoReveal?: boolean }]; // TODO update this ['notebook.cell.insertCodeCellBelow']: []; ['notebook.undo']: []; ['notebook.redo']: []; diff --git a/src/kernels/common/baseJupyterSessionConnection.ts b/src/kernels/common/baseJupyterSessionConnection.ts index 9759f5846..6d5c6da98 100644 --- a/src/kernels/common/baseJupyterSessionConnection.ts +++ b/src/kernels/common/baseJupyterSessionConnection.ts @@ -11,9 +11,9 @@ import { IBaseKernelSession, IKernelSocket } from '../types'; import { KernelSocketMap } from '../kernelSocket'; export abstract class BaseJupyterSessionConnection< - S extends Session.ISessionConnection, - T extends 'remoteJupyter' | 'localJupyter' | 'localRaw' - > + S extends Session.ISessionConnection, + T extends 'remoteJupyter' | 'localJupyter' | 'localRaw' +> extends ObservableDisposable implements Session.ISessionConnection, IBaseKernelSession { diff --git a/src/kernels/errors/kernelErrorHandler.node.ts b/src/kernels/errors/kernelErrorHandler.node.ts index 0efc760bb..c71c3ad07 100644 --- a/src/kernels/errors/kernelErrorHandler.node.ts +++ b/src/kernels/errors/kernelErrorHandler.node.ts @@ -54,9 +54,8 @@ export class DataScienceErrorHandlerNode extends DataScienceErrorHandler { ) { // Looks like some other module is missing. // Sometimes when you create files like xml.py, then kernel startup fails due to xml.dom module not being found. - const problematicFiles = await this.getFilesInWorkingDirectoryThatCouldPotentiallyOverridePythonModules( - resource - ); + const problematicFiles = + await this.getFilesInWorkingDirectoryThatCouldPotentiallyOverridePythonModules(resource); if (problematicFiles.length > 0) { const cwd = resource ? path.dirname(resource) : undefined; const cwdFolder = cwd ? [{ uri: cwd, name: '', index: 0 }] : []; diff --git a/src/kernels/errors/kernelErrorHandler.ts b/src/kernels/errors/kernelErrorHandler.ts index 71751b7ee..32cef2fd4 100644 --- a/src/kernels/errors/kernelErrorHandler.ts +++ b/src/kernels/errors/kernelErrorHandler.ts @@ -375,8 +375,8 @@ export abstract class DataScienceErrorHandler implements IDataScienceErrorHandle err instanceof InvalidRemoteJupyterServerUriHandleError ? '' : err instanceof RemoteJupyterServerConnectionError - ? err.originalError.message || '' - : err.originalError?.message || err.message; + ? err.originalError.message || '' + : err.originalError?.message || err.message; const extensionId = err.serverProviderHandle.extensionId; const id = err.serverProviderHandle.id; diff --git a/src/kernels/execution/cellExecutionMessageHandler.ts b/src/kernels/execution/cellExecutionMessageHandler.ts index ce04c0069..38ffab782 100644 --- a/src/kernels/execution/cellExecutionMessageHandler.ts +++ b/src/kernels/execution/cellExecutionMessageHandler.ts @@ -195,8 +195,7 @@ export class CellExecutionMessageHandler implements IDisposable { private readonly formatters: ITracebackFormatter[], private readonly kernel: Kernel.IKernelConnection, private readonly request: - | Kernel.IShellFuture - | undefined, + Kernel.IShellFuture | undefined, cellExecution: NotebookCellExecution, executionMessageId: string ) { diff --git a/src/kernels/execution/helpers.ts b/src/kernels/execution/helpers.ts index 50a778de6..7f94352c0 100644 --- a/src/kernels/execution/helpers.ts +++ b/src/kernels/execution/helpers.ts @@ -112,8 +112,9 @@ export function traceCellMessage(cell: NotebookCell, message: string | (() => st () => `Cell Index:${cell.index}, of document ${uriPath.basename( cell.notebook.uri - )} with state:${NotebookCellStateTracker.getCellStatus(cell)}, exec: ${cell.executionSummary - ?.executionOrder}. ${messageToLog()}. called from ${getExtensionSpecificStack()}` + )} with state:${NotebookCellStateTracker.getCellStatus(cell)}, exec: ${ + cell.executionSummary?.executionOrder + }. ${messageToLog()}. called from ${getExtensionSpecificStack()}` ); } @@ -302,11 +303,7 @@ function getOutputStreamType(output: NotebookCellOutput): string | undefined { } type JupyterOutput = - | nbformat.IUnrecognizedOutput - | nbformat.IExecuteResult - | nbformat.IDisplayData - | nbformat.IStream - | nbformat.IError; + nbformat.IUnrecognizedOutput | nbformat.IExecuteResult | nbformat.IDisplayData | nbformat.IStream | nbformat.IError; /** * Metadata we store in VS Code cell output items. @@ -717,8 +714,8 @@ export async function updateNotebookMetadataWithSelectedKernel( kernelConnection && kernelConnectionMetadataHasKernelModel(kernelConnection) ? kernelConnection.kernelModel : kernelConnection && 'kernelSpec' in kernelConnection - ? kernelConnection.kernelSpec - : undefined; + ? kernelConnection.kernelSpec + : undefined; if (kernelConnection?.kind === 'startUsingPythonInterpreter') { // Store interpreter name, we expect the kernel finder will find the corresponding interpreter based on this name. const kernelSpec = kernelConnection.kernelSpec; diff --git a/src/kernels/internalTypes.ts b/src/kernels/internalTypes.ts index 78859e8eb..630dba083 100644 --- a/src/kernels/internalTypes.ts +++ b/src/kernels/internalTypes.ts @@ -11,8 +11,9 @@ export enum ContributedKernelFinderKind { LocalPythonEnvironment = 'localPythonEnvironment' } -export interface IContributedKernelFinder - extends ObservableDisposable { +export interface IContributedKernelFinder< + T extends KernelConnectionMetadata = KernelConnectionMetadata +> extends ObservableDisposable { readonly status: 'discovering' | 'idle'; onDidChangeStatus: Event; /** diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts index b9271dee5..88e5c391f 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts @@ -118,9 +118,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { }); test('Jupyter cannot be started because no interpreter has been selected', async () => { when(interpreterService.getActiveInterpreter(undefined)).thenResolve(undefined); - const reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + const reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); assert.equal(reason, DataScience.selectJupyterInterpreter); }); test('Jupyter cannot be started because jupyter is not installed', async () => { @@ -152,9 +151,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { when(jupyterDependencyService.getDependenciesNotInstalled(activePythonInterpreter, undefined)).thenResolve([ Product.jupyter ]); - const reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + const reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); assert.equal(reason, expectedReason); }); test('Jupyter cannot be started because notebook is not installed', async () => { @@ -183,9 +181,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { when(jupyterDependencyService.getDependenciesNotInstalled(activePythonInterpreter, undefined)).thenResolve([ Product.notebook ]); - const reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + const reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); assert.equal(reason, expectedReason); }); test('Cannot start notebook', async () => { @@ -306,9 +303,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { jupyterDependencyService.getDependenciesNotInstalled(selectedJupyterInterpreter, undefined) ).thenResolve([Product.jupyter]); - let reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + let reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); // replace interpreter name with *** to workaround flakey test. reason = reason.replace(/('.*?')/g, "'***'"); @@ -343,9 +339,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { jupyterDependencyService.getDependenciesNotInstalled(selectedJupyterInterpreter, undefined) ).thenResolve([Product.notebook]); - let reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + let reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); // replace interpreter name with *** to workaround flakey test. reason = reason.replace(/('.*?')/g, "'***'"); @@ -356,9 +351,8 @@ suite('Jupyter InterpreterSubCommandExecutionService', () => { jupyterDependencyService.getDependenciesNotInstalled(selectedJupyterInterpreter, undefined) ).thenResolve([Product.kernelspec]); - const reason = await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported( - undefined - ); + const reason = + await jupyterInterpreterExecutionService.getReasonForJupyterNotebookNotBeingSupported(undefined); assert.equal(reason, DataScience.jupyterKernelSpecModuleNotFound(selectedJupyterInterpreter.uri.fsPath)); }); diff --git a/src/kernels/jupyter/types.ts b/src/kernels/jupyter/types.ts index ea2413a26..e30169833 100644 --- a/src/kernels/jupyter/types.ts +++ b/src/kernels/jupyter/types.ts @@ -236,7 +236,8 @@ export interface IJupyterRemoteCachedKernelValidator { } export interface IRemoteKernelFinder - extends IContributedKernelFinder, + extends + IContributedKernelFinder, IQuickPickItemProvider { kind: ContributedKernelFinderKind.Remote; serverProviderHandle: JupyterServerProviderHandle; diff --git a/src/kernels/kernel.ts b/src/kernels/kernel.ts index ef3eece34..be2073f97 100644 --- a/src/kernels/kernel.ts +++ b/src/kernels/kernel.ts @@ -343,8 +343,8 @@ abstract class BaseKernel implements IBaseKernel { this._session = this._session ? this._session : this._jupyterSessionPromise - ? await this._jupyterSessionPromise.catch(() => undefined) - : undefined; + ? await this._jupyterSessionPromise.catch(() => undefined) + : undefined; this._jupyterSessionPromise = undefined; this._postInitializedOnStartPromise = undefined; if (this._session) { @@ -920,11 +920,11 @@ abstract class BaseKernel implements IBaseKernel { logger.error('Failed to determine version of IPyWidgets', ex) ); if (Array.isArray(version)) { - const isVersion8 = version.some( - (output) => (output.text || '')?.toString().includes(`${widgetVersionOutPrefix}8.`) + const isVersion8 = version.some((output) => + (output.text || '')?.toString().includes(`${widgetVersionOutPrefix}8.`) ); - const isVersion7 = version.some( - (output) => (output.text || '')?.toString().includes(`${widgetVersionOutPrefix}7.`) + const isVersion7 = version.some((output) => + (output.text || '')?.toString().includes(`${widgetVersionOutPrefix}7.`) ); const newVersion = (this._ipywidgetsVersion = isVersion7 ? 7 : isVersion8 ? 8 : undefined); diff --git a/src/kernels/raw/finder/localKernelSpecFinderBase.node.ts b/src/kernels/raw/finder/localKernelSpecFinderBase.node.ts index 50a2b935a..0294a377a 100644 --- a/src/kernels/raw/finder/localKernelSpecFinderBase.node.ts +++ b/src/kernels/raw/finder/localKernelSpecFinderBase.node.ts @@ -196,8 +196,8 @@ export interface ILocalKernelFinder + T extends LocalKernelSpecConnectionMetadata | PythonKernelConnectionMetadata +> implements IDisposable, ILocalKernelFinder { protected readonly disposables: IDisposable[] = []; diff --git a/src/kernels/raw/session/kernelWorkingDirectory.node.ts b/src/kernels/raw/session/kernelWorkingDirectory.node.ts index 474b130d5..2a4c8568a 100644 --- a/src/kernels/raw/session/kernelWorkingDirectory.node.ts +++ b/src/kernels/raw/session/kernelWorkingDirectory.node.ts @@ -59,8 +59,8 @@ export async function computeLocalWorkingDirectory( suggestedDir && suggestedDir.includes('${') ? suggestedDir : suggestedDir - ? getFilePath(Uri.file(suggestedDir)) - : undefined; + ? getFilePath(Uri.file(suggestedDir)) + : undefined; const expandedWorkingDir = expandWorkingDir(workingDir, resource, configService.getSettings(resource)); if (await fs.exists(Uri.file(expandedWorkingDir))) { return expandedWorkingDir; diff --git a/src/kernels/raw/session/rawKernelConnection.node.ts b/src/kernels/raw/session/rawKernelConnection.node.ts index 5ffdb3f4a..889d777d3 100644 --- a/src/kernels/raw/session/rawKernelConnection.node.ts +++ b/src/kernels/raw/session/rawKernelConnection.node.ts @@ -390,9 +390,7 @@ export class RawKernelConnection implements Kernel.IKernelConnection { } public requestHistory( content: - | KernelMessage.IHistoryRequestRange - | KernelMessage.IHistoryRequestSearch - | KernelMessage.IHistoryRequestTail + KernelMessage.IHistoryRequestRange | KernelMessage.IHistoryRequestSearch | KernelMessage.IHistoryRequestTail ): Promise { return this.realKernel!.requestHistory(content); } diff --git a/src/kernels/types.ts b/src/kernels/types.ts index 642ca583f..3f19dc341 100644 --- a/src/kernels/types.ts +++ b/src/kernels/types.ts @@ -307,8 +307,7 @@ export type KernelConnectionMetadata = RemoteKernelConnectionMetadata | LocalKer * Connection metadata for local kernels. Makes it easier to not have to check for the live connection type. */ export type LocalKernelConnectionMetadata = - | Readonly - | Readonly; + Readonly | Readonly; /** * Connection metadata for remote kernels. Makes it easier to not have to check for the live connection type. @@ -333,12 +332,7 @@ export function isRemoteConnection( } export type KernelHooks = - | 'willRestart' - | 'willInterrupt' - | 'restartCompleted' - | 'interruptCompleted' - | 'didStart' - | 'willCancel'; + 'willRestart' | 'willInterrupt' | 'restartCompleted' | 'interruptCompleted' | 'didStart' | 'willCancel'; export interface IStartOptions extends IDisplayOptions { /** diff --git a/src/notebooks/controllers/kernelConnector.ts b/src/notebooks/controllers/kernelConnector.ts index 234703ba0..f4086b26f 100644 --- a/src/notebooks/controllers/kernelConnector.ts +++ b/src/notebooks/controllers/kernelConnector.ts @@ -172,9 +172,7 @@ export class KernelConnector { kernel: Deferred<{ kernel: IKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted'; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted'; }>; options: IDisplayOptions; } @@ -185,9 +183,7 @@ export class KernelConnector { kernel: Deferred<{ kernel: IBaseKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted'; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted'; }>; options: IDisplayOptions; } @@ -201,16 +197,12 @@ export class KernelConnector { | Promise<{ kernel: IBaseKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted'; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted'; }> | Promise<{ kernel: IKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted'; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted'; }>, actionSource: KernelActionSource, onAction: (action: KernelAction, kernel: IBaseKernel) => void, @@ -355,10 +347,7 @@ export class KernelConnector { deferred: Deferred<{ kernel: IBaseKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted' - | undefined; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted' | undefined; }>, options: IDisplayOptions ) { @@ -383,10 +372,7 @@ export class KernelConnector { matchingKernelPromise?: Promise<{ kernel: IBaseKernel; deadKernelAction?: - | 'deadKernelNeedsToBeRestarted' - | 'deadKernelWasNoRestarted' - | 'deadKernelWasRestarted' - | undefined; + 'deadKernelNeedsToBeRestarted' | 'deadKernelWasNoRestarted' | 'deadKernelWasRestarted' | undefined; }> ) { if (!matchingKernelPromise) { @@ -580,5 +566,4 @@ export class KernelConnector { } type NotebookResource = - | { resource: Resource; notebook: NotebookDocument; controller: IKernelController } - | { resource: Uri }; + { resource: Resource; notebook: NotebookDocument; controller: IKernelController } | { resource: Uri }; diff --git a/src/notebooks/controllers/kernelSource/baseKernelSelector.ts b/src/notebooks/controllers/kernelSource/baseKernelSelector.ts index 9e9d57458..c766b936e 100644 --- a/src/notebooks/controllers/kernelSource/baseKernelSelector.ts +++ b/src/notebooks/controllers/kernelSource/baseKernelSelector.ts @@ -25,10 +25,7 @@ import { import { IConnectionDisplayData, IConnectionDisplayDataProvider } from '../types'; import { DisposableBase } from '../../../platform/common/utils/lifecycle'; export type CompoundQuickPickItem = - | CommandQuickPickItem - | ConnectionQuickPickItem - | KernelListErrorQuickPickItem - | QuickPickItem; + CommandQuickPickItem | ConnectionQuickPickItem | KernelListErrorQuickPickItem | QuickPickItem; export function isKernelPickItem(item: CompoundQuickPickItem): item is ConnectionQuickPickItem { return 'connection' in item; } diff --git a/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts b/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts index 3dd9fda89..5dfd56b20 100644 --- a/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts +++ b/src/notebooks/controllers/kernelSource/remoteNotebookKernelSourceSelector.ts @@ -147,9 +147,7 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel | QuickPickItem )[] = []; const quickPickCommandItems: ( - | ContributedKernelFinderQuickPickItem - | KernelProviderItemsQuickPickItem - | QuickPickItem + ContributedKernelFinderQuickPickItem | KernelProviderItemsQuickPickItem | QuickPickItem )[] = []; const serversAndTimes: { server: IRemoteKernelFinder; time?: number }[] = []; @@ -292,9 +290,7 @@ export class RemoteNotebookKernelSourceSelector implements IRemoteNotebookKernel if (serverProvider) { // If the only item is a server, then aut select that. const itemsWithoutSeparators = items.filter((i) => 'type' in i) as ( - | ContributedKernelFinderQuickPickItem - | KernelProviderItemsQuickPickItem - | JupyterServerQuickPickItem + ContributedKernelFinderQuickPickItem | KernelProviderItemsQuickPickItem | JupyterServerQuickPickItem )[]; if ( itemsWithoutSeparators.length === 1 && diff --git a/src/notebooks/controllers/preferredKernelConnectionService.node.ts b/src/notebooks/controllers/preferredKernelConnectionService.node.ts index 08123f1d2..d5ef39caa 100644 --- a/src/notebooks/controllers/preferredKernelConnectionService.node.ts +++ b/src/notebooks/controllers/preferredKernelConnectionService.node.ts @@ -97,8 +97,7 @@ export async function getRecommendedPythonEnvironment(uri: Uri): Promise c.document.uri.toString() === mapping.toString()); - const offset = cell ? this.lineOffsets.get(cell) ?? 0 : 0; + const offset = cell ? (this.lineOffsets.get(cell) ?? 0) : 0; source.name = path.basename(mapping.path); source.path = mapping.toString(); if (offset && typeof location?.endLine === 'number') { @@ -79,7 +79,7 @@ export class KernelDebugAdapter extends KernelDebugAdapterBase { return; } const cell = this.notebookDocument.getCells().find((c) => c.document.uri.toString() === source.path); - const offset = cell ? this.lineOffsets.get(cell) ?? 0 : 0; + const offset = cell ? (this.lineOffsets.get(cell) ?? 0) : 0; source.path = mapping; if (offset && typeof location.line === 'number') { if (location.line < offset) { diff --git a/src/notebooks/deepnote/deepnoteTestHelpers.ts b/src/notebooks/deepnote/deepnoteTestHelpers.ts index 593d6bbea..443627457 100644 --- a/src/notebooks/deepnote/deepnoteTestHelpers.ts +++ b/src/notebooks/deepnote/deepnoteTestHelpers.ts @@ -144,7 +144,7 @@ export function createMockCell(options?: CreateMockCellOptions): NotebookCell { } = opts; // Preserve explicit undefined for metadata fields - const metadata = 'metadata' in opts ? opts.metadata ?? {} : {}; + const metadata = 'metadata' in opts ? (opts.metadata ?? {}) : {}; const notebookMetadata = Object.prototype.hasOwnProperty.call(opts, 'notebookMetadata') ? opts.notebookMetadata : {}; diff --git a/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.ts b/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.ts index eb085ad92..2a868c57b 100644 --- a/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.ts +++ b/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.ts @@ -121,7 +121,7 @@ export class FederatedAuthSqlBlockCodeGenerator implements IFederatedAuthSqlBloc const query = sqlBlock.content ?? ''; const rawVariableName = sqlBlock.metadata?.deepnote_variable_name; const pythonVariableName = - rawVariableName !== undefined ? sanitizePythonVariableName(rawVariableName) ?? 'input_1' : undefined; + rawVariableName !== undefined ? (sanitizePythonVariableName(rawVariableName) ?? 'input_1') : undefined; const returnVariableType: SqlCellVariableType = sqlBlock.metadata?.deepnote_return_variable_type ?? 'dataframe'; const sqlCacheMode: SqlCacheMode = 'cache_disabled'; diff --git a/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.unit.test.ts b/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.unit.test.ts index 6b2aa9ed1..472da3225 100644 --- a/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.unit.test.ts +++ b/src/notebooks/deepnote/integrations/federatedAuth/federatedAuthSqlBlockCodeGenerator.node.unit.test.ts @@ -71,7 +71,7 @@ suite('FederatedAuthSqlBlockCodeGenerator', () => { tokens.delete(id); }); getMergedIntegrationConfigsSpy = sinon.spy(async (resource: Resource) => - resource ? mergedIntegrationConfigs.get(resource.toString()) ?? [] : [] + resource ? (mergedIntegrationConfigs.get(resource.toString()) ?? []) : [] ); // Declared as a plain object (not a typed literal) so the extra members the provider grows for other diff --git a/src/notebooks/deepnote/integrations/integrationWebview.ts b/src/notebooks/deepnote/integrations/integrationWebview.ts index e103537a0..aa3515315 100644 --- a/src/notebooks/deepnote/integrations/integrationWebview.ts +++ b/src/notebooks/deepnote/integrations/integrationWebview.ts @@ -719,7 +719,7 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider { // Legacy big-query configs may omit authMethod, which means service-account. const authMethod = message.config.type === 'big-query' - ? message.config.metadata.authMethod ?? BigQueryAuthMethods.ServiceAccount + ? (message.config.metadata.authMethod ?? BigQueryAuthMethods.ServiceAccount) : undefined; this.analytics.trackEvent({ diff --git a/src/notebooks/deepnote/integrations/integrationWebview.unit.test.ts b/src/notebooks/deepnote/integrations/integrationWebview.unit.test.ts index 53205f09d..2851aed1b 100644 --- a/src/notebooks/deepnote/integrations/integrationWebview.unit.test.ts +++ b/src/notebooks/deepnote/integrations/integrationWebview.unit.test.ts @@ -620,10 +620,10 @@ suite('IntegrationWebviewProvider', () => { await provider.refresh(PROJECT_ID, linkedMap()); - assert.deepStrictEqual(lastUpdate().integrations?.map((integration) => integration.id), [ - 'pg-1', - 'pg-linked' - ]); + assert.deepStrictEqual( + lastUpdate().integrations?.map((integration) => integration.id), + ['pg-1', 'pg-linked'] + ); sinon.assert.notCalled(reveal); }); diff --git a/src/platform/api/python-envs/api.ts b/src/platform/api/python-envs/api.ts index 344b73c85..6f86b3dee 100644 --- a/src/platform/api/python-envs/api.ts +++ b/src/platform/api/python-envs/api.ts @@ -928,7 +928,8 @@ export interface PythonProjectEnvironmentApi { } export interface PythonEnvironmentManagerApi - extends PythonEnvironmentManagerRegistrationApi, + extends + PythonEnvironmentManagerRegistrationApi, PythonEnvironmentItemApi, PythonEnvironmentManagementApi, PythonEnvironmentsApi, @@ -993,7 +994,8 @@ export interface PythonPackageManagementApi { } export interface PythonPackageManagerApi - extends PythonPackageManagerRegistrationApi, + extends + PythonPackageManagerRegistrationApi, PythonPackageGetterApi, PythonPackageManagementApi, PythonPackageItemApi {} @@ -1212,10 +1214,7 @@ export interface PythonBackgroundRunApi { } export interface PythonExecutionApi - extends PythonTerminalCreateApi, - PythonTerminalRunApi, - PythonTaskRunApi, - PythonBackgroundRunApi {} + extends PythonTerminalCreateApi, PythonTerminalRunApi, PythonTaskRunApi, PythonBackgroundRunApi {} /** * Event arguments for when the monitored `.env` files or any other sources change. @@ -1263,7 +1262,8 @@ export interface PythonEnvironmentVariablesApi { * The API for interacting with Python environments, package managers, and projects. */ export interface PythonEnvironmentApi - extends PythonEnvironmentManagerApi, + extends + PythonEnvironmentManagerApi, PythonPackageManagerApi, PythonProjectApi, PythonExecutionApi, diff --git a/src/platform/api/pythonApi.ts b/src/platform/api/pythonApi.ts index 18e620063..e649e7958 100644 --- a/src/platform/api/pythonApi.ts +++ b/src/platform/api/pythonApi.ts @@ -532,14 +532,14 @@ export class InterpreterService implements IInterpreterService { return isUri(pythonPath) ? areInterpreterPathsSame(item.executable.uri, pythonPath) : typeof pythonPath === 'string' - ? item.id === pythonPath - : areInterpreterPathsSame(Uri.file(item.path), Uri.file(pythonPath.path)); + ? item.id === pythonPath + : areInterpreterPathsSame(Uri.file(item.path), Uri.file(pythonPath.path)); }); const pythonPathForLogging = isUri(pythonPath) ? getDisplayPath(pythonPath) : typeof pythonPath === 'string' - ? pythonPath - : getDisplayPath(Uri.file(pythonPath.path)); + ? pythonPath + : getDisplayPath(Uri.file(pythonPath.path)); if (matchedPythonEnv) { const env = await api.environments.resolveEnvironment(matchedPythonEnv); const resolved = this.trackResolvedEnvironment(env); diff --git a/src/platform/common/application/commands/runInDedicatedExtensionHost.node.ts b/src/platform/common/application/commands/runInDedicatedExtensionHost.node.ts index 0562ea1e1..d28b60cc5 100644 --- a/src/platform/common/application/commands/runInDedicatedExtensionHost.node.ts +++ b/src/platform/common/application/commands/runInDedicatedExtensionHost.node.ts @@ -18,8 +18,7 @@ export class RunInDedicatedExtensionHostCommandHandler implements IExtensionSync } private async updateAffinity() { const affinity = workspace.getConfiguration('extensions').get('experimental.affinity') as - | { [key: string]: number } - | undefined; + { [key: string]: number } | undefined; let maxAffinity = 0; if (affinity) { Object.values(affinity).forEach((value) => { diff --git a/src/platform/common/application/workspace.base.ts b/src/platform/common/application/workspace.base.ts index f38b95232..4635e19f1 100644 --- a/src/platform/common/application/workspace.base.ts +++ b/src/platform/common/application/workspace.base.ts @@ -18,8 +18,8 @@ export function getWorkspaceFolderIdentifier(resource: Resource, defaultValue: s const workspaceFolder = resource ? workspace.getWorkspaceFolder(resource) : workspace.workspaceFolders - ? workspace.workspaceFolders[0] // Default to first folder if resource not passed in. - : undefined; + ? workspace.workspaceFolders[0] // Default to first folder if resource not passed in. + : undefined; return workspaceFolder ? path.normalize( getOSType() === OSType.Windows ? workspaceFolder.uri.path.toUpperCase() : workspaceFolder.uri.path diff --git a/src/platform/common/configuration/service.base.ts b/src/platform/common/configuration/service.base.ts index 79f150ab5..65096847e 100644 --- a/src/platform/common/configuration/service.base.ts +++ b/src/platform/common/configuration/service.base.ts @@ -72,8 +72,8 @@ export abstract class BaseConfigurationService implements IConfigurationService target === ConfigurationTarget.Global ? setting.globalValue : target === ConfigurationTarget.Workspace - ? setting.workspaceValue - : setting.workspaceFolderValue; + ? setting.workspaceValue + : setting.workspaceFolderValue; if (actual === value) { break; } diff --git a/src/platform/common/providerBasedQuickPick.ts b/src/platform/common/providerBasedQuickPick.ts index 468a1bcf9..206032daf 100644 --- a/src/platform/common/providerBasedQuickPick.ts +++ b/src/platform/common/providerBasedQuickPick.ts @@ -474,8 +474,8 @@ export class BaseProviderBasedQuickPick extends Dispos const activeItems = selectedQuickPickItem ? [selectedQuickPickItem] : quickPick.activeItems.length - ? [quickPick.activeItems[0]] - : []; + ? [quickPick.activeItems[0]] + : []; if (activeItems.length && !items.includes(activeItems[0])) { const oldActiveItem = activeItems[0]; const newActiveQuickPickItem = diff --git a/src/platform/common/utils.ts b/src/platform/common/utils.ts index e6adb0da0..766f13c19 100644 --- a/src/platform/common/utils.ts +++ b/src/platform/common/utils.ts @@ -310,13 +310,13 @@ export function parseForComments( const isMultilineComment = trim.startsWith(SingleQuoteMultiline) ? SingleQuoteMultiline : trim.startsWith(DoubleQuoteMultiline) - ? DoubleQuoteMultiline - : undefined; + ? DoubleQuoteMultiline + : undefined; const isMultilineQuote = trim.includes(SingleQuoteMultiline) ? SingleQuoteMultiline : trim.includes(DoubleQuoteMultiline) - ? DoubleQuoteMultiline - : undefined; + ? DoubleQuoteMultiline + : undefined; // Check for ending quotes of multiline string if (insideMultilineQuote) { diff --git a/src/platform/common/utils/typescript.ts b/src/platform/common/utils/typescript.ts index b20c3bf7f..0b4033f21 100644 --- a/src/platform/common/utils/typescript.ts +++ b/src/platform/common/utils/typescript.ts @@ -1,18 +1,12 @@ type IsAny = 0 extends 1 & T ? true : false; type ArrayElement = T extends readonly unknown[] ? T[number] : never; type IsNonAnyString = IsAny extends true ? false : [T] extends [string] ? true : false; -type IsNonAnyStringArray = IsAny extends true - ? false - : IsAny> extends true - ? false - : [T] extends [string[]] - ? true - : false; +type IsNonAnyStringArray = + IsAny extends true ? false : IsAny> extends true ? false : [T] extends [string[]] ? true : false; export type AssertNonAnyString = IsNonAnyString extends true ? true : 'ERROR: expected a non-any string'; -export type AssertNonAnyStringArray = IsNonAnyStringArray extends true - ? true - : 'ERROR: expected a non-any string array'; +export type AssertNonAnyStringArray = + IsNonAnyStringArray extends true ? true : 'ERROR: expected a non-any string array'; /** * Static check test cases fixtures diff --git a/src/platform/common/variables/customEnvironmentVariablesProvider.node.ts b/src/platform/common/variables/customEnvironmentVariablesProvider.node.ts index 7b056477e..924eb74b7 100644 --- a/src/platform/common/variables/customEnvironmentVariablesProvider.node.ts +++ b/src/platform/common/variables/customEnvironmentVariablesProvider.node.ts @@ -53,8 +53,8 @@ export class CustomEnvironmentVariablesProvider implements ICustomEnvironmentVar resource = resource ? resource : workspace.workspaceFolders?.length - ? workspace.workspaceFolders[0].uri - : undefined; + ? workspace.workspaceFolders[0].uri + : undefined; if (purpose === 'RunPythonCode') { // No need to cache for Python code, as we get these env vars from Python extension. @@ -87,8 +87,8 @@ export class CustomEnvironmentVariablesProvider implements ICustomEnvironmentVar resource = resource ? resource : workspace.workspaceFolders?.length - ? workspace.workspaceFolders[0].uri - : undefined; + ? workspace.workspaceFolders[0].uri + : undefined; const workspaceFolderUri = this.getWorkspaceFolderUri(resource); if (!workspaceFolderUri) { logger.ci(`No workspace folder found for ${resource ? resource.fsPath : ''}`); diff --git a/src/platform/interpreter/environmentActivationService.node.ts b/src/platform/interpreter/environmentActivationService.node.ts index 1d40753ad..1e9846d03 100644 --- a/src/platform/interpreter/environmentActivationService.node.ts +++ b/src/platform/interpreter/environmentActivationService.node.ts @@ -149,8 +149,8 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi resource = resource ? resource : workspace.workspaceFolders?.length - ? workspace.workspaceFolders[0].uri - : undefined; + ? workspace.workspaceFolders[0].uri + : undefined; const stopWatch = new StopWatch(); // We'll need this later. const customEnvVarsPromise = this.customEnvVarsService @@ -159,9 +159,8 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi // Check cache. let reasonForFailure: - | 'emptyVariables' - | 'failedToGetActivatedEnvVariablesFromPython' - | 'failedToGetCustomEnvVariables' = 'emptyVariables'; + 'emptyVariables' | 'failedToGetActivatedEnvVariablesFromPython' | 'failedToGetCustomEnvVariables' = + 'emptyVariables'; let failureEx: Error | undefined; let env = await this.apiProvider.getApi().then((api) => diff --git a/src/platform/interpreter/pythonEnvironmentPicker.node.ts b/src/platform/interpreter/pythonEnvironmentPicker.node.ts index db4abfba8..bbe3693c0 100644 --- a/src/platform/interpreter/pythonEnvironmentPicker.node.ts +++ b/src/platform/interpreter/pythonEnvironmentPicker.node.ts @@ -15,8 +15,8 @@ export function pythonEnvironmentQuickPick(item: Environment, quickPick: BasePro item.id === quickPick.recommended?.id ? '$(star-full) ' : isCondaEnvironmentWithoutPython(item) - ? '$(warning) ' - : ''; + ? '$(warning) ' + : ''; const quickPickItem: QuickPickItem = { label: `${icon}${label}` }; quickPickItem.description = getDisplayPath(item.executable.uri || item.path, workspace.workspaceFolders || []); quickPickItem.tooltip = isCondaEnvironmentWithoutPython(item) ? DataScience.pythonCondaKernelsWithoutPython : ''; diff --git a/src/platform/interpreter/pythonExecutionFactory.node.ts b/src/platform/interpreter/pythonExecutionFactory.node.ts index bd0759dd1..f37092933 100644 --- a/src/platform/interpreter/pythonExecutionFactory.node.ts +++ b/src/platform/interpreter/pythonExecutionFactory.node.ts @@ -46,8 +46,8 @@ export class PythonExecutionFactory implements IPythonExecutionFactory { options.resource = options.resource ? options.resource : workspace.workspaceFolders?.length - ? workspace.workspaceFolders[0].uri - : undefined; + ? workspace.workspaceFolders[0].uri + : undefined; // This should never happen, but if it does ensure we never run code accidentally in untrusted workspaces. if (!workspace.isTrusted) { diff --git a/src/platform/telemetry/index.ts b/src/platform/telemetry/index.ts index 21a21d53f..7f5554f0f 100644 --- a/src/platform/telemetry/index.ts +++ b/src/platform/telemetry/index.ts @@ -98,8 +98,8 @@ function sanitizeProperties(eventName: string, data: Record) { typeof data[prop] === 'string' ? data[prop] : typeof data[prop] === 'object' - ? 'object' - : data[prop].toString(); + ? 'object' + : data[prop].toString(); } catch (ex) { logger.error(`Failed to serialize ${prop} for ${eventName}`, ex); } @@ -115,8 +115,7 @@ function sanitizeProperties(eventName: string, data: Record) { export function sendTelemetryEvent

( eventName: E, measures?: - | (P[E] extends TelemetryEventInfo ? PickType, number> : undefined) - | undefined, + (P[E] extends TelemetryEventInfo ? PickType, number> : undefined) | undefined, properties?: P[E] extends TelemetryEventInfo ? ExcludeType extends never | undefined ? undefined @@ -148,19 +147,15 @@ function isPerfMeasurementOnCI(eventName: string) { ); } -export type TelemetryProperties< - E extends keyof P, - P extends IEventNamePropertyMapping = IEventNamePropertyMapping -> = P[E] extends TelemetryEventInfo - ? ExcludeType extends never | undefined - ? undefined - : ExcludeType - : undefined | undefined; +export type TelemetryProperties = + P[E] extends TelemetryEventInfo + ? ExcludeType extends never | undefined + ? undefined + : ExcludeType + : undefined | undefined; -export type TelemetryMeasures< - E extends keyof P, - P extends IEventNamePropertyMapping = IEventNamePropertyMapping -> = P[E] extends TelemetryEventInfo ? PickType, number> : undefined; +export type TelemetryMeasures = + P[E] extends TelemetryEventInfo ? PickType, number> : undefined; function sendTelemetryEventInternal

( eventName: E, @@ -211,11 +206,13 @@ export type PickTypeNumberProps = { [P in keyof T as T[P] extends Value ? P : never]: T[P]; }; export type PickPropertiesOnly = { - [P in keyof T as T[P] extends TelemetryEventInfo - ? keyof PickType extends never - ? never - : P - : never]: T[P]; + [ + P in keyof T as T[P] extends TelemetryEventInfo + ? keyof PickType extends never + ? never + : P + : never + ]: T[P]; }; /** diff --git a/src/standalone/chat/createVirtualEnv.python.node.ts b/src/standalone/chat/createVirtualEnv.python.node.ts index 7631559ad..a6f3e413f 100644 --- a/src/standalone/chat/createVirtualEnv.python.node.ts +++ b/src/standalone/chat/createVirtualEnv.python.node.ts @@ -139,8 +139,8 @@ function getWorkspaceVenvOrCondaEnv(resource: Uri | undefined, api: PythonExtens resource && workspace.workspaceFolders?.length ? workspace.getWorkspaceFolder(resource) : workspace.workspaceFolders?.length === 1 - ? workspace.workspaceFolders[0] - : undefined; + ? workspace.workspaceFolders[0] + : undefined; if (!workspaceFolder) { return; } diff --git a/src/standalone/chat/helper.ts b/src/standalone/chat/helper.ts index ca061da03..d42ccfb34 100644 --- a/src/standalone/chat/helper.ts +++ b/src/standalone/chat/helper.ts @@ -69,10 +69,10 @@ export abstract class BaseTool implements LanguageMod const failureCategory = isCancelled ? 'cancelled' : error - ? error instanceof BaseError - ? error.category - : 'error' - : undefined; + ? error instanceof BaseError + ? error.category + : 'error' + : undefined; const resourceHash = notebookUri ? // eslint-disable-next-line local-rules/dont-use-fspath getTelemetrySafeHashedString(notebookUri.fsPath) diff --git a/src/standalone/intellisense/resolveCompletionItem.unit.test.ts b/src/standalone/intellisense/resolveCompletionItem.unit.test.ts index 88a6b5050..075f3daf9 100644 --- a/src/standalone/intellisense/resolveCompletionItem.unit.test.ts +++ b/src/standalone/intellisense/resolveCompletionItem.unit.test.ts @@ -46,7 +46,7 @@ suite('Jupyter Kernel Completion (requestInspect)', () => { let disposables: IDisposable[] = []; let toDispose: DisposableStore; let clock: fakeTimers.InstalledClock; - let resolveCompletionItem: typeof import('./resolveCompletionItem')['resolveCompletionItem']; + let resolveCompletionItem: (typeof import('./resolveCompletionItem'))['resolveCompletionItem']; let maxPendingKernelRequests: number; let execCodeInBackgroundThreadStub: sinon.SinonStub<[...args: any[]], Promise>; diff --git a/src/standalone/userJupyterServer/userServerUrlProvider.ts b/src/standalone/userJupyterServer/userServerUrlProvider.ts index 0ec631526..cfb9e93e3 100644 --- a/src/standalone/userJupyterServer/userServerUrlProvider.ts +++ b/src/standalone/userJupyterServer/userServerUrlProvider.ts @@ -308,11 +308,7 @@ export class UserJupyterServerUrlProvider ): Promise { await this.initializeServers(); type Steps = - | 'Get Url' - | 'Check Passwords' - | 'Check Insecure Connections' - | 'Verify Connection' - | 'Get Display Name'; + 'Get Url' | 'Check Passwords' | 'Check Insecure Connections' | 'Verify Connection' | 'Get Display Name'; const disposables: Disposable[] = []; let jupyterServerUri: IJupyterServerUri = { baseUrl: '', displayName: '', token: '' }; @@ -565,8 +561,8 @@ export class UserJupyterServerUrlProvider previousStep = isInsecureConnection ? 'Check Insecure Connections' : requiresPassword && jupyterServerUri.token.length === 0 - ? 'Check Passwords' - : 'Get Url'; + ? 'Check Passwords' + : 'Get Url'; if (previousStep === 'Get Url') { // If we were given a Url, then back should get out of this flow. previousStep = initialUrlWasValid && initialUrl ? undefined : 'Get Url'; diff --git a/src/standalone/variables/kernelVariables.ts b/src/standalone/variables/kernelVariables.ts index cf569e191..af08312ec 100644 --- a/src/standalone/variables/kernelVariables.ts +++ b/src/standalone/variables/kernelVariables.ts @@ -275,7 +275,7 @@ export class KernelVariables implements IJupyterVariables { result.pageStartIndex = startPos; // Do one at a time. All at once doesn't work as they all have to wait for each other anyway - for (let i = startPos; i < startPos + chunkSize && i < list.variables.length; ) { + for (let i = startPos; i < startPos + chunkSize && i < list.variables.length;) { if (exclusionList && exclusionList.indexOf(list.variables[i].type) >= 0) { // Remove from the list before fetching the full value list.variables.splice(i, 1); diff --git a/src/telemetry.ts b/src/telemetry.ts index c02aa6c1a..4b4eb1720 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -148,35 +148,34 @@ type EventPropertiesData = AllEventPropertiesData; type GdprEventDefinition

= P extends never | undefined ? IEventData : keyof EventPropertiesData, number | undefined>> extends never | undefined - ? IEventData & { - measures: EventPropertiesData> | EventPropertiesData>; - } - : keyof (EventPropertiesData> & EventPropertiesData>) extends - | never - | undefined - ? IEventData & { - properties: EventPropertiesData, number | undefined>>; - } - : IEventData & { - measures: EventPropertiesData> | EventPropertiesData>; - properties: EventPropertiesData, number | undefined>>; - }; + ? IEventData & { + measures: EventPropertiesData> | EventPropertiesData>; + } + : keyof (EventPropertiesData> & EventPropertiesData>) extends + never | undefined + ? IEventData & { + properties: EventPropertiesData, number | undefined>>; + } + : IEventData & { + measures: EventPropertiesData> | EventPropertiesData>; + properties: EventPropertiesData, number | undefined>>; + }; type PropertyMeasureDefinition

= P extends never ? never : keyof EventPropertiesData, number | undefined>> extends never - ? { - measures: EventPropertiesData> | EventPropertiesData>; - } - : keyof (EventPropertiesData> & - EventPropertiesData>) extends never - ? { - properties: EventPropertiesData, number | undefined>>; - } - : { - measures: EventPropertiesData> | EventPropertiesData>; - properties: EventPropertiesData, number | undefined>>; - }; + ? { + measures: EventPropertiesData> | EventPropertiesData>; + } + : keyof (EventPropertiesData> & + EventPropertiesData>) extends never + ? { + properties: EventPropertiesData, number | undefined>>; + } + : { + measures: EventPropertiesData> | EventPropertiesData>; + properties: EventPropertiesData, number | undefined>>; + }; function globallySharedProperties(): PropertyMeasureDefinition['properties'] { return { diff --git a/src/test/datascience/fakeKernelConnection.node.ts b/src/test/datascience/fakeKernelConnection.node.ts index 2a9baf15b..de46dad01 100644 --- a/src/test/datascience/fakeKernelConnection.node.ts +++ b/src/test/datascience/fakeKernelConnection.node.ts @@ -22,8 +22,8 @@ function deserialize(msg: string | ArrayBuffer): KernelMessage.IMessage { return typeof msg === 'string' ? JSON.parse(msg) : msg instanceof ArrayBuffer - ? jupyterLabSerialize.deserialize(msg) - : msg; + ? jupyterLabSerialize.deserialize(msg) + : msg; } function serialize(msg: KernelMessage.IMessage, protocol?: string): string | ArrayBuffer { return jupyterLabSerialize.serialize(msg, protocol); diff --git a/src/test/datascience/notebook/controllerPreferredService.ts b/src/test/datascience/notebook/controllerPreferredService.ts index 212c778a2..d3e399fd3 100644 --- a/src/test/datascience/notebook/controllerPreferredService.ts +++ b/src/test/datascience/notebook/controllerPreferredService.ts @@ -221,8 +221,9 @@ export class ControllerPreferredService { // & now that we have more controllers, we know more about what needs to be matched // & since we no longer have a preferred, we should probably unset the previous preferred logger.debug( - `Resetting the previous preferred controller ${this.preferredControllers.get(document) - ?.id} to default affinity for document ${getDisplayPath(document.uri)}` + `Resetting the previous preferred controller ${ + this.preferredControllers.get(document)?.id + } to default affinity for document ${getDisplayPath(document.uri)}` ); await this.preferredControllers .get(document) @@ -309,8 +310,9 @@ export class ControllerPreferredService { // & now that we have more controllers, we know more about what needs to be matched // & since we no longer have a preferred, we should probably unset the previous preferred logger.debug( - `Resetting the previous preferred controller ${this.preferredControllers.get(document) - ?.id} to default affinity for document ${getDisplayPath(document.uri)}` + `Resetting the previous preferred controller ${ + this.preferredControllers.get(document)?.id + } to default affinity for document ${getDisplayPath(document.uri)}` ); await this.preferredControllers .get(document) diff --git a/src/test/datascience/notebook/helper.ts b/src/test/datascience/notebook/helper.ts index 2d37cce17..be2f5c007 100644 --- a/src/test/datascience/notebook/helper.ts +++ b/src/test/datascience/notebook/helper.ts @@ -520,8 +520,9 @@ async function waitForKernelToChangeImpl( const criteria = typeof searchCriteria === 'function' ? await searchCriteria() : searchCriteria; lastCriteria = JSON.stringify(lastCriteria); logger.ci( - `Notebook select.kernel command switching to kernel id ${controller?.connection - .kind}${controller?.id}: Try ${tryCount} for ${JSON.stringify(criteria)}` + `Notebook select.kernel command switching to kernel id ${ + controller?.connection.kind + }${controller?.id}: Try ${tryCount} for ${JSON.stringify(criteria)}` ); // Send a select kernel on the active notebook editor. Keep sending it if it fails. await commands.executeCommand('notebook.selectKernel', { @@ -651,11 +652,9 @@ async function selectActiveInterpreterController(notebookEditor: NotebookEditor, controllerRegistration.getSelected(notebookEditor.notebook)?.viewType === notebookEditor.notebook.notebookType, timeout, - `Controller ${ - controller.id - } not selected for ${notebookEditor.notebook.uri.toString()}, currently selected ${controllerRegistration.getSelected( - notebookEditor.notebook - )?.id} (1)` + `Controller ${controller.id} not selected for ${notebookEditor.notebook.uri.toString()}, currently selected ${ + controllerRegistration.getSelected(notebookEditor.notebook)?.id + } (1)` ); } async function selectPythonRemoteKernelConnectionForActiveInterpreter( @@ -687,11 +686,9 @@ async function selectPythonRemoteKernelConnectionForActiveInterpreter( await waitForCondition( () => controllerRegistration.getSelected(notebookEditor.notebook)?.id === controller.id, timeout, - `Controller ${ - controller.id - } not selected for ${notebookEditor.notebook.uri.toString()}, currently selected ${controllerRegistration.getSelected( - notebookEditor.notebook - )?.id} (2)` + `Controller ${controller.id} not selected for ${notebookEditor.notebook.uri.toString()}, currently selected ${ + controllerRegistration.getSelected(notebookEditor.notebook)?.id + } (2)` ); } export async function waitForKernelToGetAutoSelected( diff --git a/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts b/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts index 2809bcc42..c68aca3df 100644 --- a/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts +++ b/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts @@ -85,9 +85,9 @@ suite('Non-Python Kernel @nonPython ', async function () { } }, defaultNotebookTestTimeout, - `Preferred controller not found for Notebook, currently preferred ${controllerPreferred.getPreferred( - notebook - )?.connection.kind}:${controllerPreferred.getPreferred(notebook)?.connection.id}`, + `Preferred controller not found for Notebook, currently preferred ${ + controllerPreferred.getPreferred(notebook)?.connection.kind + }:${controllerPreferred.getPreferred(notebook)?.connection.id}`, 500 ); }); @@ -104,9 +104,9 @@ suite('Non-Python Kernel @nonPython ', async function () { } }, defaultNotebookTestTimeout, - `Preferred controller not found for Notebook, currently preferred ${controllerPreferred.getPreferred( - notebook - )?.connection.kind}:${controllerPreferred.getPreferred(notebook)?.connection.id}`, + `Preferred controller not found for Notebook, currently preferred ${ + controllerPreferred.getPreferred(notebook)?.connection.kind + }:${controllerPreferred.getPreferred(notebook)?.connection.id}`, 500 ); const cell = await notebook.appendCodeCell('123456', 'typescript'); diff --git a/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts b/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts index 91bcf72a6..c0d08cdcf 100644 --- a/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts +++ b/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts @@ -118,7 +118,7 @@ myLib.throwEx()`); assert(range, 'should have found a range'); assert.equal(range.start.line, 0, 'wrong start line'); assert.equal(range.start.character, 0, 'wrong start character'); - assert.equal(range.end.line, 0), 'wrong end line'; + (assert.equal(range.end.line, 0), 'wrong end line'); assert.equal(range.end.character, 'print(1/0)'.length, 'wrong end character'); }); diff --git a/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts b/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts index 99ff4cfa1..8851a3360 100644 --- a/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts +++ b/src/webviews/extension-side/dataviewer/dataViewerCommandRegistry.ts @@ -160,9 +160,8 @@ export class DataViewerCommandRegistry implements IExtensionSyncActivationServic pythonEnv && (await this.dataViewerDependencyService.checkAndInstallMissingDependencies(pythonEnv)); } - const jupyterVariableDataProvider = await this.jupyterVariableDataProviderFactory.create( - requestVariable - ); + const jupyterVariableDataProvider = + await this.jupyterVariableDataProviderFactory.create(requestVariable); const dataFrameInfo = await jupyterVariableDataProvider.getDataFrameInfo(); const columnSize = dataFrameInfo?.columns?.length; if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) { diff --git a/src/webviews/webview-side/integrations/IntegrationItem.tsx b/src/webviews/webview-side/integrations/IntegrationItem.tsx index 02d9a31d3..09cfddba9 100644 --- a/src/webviews/webview-side/integrations/IntegrationItem.tsx +++ b/src/webviews/webview-side/integrations/IntegrationItem.tsx @@ -30,8 +30,8 @@ export const IntegrationItem: React.FC = ({ const statusText = isFileConfigured ? getLocString('integrationsConfiguredInFile', 'Configured in file') : integration.config - ? getLocString('integrationsConnected', 'Connected') - : getLocString('integrationsNotConfigured', 'Not Configured'); + ? getLocString('integrationsConnected', 'Connected') + : getLocString('integrationsNotConfigured', 'Not Configured'); const configureText = integration.config ? getLocString('integrationsReconfigure', 'Reconfigure') : getLocString('integrationsConfigure', 'Configure'); diff --git a/src/webviews/webview-side/ipywidgets/kernel/kernel.ts b/src/webviews/webview-side/ipywidgets/kernel/kernel.ts index bafb2ad82..740263049 100644 --- a/src/webviews/webview-side/ipywidgets/kernel/kernel.ts +++ b/src/webviews/webview-side/ipywidgets/kernel/kernel.ts @@ -225,9 +225,7 @@ class ProxyKernel implements IMessageHandler, Kernel.IKernelConnection { } public requestHistory( content: - | KernelMessage.IHistoryRequestRange - | KernelMessage.IHistoryRequestSearch - | KernelMessage.IHistoryRequestTail + KernelMessage.IHistoryRequestRange | KernelMessage.IHistoryRequestSearch | KernelMessage.IHistoryRequestTail ): Promise { return this.realKernel.requestHistory(content); } diff --git a/src/webviews/webview-side/ipywidgets/kernel/manager.ts b/src/webviews/webview-side/ipywidgets/kernel/manager.ts index 489a2aa36..ca79e4fb1 100644 --- a/src/webviews/webview-side/ipywidgets/kernel/manager.ts +++ b/src/webviews/webview-side/ipywidgets/kernel/manager.ts @@ -253,8 +253,7 @@ export class WidgetManager implements IIPyWidgetManager, IMessageHandler { const renderer = await context.getRenderer(rendererId); const isImage = mime.toLowerCase().startsWith('image/') && !mime.toLowerCase().includes('svg'); const renderOutputItem = renderer?.renderOutputItem as - | undefined - | ((outputItem: OutputItem, element: HTMLElement, signal: AbortSignal) => void); + undefined | ((outputItem: OutputItem, element: HTMLElement, signal: AbortSignal) => void); if (renderOutputItem) { renderOutputItem( { @@ -327,9 +326,7 @@ export class WidgetManager implements IIPyWidgetManager, IMessageHandler { return; } const displayMsg = payload as - | KernelMessage.IDisplayDataMsg - | KernelMessage.IUpdateDisplayDataMsg - | KernelMessage.IExecuteResultMsg; + KernelMessage.IDisplayDataMsg | KernelMessage.IUpdateDisplayDataMsg | KernelMessage.IExecuteResultMsg; if (displayMsg.content && displayMsg.content.data && displayMsg.content.data[WIDGET_MIMETYPE]) { // eslint-disable-next-line @typescript-eslint/no-explicit-any From c31b6820c9838d5d4cd5b3f2f51255ed1f486f82 Mon Sep 17 00:00:00 2001 From: tomas Date: Fri, 16 Oct 2026 20:21:22 +0000 Subject: [PATCH 3/3] fix(test): pass the end-line message to assert.equal in stack trace test The closing parenthesis sat before the message, so the line was a comma expression: the assertion ran without its message and the string was discarded. Prettier 3.9 exposed it by parenthesizing the sequence. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NMBxX24nF2qRaSRtmgH9mB --- src/test/datascience/notebook/stackTraceParsing.vscode.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts b/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts index c0d08cdcf..60cfea41f 100644 --- a/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts +++ b/src/test/datascience/notebook/stackTraceParsing.vscode.test.ts @@ -118,7 +118,7 @@ myLib.throwEx()`); assert(range, 'should have found a range'); assert.equal(range.start.line, 0, 'wrong start line'); assert.equal(range.start.character, 0, 'wrong start character'); - (assert.equal(range.end.line, 0), 'wrong end line'); + assert.equal(range.end.line, 0, 'wrong end line'); assert.equal(range.end.character, 'print(1/0)'.length, 'wrong end character'); });