diff --git a/apps/vscode/src/test/examples/hello.lua b/apps/vscode/src/test/examples/hello.lua new file mode 100644 index 00000000..ad35e5ae --- /dev/null +++ b/apps/vscode/src/test/examples/hello.lua @@ -0,0 +1 @@ +print("Hello World") diff --git a/apps/vscode/src/test/quartoDoc.test.ts b/apps/vscode/src/test/quartoDoc.test.ts index d4ca47aa..9e0c804d 100644 --- a/apps/vscode/src/test/quartoDoc.test.ts +++ b/apps/vscode/src/test/quartoDoc.test.ts @@ -41,6 +41,20 @@ suite("Quarto basics", function () { roundtripSnapshotTest('capsule-leak.qmd'); roundtripSnapshotTest('attr-equals.qmd'); + + // a test to prevent situations like https://github.com/quarto-dev/quarto/issues/845 + test("Can open a non-qmd file normally", async function () { + const { editor, doc } = await openAndShowTextDocument("hello.lua"); + + editor.edit((editBuilder) => { + editBuilder.insert(new vscode.Position(0, 0), 'print("hiyo")\n'); + }); + doc.save(); + + await wait(1700); // approximate time to open visual editor, just in case + + assert.equal(vscode.window.activeTextEditor, editor, 'quarto extension interferes with other files opened in VSCode!'); + }); }); /**