diff --git a/package.json b/package.json index d6cbb01..0f96473 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,11 @@ ], "main": "./out/src/extension", "preview": true, + "activationEvents": [ + "workspaceContains:**/smithy-build.json", + "workspaceContains:**/*.smithy", + "workspaceContains:**/.smithy-project.json" + ], "contributes": { "jsonValidation": [ { diff --git a/test-fixtures/suite6/smithy-build.json b/test-fixtures/suite6/smithy-build.json new file mode 100644 index 0000000..703ffb7 --- /dev/null +++ b/test-fixtures/suite6/smithy-build.json @@ -0,0 +1,3 @@ +{ + "version": "1.0" +} diff --git a/tests/runTest.ts b/tests/runTest.ts index 25c8cca..47fc425 100644 --- a/tests/runTest.ts +++ b/tests/runTest.ts @@ -48,6 +48,13 @@ async function go() { launchArgs: [resolve(__dirname, "../../test-fixtures/suite5")], }); + // Suite 6 - Startup + await runTests({ + extensionDevelopmentPath, + extensionTestsPath: resolve(__dirname, "./suite6"), + launchArgs: [resolve(__dirname, "../../test-fixtures/suite6")], + }); + // Confirm that webpacked and vsce packaged extension can be installed. const vscodeExecutablePath = await downloadAndUnzipVSCode(); const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); diff --git a/tests/suite6/extension.test.ts b/tests/suite6/extension.test.ts new file mode 100644 index 0000000..1c931c8 --- /dev/null +++ b/tests/suite6/extension.test.ts @@ -0,0 +1,13 @@ +import * as assert from "assert"; +import * as vscode from "vscode"; + +suite("Startup", function () { + this.timeout(0); + + test("Should start without opening a smithy file", async () => { + const extension = vscode.extensions.getExtension("smithy.smithy-vscode-extension"); + assert.ok(extension.isActive); + + return Promise.resolve(); + }); +}); diff --git a/tests/suite6/index.ts b/tests/suite6/index.ts new file mode 100644 index 0000000..7b4a869 --- /dev/null +++ b/tests/suite6/index.ts @@ -0,0 +1,5 @@ +import { runTests } from "../helper"; + +export function run(testsRoot: string, cb: (error: any, failures?: number) => void): void { + runTests(testsRoot, cb); +}