提交 edd17df3 编写于 作者: D Daniel Imms

Normalize file watcher paths on Mac with NFC

Fixes #29765
上级 2620488a
......@@ -6,12 +6,14 @@
import * as glob from 'vs/base/common/glob';
import * as paths from 'vs/base/common/paths';
import * as path from 'path';
import * as platform from "vs/base/common/platform";
import * as watcher from 'vs/workbench/services/files/node/watcher/common';
import * as nsfw from 'nsfw';
import { IWatcherService, IWatcherRequest } from 'vs/workbench/services/files/node/watcher/nsfw/watcher';
import { TPromise, ProgressCallback, TValueCallback } from 'vs/base/common/winjs.base';
import { ThrottledDelayer } from 'vs/base/common/async';
import { FileChangeType } from 'vs/platform/files/common/files';
import { normalizeNFC } from "vs/base/common/strings";
const nsfwActionToRawChangeType: { [key: number]: number } = [];
nsfwActionToRawChangeType[nsfw.actions.CREATED] = FileChangeType.ADDED;
......@@ -94,6 +96,11 @@ export class NsfwWatcherService implements IWatcherService {
const events = undeliveredFileEvents;
undeliveredFileEvents = [];
// Mac uses NFD unicode form on disk, but we want NFC
if (platform.isMacintosh) {
events.forEach(e => e.path = normalizeNFC(e.path));
}
// Broadcast to clients normalized
const res = watcher.normalize(events);
this._progressCallback(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册