File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/customEditor/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" : {
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 }
Original file line number Diff line number Diff 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- }
Original file line number Diff line number Diff 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
274254function escapeAttribute ( value : string | vscode . Uri ) : string {
Original file line number Diff line number Diff line change @@ -122,5 +122,3 @@ export class CustomEditorModel extends Disposable implements ICustomEditorModel
122122 this . updateDirty ( ) ;
123123 }
124124}
125-
126-
You can’t perform that action at this time.
0 commit comments