mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-29 00:00:29 -04:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -12,13 +12,16 @@ export interface ResolvedAuthority {
|
||||
readonly host: string;
|
||||
readonly port: number;
|
||||
readonly syncExtensions: boolean;
|
||||
readonly debugListenPort?: number;
|
||||
readonly debugConnectPort?: number;
|
||||
}
|
||||
|
||||
export interface IRemoteAuthorityResolverService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
resolveAuthority(authority: string): Thenable<ResolvedAuthority>;
|
||||
resolveAuthority(authority: string): Promise<ResolvedAuthority>;
|
||||
|
||||
setResolvedAuthority(resolvedAuthority: ResolvedAuthority): void;
|
||||
setResolvedAuthorityError(authority: string, err: any): void;
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ import { URI } from 'vs/base/common/uri';
|
||||
export const REMOTE_HOST_SCHEME = 'vscode-remote';
|
||||
|
||||
export function getRemoteAuthority(uri: URI) {
|
||||
return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : void 0;
|
||||
return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : undefined;
|
||||
}
|
||||
@@ -19,37 +19,37 @@ export class RemoteAuthorityResolverService implements IRemoteAuthorityResolverS
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
private _pendingResolveAuthorityRequests: { [authority: string]: PendingResolveAuthorityRequest; };
|
||||
private _resolvedAuthorities: { [authority: string]: ResolvedAuthority; };
|
||||
private _resolveAuthorityRequests: { [authority: string]: PendingResolveAuthorityRequest; };
|
||||
|
||||
constructor() {
|
||||
this._pendingResolveAuthorityRequests = Object.create(null);
|
||||
this._resolvedAuthorities = Object.create(null);
|
||||
this._resolveAuthorityRequests = Object.create(null);
|
||||
}
|
||||
|
||||
resolveAuthority(authority: string): Thenable<ResolvedAuthority> {
|
||||
if (this._resolvedAuthorities[authority]) {
|
||||
return Promise.resolve(this._resolvedAuthorities[authority]);
|
||||
}
|
||||
if (!this._pendingResolveAuthorityRequests[authority]) {
|
||||
resolveAuthority(authority: string): Promise<ResolvedAuthority> {
|
||||
if (!this._resolveAuthorityRequests[authority]) {
|
||||
let resolve: (value: ResolvedAuthority) => void;
|
||||
let reject: (err: any) => void;
|
||||
let promise = new Promise<ResolvedAuthority>((_resolve, _reject) => {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
this._pendingResolveAuthorityRequests[authority] = new PendingResolveAuthorityRequest(resolve!, reject!, promise);
|
||||
this._resolveAuthorityRequests[authority] = new PendingResolveAuthorityRequest(resolve!, reject!, promise);
|
||||
}
|
||||
return this._pendingResolveAuthorityRequests[authority].promise;
|
||||
return this._resolveAuthorityRequests[authority].promise;
|
||||
}
|
||||
|
||||
setResolvedAuthority(resolvedAuthority: ResolvedAuthority) {
|
||||
this._resolvedAuthorities[resolvedAuthority.authority] = resolvedAuthority;
|
||||
if (this._pendingResolveAuthorityRequests[resolvedAuthority.authority]) {
|
||||
let request = this._pendingResolveAuthorityRequests[resolvedAuthority.authority];
|
||||
delete this._pendingResolveAuthorityRequests[resolvedAuthority.authority];
|
||||
if (this._resolveAuthorityRequests[resolvedAuthority.authority]) {
|
||||
let request = this._resolveAuthorityRequests[resolvedAuthority.authority];
|
||||
ipc.send('vscode:remoteAuthorityResolved', resolvedAuthority);
|
||||
request.resolve(resolvedAuthority);
|
||||
}
|
||||
}
|
||||
|
||||
setResolvedAuthorityError(authority: string, err: any): void {
|
||||
if (this._resolveAuthorityRequests[authority]) {
|
||||
let request = this._resolveAuthorityRequests[authority];
|
||||
request.reject(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { Client, Protocol } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { Client, BufferedProtocol } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { IExtensionHostDebugParams } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export interface RemoteAgentConnectionContext {
|
||||
@@ -12,15 +11,19 @@ export interface RemoteAgentConnectionContext {
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
export function connectRemoteAgentManagement(remoteAuthority: string, host: string, port: number, clientId: string): TPromise<Client<RemoteAgentConnectionContext>> {
|
||||
export function connectRemoteAgentManagement(remoteAuthority: string, host: string, port: number, clientId: string, isBuilt: boolean): Promise<Client<RemoteAgentConnectionContext>> {
|
||||
throw new Error(`Not implemented`);
|
||||
}
|
||||
|
||||
export interface IExtensionHostConnectionResult {
|
||||
protocol: Protocol;
|
||||
protocol: BufferedProtocol;
|
||||
debugPort?: number;
|
||||
}
|
||||
|
||||
export function connectRemoteAgentExtensionHost(host: string, port: number, debugArguments: IExtensionHostDebugParams): TPromise<IExtensionHostConnectionResult> {
|
||||
export interface IRemoteExtensionHostDebugParams extends IExtensionHostDebugParams {
|
||||
updatePort?: boolean;
|
||||
}
|
||||
|
||||
export function connectRemoteAgentExtensionHost(host: string, port: number, debugArguments: IRemoteExtensionHostDebugParams, isBuilt: boolean): Promise<IExtensionHostConnectionResult> {
|
||||
throw new Error(`Not implemented`);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class RemoteExtensionsFileSystemProvider extends Disposable implements IF
|
||||
capabilities |= FileSystemProviderCapabilities.PathCaseSensitive;
|
||||
}
|
||||
this.capabilities = capabilities;
|
||||
this._onDidChangeCapabilities.fire(void 0);
|
||||
this._onDidChangeCapabilities.fire(undefined);
|
||||
}
|
||||
|
||||
watch(resource: URI, opts: IWatchOptions): IDisposable {
|
||||
@@ -75,36 +75,36 @@ export class RemoteExtensionsFileSystemProvider extends Disposable implements IF
|
||||
return Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
||||
}
|
||||
|
||||
stat(resource: URI): Thenable<IStat> {
|
||||
stat(resource: URI): Promise<IStat> {
|
||||
return this._channel.call('stat', [resource]);
|
||||
}
|
||||
|
||||
readFile(resource: URI): Thenable<Uint8Array> {
|
||||
readFile(resource: URI): Promise<Uint8Array> {
|
||||
return this._channel.call('readFile', [resource]);
|
||||
}
|
||||
|
||||
writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Thenable<void> {
|
||||
writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise<void> {
|
||||
const contents = RemoteExtensionsFileSystemProvider._asBuffer(content);
|
||||
return this._channel.call('writeFile', [resource, contents, opts]);
|
||||
}
|
||||
|
||||
delete(resource: URI, opts: FileDeleteOptions): Thenable<void> {
|
||||
delete(resource: URI, opts: FileDeleteOptions): Promise<void> {
|
||||
return this._channel.call('delete', [resource, opts]);
|
||||
}
|
||||
|
||||
mkdir(resource: URI): Thenable<void> {
|
||||
mkdir(resource: URI): Promise<void> {
|
||||
return this._channel.call('mkdir', [resource]);
|
||||
}
|
||||
|
||||
readdir(resource: URI): Thenable<[string, FileType][]> {
|
||||
readdir(resource: URI): Promise<[string, FileType][]> {
|
||||
return this._channel.call('readdir', [resource]);
|
||||
}
|
||||
|
||||
rename(resource: URI, target: URI, opts: FileOverwriteOptions): Thenable<void> {
|
||||
rename(resource: URI, target: URI, opts: FileOverwriteOptions): Promise<void> {
|
||||
return this._channel.call('rename', [resource, target, opts]);
|
||||
}
|
||||
|
||||
copy(resource: URI, target: URI, opts: FileOverwriteOptions): Thenable<void> {
|
||||
copy(resource: URI, target: URI, opts: FileOverwriteOptions): Promise<void> {
|
||||
return this._channel.call('copy', [resource, target, opts]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user