Skip to content

Commit a78ba34

Browse files
committed
Add test command for the extension (#7559)
1 parent 771db17 commit a78ba34

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
"internalConsoleOptions": "neverOpen",
1212
"skipFiles": ["<node_internals>/**"],
1313
"cwd": "${workspaceFolder}/tools"
14+
},
15+
{
16+
"name": "Run Bindings Extension",
17+
"type": "extensionHost",
18+
"request": "launch",
19+
"args": [
20+
"--extensionDevelopmentPath=${workspaceFolder}/packages/cloudflare-workers-bindings-extension"
21+
],
22+
"outFiles": [
23+
"${workspaceFolder}/packages/cloudflare-workers-bindings-extension/dist/**/*.js"
24+
],
25+
"preLaunchTask": "npm: vscode:prepublish - packages/cloudflare-workers-bindings-extension"
1426
}
1527
]
1628
}

packages/cloudflare-workers-bindings-extension/package.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,39 @@
2424
"build": "vsce package",
2525
"deploy": "vsce publish --pre-release"
2626
},
27-
"activationEvents": [],
27+
"contributes": {
28+
"commands": [
29+
{
30+
"command": "cloudflare-workers-bindings-extension.testCommand",
31+
"title": "Test command",
32+
"icon": {
33+
"light": "resources/light/edit.svg",
34+
"dark": "resources/dark/edit.svg"
35+
}
36+
}
37+
],
38+
"views": {
39+
"cloudflare-workers-bindings": [
40+
{
41+
"id": "cloudflare-workers-bindings-extension",
42+
"name": "Bindings",
43+
"icon": "resources/icons/cf-workers-logo.svg"
44+
}
45+
]
46+
},
47+
"viewsContainers": {
48+
"activitybar": [
49+
{
50+
"id": "cloudflare-workers-bindings",
51+
"title": "Cloudflare Workers",
52+
"icon": "media/cf-workers-logo.svg"
53+
}
54+
]
55+
}
56+
},
57+
"activationEvents": [
58+
"workspaceContains:{**/wrangler.json,**/wrangler.jsonc,**/wrangler.toml}"
59+
],
2860
"devDependencies": {
2961
"@types/mocha": "^10.0.7",
3062
"@types/node": "20.x",
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import * as vscode from "vscode";
22

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

0 commit comments

Comments
 (0)