2022-01-05 05:02:25 +08:00
|
|
|
import * as vscode from "vscode"
|
|
|
|
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
2022-08-23 03:47:36 +08:00
|
|
|
vscode.window.showInformationMessage("test extension loaded")
|
2022-10-15 00:08:58 +08:00
|
|
|
// Test extension
|
2022-01-05 05:02:25 +08:00
|
|
|
context.subscriptions.push(
|
|
|
|
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
|
|
|
|
if (process.env.VSCODE_PROXY_URI) {
|
2022-08-23 03:47:36 +08:00
|
|
|
vscode.window.showInformationMessage(`proxyUri: ${process.env.VSCODE_PROXY_URI}`)
|
2022-01-05 05:02:25 +08:00
|
|
|
} else {
|
|
|
|
vscode.window.showErrorMessage("No proxy URI was set")
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
2022-10-15 00:08:58 +08:00
|
|
|
|
|
|
|
// 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.`)
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
)
|
2022-01-05 05:02:25 +08:00
|
|
|
}
|