Archived
1
0

fix: add handle for resolveExternalUri (#5624)

* fix: add handle for resolveExternalUri

This adds a fix to properly handle `resolveExternalUri` which is used by
extensions like Tabnine.

* fixup!: update patch

* fixup!: force update proxy patch

* fixup!: use proxyEndpointTemplate else manually add

* fixup!: throw error if productConfiguration missing

* feat(testing): add asExternalUri

This modifies the test extension used in e2e test by registering a new
command for testing `asExternalUri`.

* feat: add e2e test for asExternalUri

* docs: update playwright setup comments

* feat: add support for VSCODE_PROXY_URI

* chore: refresh patches

* feat: add test for VSCODE_PROXY_URI

* chore: add metadata to lang extension

* fixup!: fix part of service-worker patch

* fixup!: remove e2e test, update patch notes

* fixup!: refresh disable-downloads

* fixup!: formatting
This commit is contained in:
Joe Previte
2022-10-14 09:08:58 -07:00
committed by GitHub
parent 714afe0cc7
commit 690e0aff45
6 changed files with 89 additions and 16 deletions

View File

@ -28,5 +28,11 @@
]
}
]
},
"__metadata": {
"id": "47e020a1-33db-4cc0-a1b4-42f97781749a",
"publisherDisplayName": "MS-CEINTL",
"publisherId": "0b0882c3-aee3-4d7c-b5f9-872f9be0a115",
"isPreReleaseVersion": false
}
}

View File

@ -2,6 +2,7 @@ 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) {
@ -11,4 +12,20 @@ export function activate(context: vscode.ExtensionContext) {
}
}),
)
// 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.`)
}
}),
)
}

View File

@ -17,6 +17,11 @@
"command": "codeServerTest.proxyUri",
"title": "Get proxy URI",
"category": "code-server"
},
{
"command": "codeServerTest.asExternalUri",
"title": "asExternalUri test",
"category": "code-server"
}
]
},

View File

@ -8,6 +8,7 @@ import path from "path"
// yarn test:e2e --workers 1 # Run with one worker
// yarn test:e2e --project Chromium # Only run on Chromium
// yarn test:e2e --grep login # Run tests matching "login"
// PWDEBUG=1 yarn test:e2e # Run Playwright inspector
const config: PlaywrightTestConfig = {
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
timeout: 60000, // Each test is given 60 seconds.