src/vs/workbench/browser/parts/views/treeView.ts/CustomTreeViewDragAndDrop/decrementStringCount
class CustomTreeViewDragAndDrop:	async drop(data: IDragAndDropData, targetNode: ITreeItem | undefined, targetIndex: number | undefined, originalEvent: DragEvent): Promise<void> {
		const dndController = this.dndController;
		if (!originalEvent.dataTransfer || !dndController) {
			return;
		}
		const treeDataTransfer: IDataTransfer = new Map();
		const uris: URI[] = [];
		let itemsCount = Array.from(originalEvent.dataTransfer.items).reduce((previous, current) => {
			if ((current.kind === 'string') || (current.kind === 'file')) {
				return previous + 1;
			}
			return previous;
		}, 0);

		let treeSourceInfo: TreeDragSourceInfo | undefined;
		let willDropUuid: string | undefined;
		if (this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)) {
			willDropUuid = this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype)![0].identifier;
		}
		await new Promise<void>(resolve => {
			function decrementStringCount() {
				itemsCount--;
				if (itemsCount === 0) {
					// Check if there are uris to add and add them
					if (uris.length) {
						treeDataTransfer.set(Mimes.uriList, {
							asString: () => Promise.resolve(uris.map(uri => uri.toString()).join('\n')),
							value: undefined
						});
					}
					resolve();
				}
			}

			if (!originalEvent.dataTransfer) {
				return;
			}
			for (const dataItem of originalEvent.dataTransfer.items) {
				const type = dataItem.type;
				const convertedType = this.convertKnownMimes(type).type;
				if ((INTERNAL_MIME_TYPES.indexOf(convertedType) < 0)
					&& (convertedType === this.treeMimeType) || (dndController.dropMimeTypes.indexOf(convertedType) >= 0)) {
					if (dataItem.kind === 'string') {
						dataItem.getAsString(dataValue => {
							if (convertedType === this.treeMimeType) {
								treeSourceInfo = JSON.parse(dataValue);
							}
							if (dataValue) {
								const converted = this.convertKnownMimes(type, dataValue);
								treeDataTransfer.set(converted.type, {
									asString: () => Promise.resolve(converted.value!),
									value: undefined
								});
							}
							decrementStringCount();
						});
					} else if (dataItem.kind === 'file') {
						const dataValue = dataItem.getAsFile();
						if (dataValue) {
							uris.push(URI.file(dataValue.path));
						}
						decrementStringCount();
					} else {
						decrementStringCount();
					}
				}
			}
		});

		const additionalWillDropPromise = this.treeViewsDragAndDropService.removeDragOperationTransfer(willDropUuid);
		if (!additionalWillDropPromise) {
			return dndController.handleDrop(treeDataTransfer, targetNode, new CancellationTokenSource().token, willDropUuid, treeSourceInfo?.id, treeSourceInfo?.itemHandles);
		}
		return additionalWillDropPromise.then(additionalDataTransfer => {
			if (additionalDataTransfer) {
				for (const item of additionalDataTransfer.entries()) {
					treeDataTransfer.set(item[0], item[1]);
				}
			}
			return dndController.handleDrop(treeDataTransfer, targetNode, new CancellationTokenSource().token, willDropUuid, treeSourceInfo?.id, treeSourceInfo?.itemHandles);
		});

	}