Add drop into editor option (#147049)

* Add drop into editor option

This change adds a new `enableDropIntoEditor` editor option that enables/disables dropping an extermal resources into an editor

Previously this option was exposed `IEditorConstructionOptions`, however this did not correctly disable drop into editor when dragging and dropping unknown types (such as dragging emoji from the MacOS emoji panel)

With this change, disabling `workbench.editor.dropIntoEditor.enabled` should fully disable the new drop into behavior

* Move drop into editor from workbench to editor

This moves the `dropIntoEditorContribution` from the workbench layer to the platform layer

As part of this change, I also add to move `extractEditorsDropData` up to `platform` so that it could be used from the `editor` layer

This change also enables drop into for the SCM message box

* Fixing monaco errors

* Revert id change
This commit is contained in:
Matt Bierner
2022-05-17 11:35:04 -07:00
committed by GitHub
parent 06cf633d63
commit 116c10e0ee
31 changed files with 736 additions and 643 deletions

View File

@@ -25,7 +25,7 @@ import { Command } from 'vs/editor/common/languages';
import { DataTransferConverter, DataTransferDTO } from 'vs/workbench/api/common/shared/dataTransfer';
import { ITreeViewsService, TreeviewsService } from 'vs/workbench/services/views/common/treeViewsService';
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
import { IDataTransfer } from 'vs/editor/common/dnd';
import { IDataTransfer } from 'vs/base/common/dataTransfer';
type TreeItemHandle = string;

View File

@@ -5,7 +5,7 @@
import { once } from 'vs/base/common/functional';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IDataTransfer, IDataTransferItem } from 'vs/editor/common/dnd';
import { IDataTransfer, IDataTransferItem } from 'vs/base/common/dataTransfer';
export interface IDataTransferFileDTO {
readonly name: string;

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { VSBuffer } from 'vs/base/common/buffer';
import { IDataTransfer, IDataTransferItem } from 'vs/editor/common/dnd';
import { IDataTransfer, IDataTransferItem } from 'vs/base/common/dataTransfer';
export class DataTransferCache {