Skip to content

Commit ac0299a

Browse files
committed
Fix missing text/uri-list in drops
Fixes microsoft#146031
1 parent 22e246d commit ac0299a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/vs/workbench/browser/dnd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export async function extractTreeDropData(dataTransfer: IDataTransfer): Promise<
197197

198198
export function convertResourceUrlsToUriList(resourceUrls: string): string {
199199
const asJson: URI[] = JSON.parse(resourceUrls);
200-
return asJson.map(uri => uri.toString()).join('/n');
200+
return asJson.map(uri => uri.toString()).join('\n');
201201
}
202202

203203
interface IFileTransferData {

src/vs/workbench/browser/parts/views/treeView.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,15 +1448,16 @@ export class CustomTreeViewDragAndDrop implements ITreeDragAndDrop<ITreeItem> {
14481448
}
14491449
for (const dataItem of originalEvent.dataTransfer.items) {
14501450
const type = dataItem.type;
1451+
const convertedType = this.convertKnownMimes(type).type;
14511452
if (dataItem.kind === 'string') {
1452-
if ((type === this.treeMimeType) || (dndController.dropMimeTypes.indexOf(type) >= 0)) {
1453+
if ((convertedType === this.treeMimeType) || (dndController.dropMimeTypes.indexOf(convertedType) >= 0)) {
14531454
dataItem.getAsString(dataValue => {
1454-
if (type === this.treeMimeType) {
1455+
if (convertedType === this.treeMimeType) {
14551456
treeSourceInfo = JSON.parse(dataValue);
14561457
}
14571458
if (dataValue
1458-
&& (INTERNAL_MIME_TYPES.indexOf(type) < 0)
1459-
&& ((type === this.treeMimeType) || (dndController.dropMimeTypes.indexOf(type) >= 0))) {
1459+
&& (INTERNAL_MIME_TYPES.indexOf(convertedType) < 0)
1460+
&& ((convertedType === this.treeMimeType) || (dndController.dropMimeTypes.indexOf(convertedType) >= 0))) {
14601461
const converted = this.convertKnownMimes(type, dataValue);
14611462
treeDataTransfer.set(converted.type, {
14621463
asString: () => Promise.resolve(converted.value!),

0 commit comments

Comments
 (0)