mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)
* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 * Fix breaks * Extension management fixes * Fix breaks in windows bundling * Fix/skip failing tests * Update distro * Add clear to nuget.config * Add hygiene task * Bump distro * Fix hygiene issue * Add build to hygiene exclusion * Update distro * Update hygiene * Hygiene exclusions * Update tsconfig * Bump distro for server breaks * Update build config * Update darwin path * Add done calls to notebook tests * Skip failing tests * Disable smoke tests
This commit is contained in:
@@ -18,6 +18,8 @@ export interface IOpenURLOptions {
|
||||
* might be shown to the user.
|
||||
*/
|
||||
trusted?: boolean;
|
||||
|
||||
originalUrl?: string;
|
||||
}
|
||||
|
||||
export interface IURLHandler {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class URLHandlerChannel implements IServerChannel {
|
||||
|
||||
call(_: unknown, command: string, arg?: any): Promise<any> {
|
||||
switch (command) {
|
||||
case 'handleURL': return this.handler.handleURL(URI.revive(arg));
|
||||
case 'handleURL': return this.handler.handleURL(URI.revive(arg[0]), arg[1]);
|
||||
}
|
||||
|
||||
throw new Error(`Call not found: ${command}`);
|
||||
@@ -31,7 +31,7 @@ export class URLHandlerChannelClient implements IURLHandler {
|
||||
constructor(private channel: IChannel) { }
|
||||
|
||||
handleURL(uri: URI, options?: IOpenURLOptions): Promise<boolean> {
|
||||
return this.channel.call('handleURL', uri.toJSON());
|
||||
return this.channel.call('handleURL', [uri.toJSON(), options]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { app, Event as ElectronEvent } from 'electron';
|
||||
@@ -34,16 +34,16 @@ function uriFromRawUrl(url: string): URI | null {
|
||||
*/
|
||||
export class ElectronURLListener {
|
||||
|
||||
private uris: URI[] = [];
|
||||
private uris: { uri: URI, url: string }[] = [];
|
||||
private retryCount = 0;
|
||||
private flushDisposable: IDisposable = Disposable.None;
|
||||
private disposables = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
initialUrisToHandle: URI[],
|
||||
initialUrisToHandle: { uri: URI, url: string }[],
|
||||
private readonly urlService: IURLService,
|
||||
windowsMainService: IWindowsMainService,
|
||||
environmentService: INativeEnvironmentService
|
||||
environmentService: IEnvironmentMainService
|
||||
) {
|
||||
|
||||
// the initial set of URIs we need to handle once the window is ready
|
||||
@@ -64,8 +64,15 @@ export class ElectronURLListener {
|
||||
return url;
|
||||
});
|
||||
|
||||
const onOpenUrl = Event.filter<URI | null, URI>(Event.map(onOpenElectronUrl, uriFromRawUrl), (uri): uri is URI => !!uri);
|
||||
onOpenUrl(this.urlService.open, this.urlService, this.disposables);
|
||||
this.disposables.add(onOpenElectronUrl(url => {
|
||||
const uri = uriFromRawUrl(url);
|
||||
|
||||
if (!uri) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.urlService.open(uri, { originalUrl: url });
|
||||
}));
|
||||
|
||||
// Send initial links to the window once it has loaded
|
||||
const isWindowReady = windowsMainService.getWindows()
|
||||
@@ -84,13 +91,13 @@ export class ElectronURLListener {
|
||||
return;
|
||||
}
|
||||
|
||||
const uris: URI[] = [];
|
||||
const uris: { uri: URI, url: string }[] = [];
|
||||
|
||||
for (const uri of this.uris) {
|
||||
const handled = await this.urlService.open(uri);
|
||||
for (const obj of this.uris) {
|
||||
const handled = await this.urlService.open(obj.uri, { originalUrl: obj.url });
|
||||
|
||||
if (!handled) {
|
||||
uris.push(uri);
|
||||
uris.push(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user