@@ -22,13 +22,13 @@ suite("Quarto basics", function () {
2222  // Note: this test runs after the previous test, so `hello.qmd` can already be touched by the previous 
2323  //       test. That's okay for this test, but could cause issues if you expect a qmd to look how it 
2424  //       does in `/examples`. 
25-   test ( "Roundtrip doesn't change hello.qmd" ,  async  function  ( )  { 
26-     const  {  doc }  =  await  openAndShowTextDocument ( "hello.qmd" ) ; 
25+   //  test("Roundtrip doesn't change hello.qmd", async function () {
26+   //    const { doc } = await openAndShowTextDocument("hello.qmd");
2727
28-     const  {  before,  after }  =  await  roundtrip ( doc ) ; 
28+   //    const { before, after } = await roundtrip(doc);
2929
30-     assert . equal ( before ,  after ) ; 
31-   } ) ; 
30+   //    assert.equal(before, after);
31+   //  });
3232
3333  // roundtripSnapshotTest('valid-basics.qmd'); 
3434
@@ -43,8 +43,25 @@ suite("Quarto basics", function () {
4343  test ( "cell formamtmtamt" ,  async  function  ( )  { 
4444    const  {  doc }  =  await  openAndShowTextDocument ( "cell-format.qmd" ) ; 
4545
46-     //await vscode.commands.executeCommand("quarto.formatCell"); 
46+     vscode . languages . registerDocumentFormattingEditProvider ( 
47+       {  scheme : 'file' ,  language : 'r'  } , 
48+       { 
49+         provideDocumentFormattingEdits ( document : vscode . TextDocument ) :
50+           vscode . ProviderResult < vscode . TextEdit [ ] >  { 
51+           const  sourceText  =  document . getText ( ) ; 
52+ 
53+           const  fileStart  =  new  vscode . Position ( 0 ,  0 ) ; 
54+           const  fileEnd  =  document . lineAt ( document . lineCount  -  1 ) . range . end ; 
55+ 
56+           const  formattedSourceText  =  sourceText  +  'hello!' 
57+ 
58+           return  [ new  vscode . TextEdit ( new  vscode . Range ( fileStart ,  fileEnd ) ,  formattedSourceText ) ] ; 
59+         } 
60+       } 
61+     ) 
62+ 
4763    setCursorPosition ( 3 ,  1 ) ; 
64+     await  wait ( 300 ) ; 
4865    await  vscode . commands . executeCommand ( "quarto.formatCell" ) ; 
4966    await  wait ( 6300 ) ; 
5067    // const { before, after } = await roundtrip(doc); 
0 commit comments