@@ -14,6 +14,9 @@ import {
1414
1515suiteSetup ( async ( ) => {
1616 await activateExtension ( ) ;
17+ await workspace . getConfiguration ( 'oxc' ) . update ( 'fmt.experimental' , true ) ;
18+ await workspace . getConfiguration ( 'editor' ) . update ( 'defaultFormatter' , 'oxc.oxc-vscode' ) ;
19+ await workspace . saveAll ( ) ;
1720} ) ;
1821
1922teardown ( async ( ) => {
@@ -32,6 +35,7 @@ suite('E2E Server Formatter', () => {
3235 test ( 'formats code with `oxc.fmt.experimental`' , async ( ) => {
3336 await workspace . getConfiguration ( 'oxc' ) . update ( 'fmt.experimental' , true ) ;
3437 await workspace . getConfiguration ( 'editor' ) . update ( 'defaultFormatter' , 'oxc.oxc-vscode' ) ;
38+ await workspace . saveAll ( ) ;
3539 await loadFixture ( 'formatting' ) ;
3640
3741 await sleep ( 500 ) ;
@@ -49,16 +53,16 @@ suite('E2E Server Formatter', () => {
4953
5054 test ( 'formats code with `oxc.fmt.configPath`' , async ( ) => {
5155 await loadFixture ( 'formatting_with_config' ) ;
52-
5356 await workspace . getConfiguration ( 'oxc' ) . update ( 'fmt.experimental' , true ) ;
54- await workspace . getConfiguration ( 'oxc' ) . update ( 'fmt.configPath' , './fixtures/formatter.json' ) ;
5557 await workspace . getConfiguration ( 'editor' ) . update ( 'defaultFormatter' , 'oxc.oxc-vscode' ) ;
58+ await workspace . getConfiguration ( 'oxc' ) . update ( 'fmt.configPath' , './fixtures/formatter.json' ) ;
59+ await workspace . saveAll ( ) ;
5660
57- await sleep ( 500 ) ; // wait for the server to pick up the new config
5861 const fileUri = Uri . joinPath ( fixturesWorkspaceUri ( ) , 'fixtures' , 'formatting.ts' ) ;
5962
6063 const document = await workspace . openTextDocument ( fileUri ) ;
6164 await window . showTextDocument ( document ) ;
65+ await sleep ( 500 ) ; // wait for the server to pick up the new config
6266 await commands . executeCommand ( 'editor.action.formatDocument' ) ;
6367 await workspace . saveAll ( ) ;
6468 const content = await workspace . fs . readFile ( fileUri ) ;
0 commit comments