mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Merge from vscode 1a81711a85e38ccf784110568ebf3784ab9094a5 (#9161)
* Merge from vscode 1a81711a85e38ccf784110568ebf3784ab9094a5 * small spacing fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IWorkbenchConstructionOptions, create, URI, Event, Emitter, UriComponents, ICredentialsProvider, IURLCallbackProvider, IWorkspaceProvider, IWorkspace, IApplicationLinkProvider, IApplicationLink } from 'vs/workbench/workbench.web.api';
|
||||
import { IWorkbenchConstructionOptions, create, URI, Event, Emitter, UriComponents, ICredentialsProvider, IURLCallbackProvider, IWorkspaceProvider, IWorkspace, IApplicationLink } from 'vs/workbench/workbench.web.api';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||
@@ -279,39 +279,6 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
}
|
||||
}
|
||||
|
||||
class ApplicationLinkProvider {
|
||||
|
||||
private links: IApplicationLink[] | undefined = undefined;
|
||||
|
||||
constructor(workspace: IWorkspace) {
|
||||
this.computeLink(workspace);
|
||||
}
|
||||
|
||||
private computeLink(workspace: IWorkspace): void {
|
||||
if (!workspace) {
|
||||
return; // not for empty workspaces
|
||||
}
|
||||
|
||||
const workspaceUri = isWorkspaceToOpen(workspace) ? workspace.workspaceUri : isFolderToOpen(workspace) ? workspace.folderUri : undefined;
|
||||
if (workspaceUri) {
|
||||
this.links = [{
|
||||
uri: URI.from({
|
||||
scheme: product.quality === 'stable' ? 'vscode' : 'vscode-insiders',
|
||||
authority: Schemas.vscodeRemote,
|
||||
path: posix.join(posix.sep, workspaceUri.authority, workspaceUri.path),
|
||||
query: workspaceUri.query,
|
||||
fragment: workspaceUri.fragment,
|
||||
}),
|
||||
label: localize('openInDesktop', "Open in Desktop")
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
get provider(): IApplicationLinkProvider {
|
||||
return () => this.links;
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
|
||||
// Find config by checking for DOM
|
||||
@@ -375,12 +342,30 @@ class ApplicationLinkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// Application links ("Open in Desktop")
|
||||
let applicationLinks: IApplicationLink[] | undefined = undefined;
|
||||
if (workspace) {
|
||||
const workspaceUri = isWorkspaceToOpen(workspace) ? workspace.workspaceUri : isFolderToOpen(workspace) ? workspace.folderUri : undefined;
|
||||
if (workspaceUri) {
|
||||
applicationLinks = [{
|
||||
uri: URI.from({
|
||||
scheme: product.quality === 'stable' ? 'vscode' : 'vscode-insiders',
|
||||
authority: Schemas.vscodeRemote,
|
||||
path: posix.join(posix.sep, workspaceUri.authority, workspaceUri.path),
|
||||
query: workspaceUri.query,
|
||||
fragment: workspaceUri.fragment,
|
||||
}),
|
||||
label: localize('openInDesktop', "Open in Desktop")
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
// Finally create workbench
|
||||
create(document.body, {
|
||||
...config,
|
||||
workspaceProvider: new WorkspaceProvider(workspace, payload),
|
||||
urlCallbackProvider: new PollingURLCallbackProvider(),
|
||||
credentialsProvider: new LocalStorageCredentialsProvider(),
|
||||
applicationLinkProvider: new ApplicationLinkProvider(workspace).provider
|
||||
applicationLinks: applicationLinks
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user