File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1- import * as vscode from 'vscode'
2- import { onExtHostInitialized } from 'vscode/extensions'
1+ import { ExtensionHostKind , onExtHostInitialized , registerExtension } from 'vscode/extensions'
32
43await new Promise < void > ( resolve => onExtHostInitialized ( resolve ) )
54
5+ const { getApi } = registerExtension ( {
6+ name : 'outputDemo' ,
7+ publisher : 'codingame' ,
8+ version : '1.0.0' ,
9+ engines : {
10+ vscode : '*'
11+ }
12+ } , ExtensionHostKind . LocalProcess )
13+
14+ const vscode = await getApi ( )
615const fakeOutputChannel = vscode . window . createOutputChannel ( 'Fake output' )
716const anotherFakeOutputChannel = vscode . window . createOutputChannel ( 'Your code' , 'javascript' )
817
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ await vscode.window.showTextDocument(mainDocument, {
7878
7979anotherFakeOutputChannel . replace ( mainDocument . getText ( ) )
8080vscode . workspace . onDidChangeTextDocument ( ( e ) => {
81- if ( e . document === mainDocument ) {
81+ if ( e . document === mainDocument && e . contentChanges . length > 0 ) {
8282 anotherFakeOutputChannel . replace ( e . document . getText ( ) )
8383 }
8484} )
You can’t perform that action at this time.
0 commit comments