From 9ffb72261e8173538632679607731f994c396687 Mon Sep 17 00:00:00 2001 From: TylerLeonhardt Date: Thu, 27 Aug 2020 22:02:15 +0000 Subject: [PATCH 1/4] [Ignore] Update Notebook dts --- vscode.proposed.d.ts | 52 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/vscode.proposed.d.ts b/vscode.proposed.d.ts index 900a7a44e5..11eeae9f06 100644 --- a/vscode.proposed.d.ts +++ b/vscode.proposed.d.ts @@ -96,7 +96,7 @@ declare module 'vscode' { export interface NotebookCellMetadata { /** - * Controls if the content of a cell is editable or not. + * Controls whether a cell's editor is editable/readonly. */ editable?: boolean; @@ -245,10 +245,16 @@ declare module 'vscode' { contains(uri: Uri): boolean } + export interface WorkspaceEdit { + replaceCells(uri: Uri, start: number, end: number, cells: NotebookCellData[], metadata?: WorkspaceEditEntryMetadata): void; + replaceCellOutput(uri: Uri, index: number, outputs: CellOutput[], metadata?: WorkspaceEditEntryMetadata): void; + replaceCellMetadata(uri: Uri, index: number, cellMetadata: NotebookCellMetadata, metadata?: WorkspaceEditEntryMetadata): void; + } + export interface NotebookEditorCellEdit { - replaceCells(from: number, to: number, cells: NotebookCellData[]): void; - replaceOutputs(index: number, outputs: CellOutput[]): void; + replaceCells(start: number, end: number, cells: NotebookCellData[]): void; + replaceOutput(index: number, outputs: CellOutput[]): void; replaceMetadata(index: number, metadata: NotebookCellMetadata): void; /** @deprecated */ @@ -523,6 +529,35 @@ declare module 'vscode' { resolveKernel?(kernel: T, document: NotebookDocument, webview: NotebookCommunication, token: CancellationToken): ProviderResult; } + /** + * Represents the alignment of status bar items. + */ + export enum NotebookCellStatusBarAlignment { + + /** + * Aligned to the left side. + */ + Left = 1, + + /** + * Aligned to the right side. + */ + Right = 2 + } + + export interface NotebookCellStatusBarItem { + readonly cell: NotebookCell; + readonly alignment: NotebookCellStatusBarAlignment; + readonly priority?: number; + text: string; + tooltip: string | undefined; + command: string | Command | undefined; + accessibilityInformation?: AccessibilityInformation; + show(): void; + hide(): void; + dispose(): void; + } + export namespace notebook { export function registerNotebookContentProvider( notebookType: string, @@ -580,6 +615,17 @@ declare module 'vscode' { export function createConcatTextDocument(notebook: NotebookDocument, selector?: DocumentSelector): NotebookConcatTextDocument; export const onDidChangeActiveNotebookKernel: Event<{ document: NotebookDocument, kernel: NotebookKernel | undefined }>; + + /** + * Creates a notebook cell status bar [item](#NotebookCellStatusBarItem). + * It will be disposed automatically when the notebook document is closed or the cell is deleted. + * + * @param cell The cell on which this item should be shown. + * @param alignment The alignment of the item. + * @param priority The priority of the item. Higher values mean the item should be shown more to the left. + * @return A new status bar item. + */ + export function createCellStatusBarItem(cell: NotebookCell, alignment?: NotebookCellStatusBarAlignment, priority?: number): NotebookCellStatusBarItem; } //#endregion From 859eed30d4c0c90657612150f9d4b0b0104d57bb Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 27 Aug 2020 16:57:38 -0700 Subject: [PATCH 2/4] up engine in hopes that missing type is in 1.45 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7fde3ef3b4..f1b63a8d58 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.44.0" + "vscode": "^1.45.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -65,7 +65,7 @@ "@types/semver": "~7.3.1", "@types/sinon": "~9.0.4", "@types/uuid": "^8.0.1", - "@types/vscode": "1.44.0", + "@types/vscode": "1.45.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~2.0.0", "mocha-multi-reporters": "~1.1.7", From 0c5258cd7432f902ffb41585848ee7865ad21ea7 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 27 Aug 2020 17:14:45 -0700 Subject: [PATCH 3/4] try creating another dts --- vscode.notebooks.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vscode.notebooks.d.ts diff --git a/vscode.notebooks.d.ts b/vscode.notebooks.d.ts new file mode 100644 index 0000000000..c1e10affe0 --- /dev/null +++ b/vscode.notebooks.d.ts @@ -0,0 +1,27 @@ +/* +This file contains types introduced in a newer version of vscode than 1.45 that are used by the Notebook Mode feature. + +We are locked on to 1.45 because that is what SAWs support. + +Once SAWs support a newer version of vscode we can remove this. My hope is that this will be the only addition to this file. +*/ + +declare module 'vscode' { + /** + * Accessibility information which controls screen reader behavior. + */ + export interface AccessibilityInformation { + /** + * Label to be read out by a screen reader once the item has focus. + */ + label: string; + + /** + * Role of the widget which defines how a screen reader interacts with it. + * The role should be set in special cases when for example a tree-like element behaves like a checkbox. + * If role is not specified VS Code will pick the appropriate role automatically. + * More about aria roles can be found here https://w3c.github.io/aria/#widget_roles + */ + role?: string; + } +} From 5eb3553fc84dc1dfbcd0443263b5f5de144910af Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 27 Aug 2020 17:22:31 -0700 Subject: [PATCH 4/4] move back to 44 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f1b63a8d58..7fde3ef3b4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.45.0" + "vscode": "^1.44.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -65,7 +65,7 @@ "@types/semver": "~7.3.1", "@types/sinon": "~9.0.4", "@types/uuid": "^8.0.1", - "@types/vscode": "1.45.0", + "@types/vscode": "1.44.0", "mocha": "~5.2.0", "mocha-junit-reporter": "~2.0.0", "mocha-multi-reporters": "~1.1.7",