Skip to content

Commit

Permalink
Add test command for the extension (#7559)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Dec 16, 2024
1 parent 6cac351 commit c86101c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
"internalConsoleOptions": "neverOpen",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceFolder}/tools"
},
{
"name": "Run Bindings Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/cloudflare-workers-bindings-extension"
],
"outFiles": [
"${workspaceFolder}/packages/cloudflare-workers-bindings-extension/dist/**/*.js"
],
"preLaunchTask": "npm: vscode:prepublish - packages/cloudflare-workers-bindings-extension"
}
]
}
34 changes: 33 additions & 1 deletion packages/cloudflare-workers-bindings-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,39 @@
"build": "vsce package",
"deploy": "vsce publish --pre-release"
},
"activationEvents": [],
"contributes": {
"commands": [
{
"command": "cloudflare-workers-bindings-extension.testCommand",
"title": "Test command",
"icon": {
"light": "resources/light/edit.svg",
"dark": "resources/dark/edit.svg"
}
}
],
"views": {
"cloudflare-workers-bindings": [
{
"id": "cloudflare-workers-bindings-extension",
"name": "Bindings",
"icon": "resources/icons/cf-workers-logo.svg"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "cloudflare-workers-bindings",
"title": "Cloudflare Workers",
"icon": "media/cf-workers-logo.svg"
}
]
}
},
"activationEvents": [
"workspaceContains:{**/wrangler.json,**/wrangler.jsonc,**/wrangler.toml}"
],
"devDependencies": {
"@types/mocha": "^10.0.7",
"@types/node": "20.x",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as vscode from "vscode";

export async function activate(context: vscode.ExtensionContext) {
// ACTIVATED
vscode.commands.registerCommand(
"cloudflare-workers-bindings-extension.testCommand",
() =>
vscode.window.showInformationMessage(`Successfully called test command.`)
);
}

0 comments on commit c86101c

Please sign in to comment.