mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 08:40:29 -04:00
Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)
This commit is contained in:
@@ -50,7 +50,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
|
||||
import { getDefaultValue } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { isUndefined } from 'vs/base/common/types';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
import { IWebviewService, Webview, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { renderDashboardContributions } from 'sql/workbench/parts/extensions/browser/contributionRenders'; // {{SQL CARBON EDIT}}
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
@@ -536,6 +536,12 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
}
|
||||
|
||||
runFindAction(previous: boolean): void {
|
||||
if (this.activeElement && (<Webview>this.activeElement).runFindAction) {
|
||||
(<Webview>this.activeElement).runFindAction(previous);
|
||||
}
|
||||
}
|
||||
|
||||
private onNavbarChange(extension: IExtension, { id, focus }: { id: string | null, focus: boolean }, template: IExtensionEditorTemplate): void {
|
||||
if (this.editorLoadComplete) {
|
||||
/* __GDPR__
|
||||
@@ -1326,28 +1332,66 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
}
|
||||
|
||||
const contextKeyExpr = ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', ExtensionEditor.ID), ContextKeyExpr.not('editorFocus'));
|
||||
class ShowExtensionEditorFindCommand extends Command {
|
||||
public runCommand(accessor: ServicesAccessor, args: any): void {
|
||||
const extensionEditor = this.getExtensionEditor(accessor);
|
||||
const extensionEditor = getExtensionEditor(accessor);
|
||||
if (extensionEditor) {
|
||||
extensionEditor.showFind();
|
||||
}
|
||||
}
|
||||
|
||||
private getExtensionEditor(accessor: ServicesAccessor): ExtensionEditor | null {
|
||||
const activeControl = accessor.get(IEditorService).activeControl as ExtensionEditor;
|
||||
if (activeControl instanceof ExtensionEditor) {
|
||||
return activeControl;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
const showCommand = new ShowExtensionEditorFindCommand({
|
||||
(new ShowExtensionEditorFindCommand({
|
||||
id: 'editor.action.extensioneditor.showfind',
|
||||
precondition: ContextKeyExpr.and(ContextKeyExpr.equals('activeEditor', ExtensionEditor.ID), ContextKeyExpr.not('editorFocus')),
|
||||
precondition: contextKeyExpr,
|
||||
kbOpts: {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
});
|
||||
showCommand.register();
|
||||
})).register();
|
||||
|
||||
class StartExtensionEditorFindNextCommand extends Command {
|
||||
public runCommand(accessor: ServicesAccessor, args: any): void {
|
||||
const extensionEditor = getExtensionEditor(accessor);
|
||||
if (extensionEditor) {
|
||||
extensionEditor.runFindAction(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
(new StartExtensionEditorFindNextCommand({
|
||||
id: 'editor.action.extensioneditor.findNext',
|
||||
precondition: ContextKeyExpr.and(
|
||||
contextKeyExpr,
|
||||
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED),
|
||||
kbOpts: {
|
||||
primary: KeyCode.Enter,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
})).register();
|
||||
|
||||
class StartExtensionEditorFindPreviousCommand extends Command {
|
||||
public runCommand(accessor: ServicesAccessor, args: any): void {
|
||||
const extensionEditor = getExtensionEditor(accessor);
|
||||
if (extensionEditor) {
|
||||
extensionEditor.runFindAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
(new StartExtensionEditorFindPreviousCommand({
|
||||
id: 'editor.action.extensioneditor.findPrevious',
|
||||
precondition: ContextKeyExpr.and(
|
||||
contextKeyExpr,
|
||||
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED),
|
||||
kbOpts: {
|
||||
primary: KeyMod.Shift | KeyCode.Enter,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
})).register();
|
||||
|
||||
function getExtensionEditor(accessor: ServicesAccessor): ExtensionEditor | null {
|
||||
const activeControl = accessor.get(IEditorService).activeControl as ExtensionEditor;
|
||||
if (activeControl instanceof ExtensionEditor) {
|
||||
return activeControl;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/browser/extensionTipsService';
|
||||
|
||||
// Singletons
|
||||
registerSingleton(IExtensionTipsService, ExtensionTipsService);
|
||||
@@ -3100,7 +3100,6 @@ export class InstallLocalExtensionsInRemoteAction extends Action {
|
||||
private extensions: IExtension[] | undefined = undefined;
|
||||
|
||||
constructor(
|
||||
private readonly selectAndInstall: boolean,
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
|
||||
@@ -3122,9 +3121,7 @@ export class InstallLocalExtensionsInRemoteAction extends Action {
|
||||
|
||||
get label(): string {
|
||||
if (this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
return this.selectAndInstall ?
|
||||
localize('select and install local extensions', "Install Local Extensions in {0}...", this.extensionManagementServerService.remoteExtensionManagementServer.label)
|
||||
: localize('install local extensions', "Install Local Extensions in {0}", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
return localize('select and install local extensions', "Install Local Extensions in {0}...", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@@ -3140,12 +3137,7 @@ export class InstallLocalExtensionsInRemoteAction extends Action {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
if (this.selectAndInstall) {
|
||||
return this.selectAndInstallLocalExtensions();
|
||||
} else {
|
||||
const extensionsToInstall = await this.queryExtensionsToInstall();
|
||||
return this.installLocalExtensions(extensionsToInstall);
|
||||
}
|
||||
return this.selectAndInstallLocalExtensions();
|
||||
}
|
||||
|
||||
private async queryExtensionsToInstall(): Promise<IExtension[]> {
|
||||
|
||||
@@ -961,7 +961,7 @@ export class ServerExtensionsView extends ExtensionsListView {
|
||||
|
||||
getActions(): IAction[] {
|
||||
if (this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManagementServerService.localExtensionManagementServer === this.server) {
|
||||
const installLocalExtensionsInRemoteAction = this._register(this.instantiationService.createInstance(InstallLocalExtensionsInRemoteAction, false));
|
||||
const installLocalExtensionsInRemoteAction = this._register(this.instantiationService.createInstance(InstallLocalExtensionsInRemoteAction));
|
||||
installLocalExtensionsInRemoteAction.class = 'octicon octicon-cloud-download';
|
||||
return [installLocalExtensionsInRemoteAction];
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class RemoteExtensionsInstaller extends Disposable implements IWorkbenchC
|
||||
) {
|
||||
super();
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
const installLocalExtensionsInRemoteAction = instantiationService.createInstance(InstallLocalExtensionsInRemoteAction, true);
|
||||
const installLocalExtensionsInRemoteAction = instantiationService.createInstance(InstallLocalExtensionsInRemoteAction);
|
||||
CommandsRegistry.registerCommand('workbench.extensions.installLocalExtensions', () => installLocalExtensionsInRemoteAction.run());
|
||||
let disposable = Disposable.None;
|
||||
const appendMenuItem = () => {
|
||||
|
||||
Reference in New Issue
Block a user