提交 fb93010a 编写于 作者: M Matt Bierner

Make sure we use the same path normalizer in a few additional places in buffer sync

上级 805aa7e8
...@@ -72,9 +72,10 @@ class BufferSynchronizer { ...@@ -72,9 +72,10 @@ class BufferSynchronizer {
constructor( constructor(
private readonly client: ITypeScriptServiceClient, private readonly client: ITypeScriptServiceClient,
pathNormalizer: (path: vscode.Uri) => string | undefined,
onCaseInsenitiveFileSystem: boolean onCaseInsenitiveFileSystem: boolean
) { ) {
this._pending = new ResourceMap<BufferOperation>(undefined, { this._pending = new ResourceMap<BufferOperation>(pathNormalizer, {
onCaseInsenitiveFileSystem onCaseInsenitiveFileSystem
}); });
} }
...@@ -280,7 +281,7 @@ class PendingDiagnostics extends ResourceMap<number> { ...@@ -280,7 +281,7 @@ class PendingDiagnostics extends ResourceMap<number> {
.sort((a, b) => a.value - b.value) .sort((a, b) => a.value - b.value)
.map(entry => entry.resource); .map(entry => entry.resource);
const map = new ResourceMap<void>(undefined, this.config); const map = new ResourceMap<void>(this._normalizePath, this.config);
for (const resource of orderedResources) { for (const resource of orderedResources) {
map.set(resource, undefined); map.set(resource, undefined);
} }
...@@ -367,7 +368,7 @@ export default class BufferSyncSupport extends Disposable { ...@@ -367,7 +368,7 @@ export default class BufferSyncSupport extends Disposable {
const pathNormalizer = (path: vscode.Uri) => this.client.normalizedPath(path); const pathNormalizer = (path: vscode.Uri) => this.client.normalizedPath(path);
this.syncedBuffers = new SyncedBufferMap(pathNormalizer, { onCaseInsenitiveFileSystem }); this.syncedBuffers = new SyncedBufferMap(pathNormalizer, { onCaseInsenitiveFileSystem });
this.pendingDiagnostics = new PendingDiagnostics(pathNormalizer, { onCaseInsenitiveFileSystem }); this.pendingDiagnostics = new PendingDiagnostics(pathNormalizer, { onCaseInsenitiveFileSystem });
this.synchronizer = new BufferSynchronizer(client, onCaseInsenitiveFileSystem); this.synchronizer = new BufferSynchronizer(client, pathNormalizer, onCaseInsenitiveFileSystem);
this.updateConfiguration(); this.updateConfiguration();
vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this, this._disposables); vscode.workspace.onDidChangeConfiguration(this.updateConfiguration, this, this._disposables);
......
...@@ -24,7 +24,7 @@ export class ResourceMap<T> { ...@@ -24,7 +24,7 @@ export class ResourceMap<T> {
private readonly _map = new Map<string, { readonly resource: vscode.Uri, value: T }>(); private readonly _map = new Map<string, { readonly resource: vscode.Uri, value: T }>();
constructor( constructor(
private readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer, protected readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer,
protected readonly config: { protected readonly config: {
readonly onCaseInsenitiveFileSystem: boolean, readonly onCaseInsenitiveFileSystem: boolean,
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册