Skip to content

Commit f085deb

Browse files
committed
Remove test editing code from preview
1 parent 74865b3 commit f085deb

4 files changed

Lines changed: 2 additions & 49 deletions

File tree

extensions/image-preview/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
"command": "imagePreview.zoomOut",
4545
"title": "%command.zoomOut%",
4646
"category": "Image Preview"
47-
},
48-
{
49-
"command": "imagePreview.testing.makeEdit",
50-
"title": "Make test edit",
51-
"category": "Image Preview"
5247
}
5348
],
5449
"menus": {
@@ -62,11 +57,6 @@
6257
"command": "imagePreview.zoomOut",
6358
"when": "imagePreviewFocus",
6459
"group": "1_imagePreview"
65-
},
66-
{
67-
"command": "imagePreview.testing.makeEdit",
68-
"when": "imagePreviewTestMode",
69-
"group": "1_imagePreview"
7060
}
7161
]
7262
}

extensions/image-preview/src/extension.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,5 @@ export function activate(context: vscode.ExtensionContext) {
3838
context.subscriptions.push(vscode.commands.registerCommand('imagePreview.zoomOut', () => {
3939
previewManager.activePreview?.zoomOut();
4040
}));
41-
42-
context.subscriptions.push(vscode.commands.registerCommand('imagePreview.testing.makeEdit', () => {
43-
previewManager.activePreview?.test_makeEdit();
44-
}));
45-
46-
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => {
47-
if (e.affectsConfiguration('imagePreview.customEditorTestMode')) {
48-
updateTestMode();
49-
}
50-
}));
51-
updateTestMode();
5241
}
5342

54-
function updateTestMode() {
55-
const isInTestMode = vscode.workspace.getConfiguration('imagePreview').get<boolean>('customEditorTestMode', false);
56-
vscode.commands.executeCommand('setContext', 'imagePreviewTestMode', isInTestMode);
57-
}

extensions/image-preview/src/preview.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ export class PreviewManager {
4545
}
4646
});
4747

48-
return {
49-
editingCapability: preview
50-
};
48+
return {};
5149
}
5250

5351
public get activePreview() { return this._activePreview; }
@@ -68,7 +66,7 @@ const enum PreviewState {
6866
Active,
6967
}
7068

71-
class Preview extends Disposable implements vscode.WebviewEditorEditingCapability {
69+
class Preview extends Disposable {
7270

7371
private readonly id: string = `${Date.now()}-${Math.random().toString()}`;
7472

@@ -251,24 +249,6 @@ class Preview extends Disposable implements vscode.WebviewEditorEditingCapabilit
251249
path: this.extensionRoot.path + path
252250
}));
253251
}
254-
255-
//#region WebviewEditorCapabilities
256-
private readonly _onEdit = this._register(new vscode.EventEmitter<{ now: number }>());
257-
public readonly onEdit = this._onEdit.event;
258-
259-
async save() { console.log('save'); }
260-
261-
async hotExit() { }
262-
263-
async undoEdits(edits: any[]) { console.log('undo', edits); }
264-
265-
async applyEdits(edits: any[]) { console.log('apply', edits); }
266-
267-
//#endregion
268-
269-
public test_makeEdit() {
270-
this._onEdit.fire({ now: Date.now() });
271-
}
272252
}
273253

274254
function escapeAttribute(value: string | vscode.Uri): string {

src/vs/workbench/contrib/customEditor/common/customEditorModel.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,3 @@ export class CustomEditorModel extends Disposable implements ICustomEditorModel
122122
this.updateDirty();
123123
}
124124
}
125-
126-

0 commit comments

Comments
 (0)