mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 08:40:29 -04:00
Merge from vscode 63655183ba5305b70ffaf1327b8a4708f0a79bd9 (#5221)
This commit is contained in:
@@ -13,8 +13,7 @@ import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/pla
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { extensionButtonProminentBackground, extensionButtonProminentForeground, DisabledLabelAction, ReloadAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { STATUS_BAR_HOST_NAME_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { STATUS_BAR_HOST_NAME_BACKGROUND, STATUS_BAR_HOST_NAME_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
@@ -310,7 +309,6 @@ class RemoteBadge extends Disposable {
|
||||
private readonly tooltip: boolean,
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
super();
|
||||
@@ -326,13 +324,12 @@ class RemoteBadge extends Disposable {
|
||||
return;
|
||||
}
|
||||
const bgColor = this.themeService.getTheme().getColor(STATUS_BAR_HOST_NAME_BACKGROUND);
|
||||
const fgColor = this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY ? this.themeService.getTheme().getColor(STATUS_BAR_NO_FOLDER_FOREGROUND) : this.themeService.getTheme().getColor(STATUS_BAR_FOREGROUND);
|
||||
const fgColor = this.themeService.getTheme().getColor(STATUS_BAR_HOST_NAME_FOREGROUND);
|
||||
this.element.style.backgroundColor = bgColor ? bgColor.toString() : '';
|
||||
this.element.style.color = fgColor ? fgColor.toString() : '';
|
||||
};
|
||||
applyBadgeStyle();
|
||||
this._register(this.themeService.onThemeChange(() => applyBadgeStyle()));
|
||||
this._register(this.workspaceContextService.onDidChangeWorkbenchState(() => applyBadgeStyle()));
|
||||
|
||||
if (this.tooltip) {
|
||||
const updateTitle = () => {
|
||||
|
||||
@@ -110,11 +110,9 @@
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .icon-container .extension-remote-badge > .octicon {
|
||||
vertical-align: middle
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header > .extension-remote-badge-container {
|
||||
|
||||
@@ -166,7 +166,7 @@ export class GlobalNewUntitledFileAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
function deleteFiles(serviceAccesor: ServicesAccessor, elements: ExplorerItem[], useTrash: boolean, skipConfirm = false): Promise<void> {
|
||||
function deleteFiles(textFileService: ITextFileService, dialogService: IDialogService, configurationService: IConfigurationService, fileService: IFileService, elements: ExplorerItem[], useTrash: boolean, skipConfirm = false): Promise<void> {
|
||||
let primaryButton: string;
|
||||
if (useTrash) {
|
||||
primaryButton = isWindows ? nls.localize('deleteButtonLabelRecycleBin', "&&Move to Recycle Bin") : nls.localize({ key: 'deleteButtonLabelTrash', comment: ['&& denotes a mnemonic'] }, "&&Move to Trash");
|
||||
@@ -175,10 +175,6 @@ function deleteFiles(serviceAccesor: ServicesAccessor, elements: ExplorerItem[],
|
||||
}
|
||||
|
||||
const distinctElements = resources.distinctParents(elements, e => e.resource);
|
||||
const textFileService = serviceAccesor.get(ITextFileService);
|
||||
const dialogService = serviceAccesor.get(IDialogService);
|
||||
const configurationService = serviceAccesor.get(IConfigurationService);
|
||||
const fileService = serviceAccesor.get(IFileService);
|
||||
|
||||
// Handle dirty
|
||||
let confirmDirtyPromise: Promise<boolean> = Promise.resolve(true);
|
||||
@@ -296,7 +292,7 @@ function deleteFiles(serviceAccesor: ServicesAccessor, elements: ExplorerItem[],
|
||||
|
||||
skipConfirm = true;
|
||||
|
||||
return deleteFiles(serviceAccesor, elements, useTrash, skipConfirm);
|
||||
return deleteFiles(textFileService, dialogService, configurationService, fileService, elements, useTrash, skipConfirm);
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
@@ -1011,7 +1007,7 @@ export const moveFileToTrashHandler = (accessor: ServicesAccessor) => {
|
||||
const explorerContext = getContext(listService.lastFocusedList);
|
||||
const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat!];
|
||||
|
||||
return deleteFiles(accessor, stats, true);
|
||||
return deleteFiles(accessor.get(ITextFileService), accessor.get(IDialogService), accessor.get(IConfigurationService), accessor.get(IFileService), stats, true);
|
||||
};
|
||||
|
||||
export const deleteFileHandler = (accessor: ServicesAccessor) => {
|
||||
@@ -1022,7 +1018,7 @@ export const deleteFileHandler = (accessor: ServicesAccessor) => {
|
||||
const explorerContext = getContext(listService.lastFocusedList);
|
||||
const stats = explorerContext.selection.length > 1 ? explorerContext.selection : [explorerContext.stat!];
|
||||
|
||||
return deleteFiles(accessor, stats, false);
|
||||
return deleteFiles(accessor.get(ITextFileService), accessor.get(IDialogService), accessor.get(IConfigurationService), accessor.get(IFileService), stats, false);
|
||||
};
|
||||
|
||||
let pasteShouldMove = false;
|
||||
|
||||
@@ -474,12 +474,6 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
|
||||
if (typesArray.indexOf(DataTransfers.FILES.toLowerCase()) === -1 && typesArray.indexOf(CodeDataTransfers.FILES.toLowerCase()) === -1) {
|
||||
return false;
|
||||
}
|
||||
if (this.environmentService.configuration.remoteAuthority) {
|
||||
const resources = extractResources(originalEvent, true);
|
||||
if (resources.some(r => r.resource.authority !== this.environmentService.configuration.remoteAuthority)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Other-Tree DND
|
||||
@@ -611,6 +605,11 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
|
||||
|
||||
private handleExternalDrop(data: DesktopDragAndDropData, target: ExplorerItem, originalEvent: DragEvent): Promise<void> {
|
||||
const droppedResources = extractResources(originalEvent, true);
|
||||
if (this.environmentService.configuration.remoteAuthority) {
|
||||
if (droppedResources.some(r => r.resource.authority !== this.environmentService.configuration.remoteAuthority)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for dropped external files to be folders
|
||||
return this.fileService.resolveAll(droppedResources).then(result => {
|
||||
|
||||
@@ -155,7 +155,7 @@ export class ExplorerService implements IExplorerService {
|
||||
}
|
||||
|
||||
// Stat needs to be resolved first and then revealed
|
||||
const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: false };
|
||||
const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === 'modified' };
|
||||
const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
|
||||
const rootUri = workspaceFolder ? workspaceFolder.uri : this.roots[0].resource;
|
||||
const root = this.roots.filter(r => r.resource.toString() === rootUri.toString()).pop()!;
|
||||
|
||||
Reference in New Issue
Block a user