mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
Activate vscode.github-authentication
from the test resolver
This commit is contained in:
parent
5b2f96e69d
commit
36b9d931d7
|
@ -9,6 +9,8 @@ export function activate(_context: vscode.ExtensionContext) {
|
||||||
vscode.workspace.registerRemoteAuthorityResolver('test', {
|
vscode.workspace.registerRemoteAuthorityResolver('test', {
|
||||||
async resolve(_authority: string): Promise<vscode.ResolverResult> {
|
async resolve(_authority: string): Promise<vscode.ResolverResult> {
|
||||||
console.log(`Resolving ${_authority}`);
|
console.log(`Resolving ${_authority}`);
|
||||||
|
console.log(`Activating vscode.github-authentication to simulate auth`);
|
||||||
|
await vscode.extensions.getExtension('vscode.github-authentication')?.activate();
|
||||||
return new vscode.ManagedResolvedAuthority(async () => {
|
return new vscode.ManagedResolvedAuthority(async () => {
|
||||||
return new InitialManagedMessagePassing();
|
return new InitialManagedMessagePassing();
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { IProductConfiguration } from 'vs/base/common/product';
|
||||||
import { isString } from 'vs/base/common/types';
|
import { isString } from 'vs/base/common/types';
|
||||||
import { CharCode } from 'vs/base/common/charCode';
|
import { CharCode } from 'vs/base/common/charCode';
|
||||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
|
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
||||||
|
|
||||||
const textMimeType = {
|
const textMimeType = {
|
||||||
'.html': 'text/html',
|
'.html': 'text/html',
|
||||||
|
@ -343,9 +344,12 @@ export class WebClientServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (useTestResolver) {
|
if (useTestResolver) {
|
||||||
const filePath = FileAccess.asFileUri(`${builtinExtensionsPath}/vscode-test-resolver/package.json`).fsPath;
|
const bundledExtensions: { extensionPath: string; packageJSON: IExtensionManifest }[] = [];
|
||||||
const packageJSON = JSON.parse((await fsp.readFile(filePath)).toString());
|
for (const extensionPath of ['vscode-test-resolver', 'github-authentication']) {
|
||||||
values['WORKBENCH_BUILTIN_EXTENSIONS'] = asJSON([{ extensionPath: 'vscode-test-resolver', packageJSON }]);
|
const packageJSON = JSON.parse((await fsp.readFile(FileAccess.asFileUri(`${builtinExtensionsPath}/${extensionPath}/package.json`).fsPath)).toString());
|
||||||
|
bundledExtensions.push({ extensionPath, packageJSON });
|
||||||
|
}
|
||||||
|
values['WORKBENCH_BUILTIN_EXTENSIONS'] = asJSON(bundledExtensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
let data;
|
let data;
|
||||||
|
|
Loading…
Reference in a new issue