mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)
* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 * fix pipelines * fix strict-null-checks * add missing files
This commit is contained in:
@@ -113,7 +113,7 @@ export function extractResources(e: DragEvent, externalOnly?: boolean): Array<ID
|
||||
if (e.dataTransfer && e.dataTransfer.files) {
|
||||
for (let i = 0; i < e.dataTransfer.files.length; i++) {
|
||||
const file = e.dataTransfer.files[i];
|
||||
if (file && file.path /* Electron only */ && !resources.some(r => r.resource.fsPath === file.path) /* prevent duplicates */) {
|
||||
if (file?.path /* Electron only */ && !resources.some(r => r.resource.fsPath === file.path) /* prevent duplicates */) {
|
||||
try {
|
||||
resources.push({ resource: URI.file(file.path), isExternal: true });
|
||||
} catch (error) {
|
||||
@@ -243,11 +243,13 @@ export class ResourcesDropHandler {
|
||||
}
|
||||
|
||||
// Resolve the contents of the dropped dirty resource from source
|
||||
try {
|
||||
const content = await this.backupFileService.resolveBackupContent((droppedDirtyEditor.backupResource!));
|
||||
await this.backupFileService.backupResource(droppedDirtyEditor.resource, content.value.create(this.getDefaultEOL()).createSnapshot(true));
|
||||
} catch (e) {
|
||||
// Ignore error
|
||||
if (droppedDirtyEditor.backupResource) {
|
||||
try {
|
||||
const content = await this.backupFileService.resolveBackupContent((droppedDirtyEditor.backupResource));
|
||||
await this.backupFileService.backupResource(droppedDirtyEditor.resource, content.value.create(this.getDefaultEOL()).createSnapshot(true));
|
||||
} catch (e) {
|
||||
// Ignore error
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -358,7 +360,7 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources:
|
||||
for (const textEditorWidget of textEditorWidgets) {
|
||||
if (isCodeEditor(textEditorWidget)) {
|
||||
const model = textEditorWidget.getModel();
|
||||
if (model && model.uri && model.uri.toString() === file.resource.toString()) {
|
||||
if (model?.uri?.toString() === file.resource.toString()) {
|
||||
viewState = textEditorWidget.saveViewState();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user