@@ -86,7 +86,7 @@ export async function formatFixture(
8686 fixturesDir : string ,
8787 fixturePath : string ,
8888 languageId : string ,
89- initializationOptions ?: unknown ,
89+ initializationOptions ?: OxfmtLSPConfig ,
9090) : Promise < string > {
9191 const filePath = join ( fixturesDir , fixturePath ) ;
9292 const dirPath = dirname ( filePath ) ;
@@ -97,7 +97,12 @@ export async function formatFixture(
9797
9898 await client . initialize (
9999 [ { uri : pathToFileURL ( dirPath ) . href , name : "test" } ] ,
100- initializationOptions ,
100+ [
101+ {
102+ workspaceUri : pathToFileURL ( dirPath ) . href ,
103+ options : initializationOptions ,
104+ } ,
105+ ] ,
101106 ) ;
102107 await client . didOpen ( fileUri , languageId , content ) ;
103108
@@ -118,8 +123,8 @@ export async function formatFixtureAfterConfigChange(
118123 fixturesDir : string ,
119124 fixturePath : string ,
120125 languageId : string ,
121- initializationOptions : unknown ,
122- configurationChangeOptions : unknown ,
126+ initializationOptions : OxfmtLSPConfig ,
127+ configurationChangeOptions : OxfmtLSPConfig ,
123128) : Promise < string > {
124129 const filePath = join ( fixturesDir , fixturePath ) ;
125130 const dirPath = dirname ( filePath ) ;
@@ -165,6 +170,11 @@ ${formatted2}
165170
166171// ---
167172
173+ // aligned with https://github.com/oxc-project/oxc/blob/7e6c15baaebf206ab540191da0e4e103e4fabf06/apps/oxfmt/src/lsp/options.rs
174+ type OxfmtLSPConfig = {
175+ "fmt.configPath" ?: string | null ;
176+ } ;
177+
168178function applyEdits ( content : string , edits : TextEdit [ ] | null , languageId : string ) : string | null {
169179 if ( edits === null || edits . length === 0 ) return null ;
170180 const doc = TextDocument . create ( "file:///test" , languageId , 1 , content ) ;
0 commit comments