-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
Copy pathextension.ts
31 lines (28 loc) · 1.05 KB
/
extension.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as vscode from "vscode"
export function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage("test extension loaded")
// Test extension
context.subscriptions.push(
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
if (process.env.VSCODE_PROXY_URI) {
vscode.window.showInformationMessage(`proxyUri: ${process.env.VSCODE_PROXY_URI}`)
} else {
vscode.window.showErrorMessage("No proxy URI was set")
}
}),
)
// asExternalUri extension
context.subscriptions.push(
vscode.commands.registerCommand("codeServerTest.asExternalUri", async () => {
const input = await vscode.window.showInputBox({
prompt: "URL to pass through to asExternalUri",
})
if (input) {
const output = await vscode.env.asExternalUri(vscode.Uri.parse(input))
vscode.window.showInformationMessage(`input: ${input} output: ${output}`)
} else {
vscode.window.showErrorMessage(`Failed to run test case. No input provided.`)
}
}),
)
}