@@ -1283,14 +1283,31 @@ export class CustomTreeViewDragAndDrop implements ITreeDragAndDrop<ITreeItem> {
1283
1283
this . dndController = controller ;
1284
1284
}
1285
1285
1286
+ private handleDragAndLog ( dndController : ITreeViewDragAndDropController , itemHandles : string [ ] , uuid : string , dragCancellationToken : CancellationToken ) : Promise < IDataTransfer | undefined > {
1287
+ return dndController . handleDrag ( itemHandles , uuid , dragCancellationToken ) . then ( additionalDataTransfer => {
1288
+ if ( additionalDataTransfer ) {
1289
+ const unlistedTypes : string [ ] = [ ] ;
1290
+ for ( const item of additionalDataTransfer . entries ( ) ) {
1291
+ if ( ( item [ 0 ] !== this . treeMimeType ) && ( dndController . dragMimeTypes . findIndex ( value => value === item [ 0 ] ) < 0 ) ) {
1292
+ unlistedTypes . push ( item [ 0 ] ) ;
1293
+ }
1294
+ }
1295
+ if ( unlistedTypes . length ) {
1296
+ this . logService . warn ( `Drag and drop controller for tree ${ this . treeId } adds the following data transfer types but does not declare them in dragMimeTypes: ${ unlistedTypes . join ( ', ' ) } ` ) ;
1297
+ }
1298
+ }
1299
+ return additionalDataTransfer ;
1300
+ } ) ;
1301
+ }
1302
+
1286
1303
private addExtensionProvidedTransferTypes ( originalEvent : DragEvent , itemHandles : string [ ] ) {
1287
1304
if ( ! originalEvent . dataTransfer || ! this . dndController ) {
1288
1305
return ;
1289
1306
}
1290
1307
const uuid = generateUuid ( ) ;
1291
1308
1292
1309
this . dragCancellationToken = new CancellationTokenSource ( ) ;
1293
- this . treeViewsDragAndDropService . addDragOperationTransfer ( uuid , this . dndController . handleDrag ( itemHandles , uuid , this . dragCancellationToken . token ) ) ;
1310
+ this . treeViewsDragAndDropService . addDragOperationTransfer ( uuid , this . handleDragAndLog ( this . dndController , itemHandles , uuid , this . dragCancellationToken . token ) ) ;
1294
1311
this . treeItemsTransfer . setData ( [ new DraggedTreeItemsIdentifier ( uuid ) ] , DraggedTreeItemsIdentifier . prototype ) ;
1295
1312
if ( this . dndController . dragMimeTypes . find ( ( element ) => element === Mimes . uriList ) ) {
1296
1313
// Add the type that the editor knows
0 commit comments