mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode c873727e8bac95e7cbf5b154a9e6ae0986f2ce18 (#6446)
This commit is contained in:
@@ -237,6 +237,13 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe
|
||||
}
|
||||
return getFilePath();
|
||||
|
||||
case 'relativeFileDirname':
|
||||
let dirname = paths.dirname(getFilePath());
|
||||
if (folderUri) {
|
||||
return paths.normalize(paths.relative(getFolderUri().fsPath, dirname));
|
||||
}
|
||||
return dirname;
|
||||
|
||||
case 'fileDirname':
|
||||
return paths.dirname(getFilePath());
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ export class FileDialogService implements IFileDialogService {
|
||||
const schema = this.getFileSystemSchema(options);
|
||||
if (this.shouldUseSimplified(schema)) {
|
||||
if (!options.availableFileSystems) {
|
||||
options.availableFileSystems = [schema]; // by default only allow saving in the own file system
|
||||
options.availableFileSystems = this.ensureFileSchema(schema); // always allow file as well
|
||||
}
|
||||
|
||||
return this.saveRemoteResource(options);
|
||||
@@ -239,7 +239,7 @@ export class FileDialogService implements IFileDialogService {
|
||||
const schema = this.getFileSystemSchema(options);
|
||||
if (this.shouldUseSimplified(schema)) {
|
||||
if (!options.availableFileSystems) {
|
||||
options.availableFileSystems = [schema]; // by default only allow loading in the own file system
|
||||
options.availableFileSystems = this.ensureFileSchema(schema); // always allow file as well
|
||||
}
|
||||
|
||||
const uri = await this.pickRemoteResource(options);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ExtHostCustomersRegistry } from 'vs/workbench/api/common/extHostCustome
|
||||
import { ExtHostContext, ExtHostExtensionServiceShape, IExtHostContext, MainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import { IRPCProtocolLogger, RPCProtocol, RequestInitiator, ResponsiveState } from 'vs/workbench/services/extensions/common/rpcProtocol';
|
||||
import { ResolvedAuthority, RemoteAuthorityResolverError } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { RemoteAuthorityResolverError, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
@@ -249,15 +249,17 @@ export class ExtensionHostProcessManager extends Disposable {
|
||||
return this._extensionHostProcessWorker && Boolean(this._extensionHostProcessWorker.getInspectPort());
|
||||
}
|
||||
|
||||
public async resolveAuthority(remoteAuthority: string): Promise<ResolvedAuthority> {
|
||||
public async resolveAuthority(remoteAuthority: string): Promise<ResolverResult> {
|
||||
const authorityPlusIndex = remoteAuthority.indexOf('+');
|
||||
if (authorityPlusIndex === -1) {
|
||||
// This authority does not need to be resolved, simply parse the port number
|
||||
const pieces = remoteAuthority.split(':');
|
||||
return Promise.resolve({
|
||||
authority: remoteAuthority,
|
||||
host: pieces[0],
|
||||
port: parseInt(pieces[1], 10)
|
||||
authority: {
|
||||
authority: remoteAuthority,
|
||||
host: pieces[0],
|
||||
port: parseInt(pieces[1], 10)
|
||||
}
|
||||
});
|
||||
}
|
||||
const proxy = await this._getExtensionHostProcessProxy();
|
||||
|
||||
@@ -76,19 +76,20 @@ export class RemoteExtensionHostClient extends Disposable implements IExtensionH
|
||||
webSocketFactory: this._webSocketFactory,
|
||||
addressProvider: {
|
||||
getAddress: async () => {
|
||||
const { host, port } = await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);
|
||||
return { host, port };
|
||||
const { authority } = await this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority);
|
||||
return { host: authority.host, port: authority.port };
|
||||
}
|
||||
},
|
||||
signService: this._signService
|
||||
};
|
||||
return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then((resolvedAuthority) => {
|
||||
return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then((resolverResult) => {
|
||||
|
||||
const startParams: IRemoteExtensionHostStartParams = {
|
||||
language: platform.language,
|
||||
debugId: this._environmentService.debugExtensionHost.debugId,
|
||||
break: this._environmentService.debugExtensionHost.break,
|
||||
port: this._environmentService.debugExtensionHost.port,
|
||||
env: resolverResult.options && resolverResult.options.extensionHostEnv
|
||||
};
|
||||
|
||||
const extDevLocs = this._environmentService.extensionDevelopmentLocationURI;
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IExtensionEnablementService } from 'vs/workbench/services/extensionMana
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IInitDataProvider, RemoteExtensionHostClient } from 'vs/workbench/services/extensions/common/remoteExtensionHostClient';
|
||||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
import { IRemoteAuthorityResolverService, ResolvedAuthority, RemoteAuthorityResolverError } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { IRemoteAuthorityResolverService, RemoteAuthorityResolverError, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil';
|
||||
import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -424,8 +424,8 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
const extensionHost = this._extensionHostProcessManagers[0];
|
||||
this._remoteAuthorityResolverService.clearResolvedAuthority(remoteAuthority);
|
||||
try {
|
||||
const resolvedAuthority = await extensionHost.resolveAuthority(remoteAuthority);
|
||||
this._remoteAuthorityResolverService.setResolvedAuthority(resolvedAuthority);
|
||||
const result = await extensionHost.resolveAuthority(remoteAuthority);
|
||||
this._remoteAuthorityResolverService.setResolvedAuthority(result.authority, result.options);
|
||||
} catch (err) {
|
||||
this._remoteAuthorityResolverService.setResolvedAuthorityError(remoteAuthority, err);
|
||||
}
|
||||
@@ -446,7 +446,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
localExtensions = localExtensions.filter(extension => this._isEnabled(extension));
|
||||
|
||||
if (remoteAuthority) {
|
||||
let resolvedAuthority: ResolvedAuthority;
|
||||
let resolvedAuthority: ResolverResult;
|
||||
|
||||
try {
|
||||
resolvedAuthority = await extensionHost.resolveAuthority(remoteAuthority);
|
||||
@@ -468,7 +468,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
||||
}
|
||||
|
||||
// set the resolved authority
|
||||
this._remoteAuthorityResolverService.setResolvedAuthority(resolvedAuthority);
|
||||
this._remoteAuthorityResolverService.setResolvedAuthority(resolvedAuthority.authority, resolvedAuthority.options);
|
||||
|
||||
// monitor for breakage
|
||||
const connection = this._remoteAgentService.getConnection();
|
||||
|
||||
@@ -12,33 +12,39 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
|
||||
class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
|
||||
constructor(notificationService: INotificationService, storageService: IStorageService, commandService: ICommandService) {
|
||||
super(notificationService, storageService, commandService);
|
||||
|
||||
let keymapInfos: IKeymapInfo[] = KeyboardLayoutContribution.INSTANCE.layoutInfos;
|
||||
const keymapInfos: IKeymapInfo[] = KeyboardLayoutContribution.INSTANCE.layoutInfos;
|
||||
this._keymapInfos.push(...keymapInfos.map(info => (new KeymapInfo(info.layout, info.secondaryLayouts, info.mapping, info.isUserKeyboardLayout))));
|
||||
this._mru = this._keymapInfos;
|
||||
this._initialized = true;
|
||||
this.onKeyboardLayoutChanged();
|
||||
const usLayout = this.getUSStandardLayout();
|
||||
if (usLayout) {
|
||||
this.setActiveKeyMapping(usLayout.mapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
suite('keyboard layout loader', () => {
|
||||
let instantiationService: TestInstantiationService = new TestInstantiationService();
|
||||
let notitifcationService = instantiationService.stub(INotificationService, {});
|
||||
let storageService = instantiationService.stub(IStorageService, {});
|
||||
let notitifcationService = instantiationService.stub(INotificationService, new TestNotificationService());
|
||||
let storageService = instantiationService.stub(IStorageService, new TestStorageService());
|
||||
|
||||
let commandService = instantiationService.stub(ICommandService, {});
|
||||
let instance = new TestKeyboardMapperFactory(notitifcationService, storageService, commandService);
|
||||
|
||||
test.skip('load default US keyboard layout', () => {
|
||||
test('load default US keyboard layout', () => {
|
||||
assert.notEqual(instance.activeKeyboardLayout, null);
|
||||
assert.equal(instance.activeKeyboardLayout!.isUSStandard, true);
|
||||
});
|
||||
|
||||
test.skip('isKeyMappingActive', () => {
|
||||
test('isKeyMappingActive', () => {
|
||||
assert.equal(instance.isKeyMappingActive({
|
||||
KeyA: {
|
||||
value: 'a',
|
||||
|
||||
@@ -121,8 +121,8 @@ export class RemoteAgentConnection extends Disposable implements IRemoteAgentCon
|
||||
} else {
|
||||
this._onReconnecting.fire(undefined);
|
||||
}
|
||||
const { host, port } = await this._remoteAuthorityResolverService.resolveAuthority(this.remoteAuthority);
|
||||
return { host, port };
|
||||
const { authority } = await this._remoteAuthorityResolverService.resolveAuthority(this.remoteAuthority);
|
||||
return { host: authority.host, port: authority.port };
|
||||
}
|
||||
},
|
||||
signService: this._signService
|
||||
|
||||
@@ -105,8 +105,8 @@ export class TunnelService implements ITunnelService {
|
||||
webSocketFactory: nodeWebSocketFactory,
|
||||
addressProvider: {
|
||||
getAddress: async () => {
|
||||
const { host, port } = await this.remoteAuthorityResolverService.resolveAuthority(remoteAuthority);
|
||||
return { host, port };
|
||||
const { authority } = await this.remoteAuthorityResolverService.resolveAuthority(remoteAuthority);
|
||||
return { host: authority.host, port: authority.port };
|
||||
}
|
||||
},
|
||||
signService: this.signService
|
||||
|
||||
Reference in New Issue
Block a user