提交 2579db23 编写于 作者: J Johannes Rieken

remove unused IFileService#resolveContents, #29194

上级 1b05f83b
......@@ -68,11 +68,6 @@ export interface IFileService {
*/
resolveStreamContent(resource: URI, options?: IResolveContentOptions): TPromise<IStreamContent>;
/**
* Returns the contents of all files by the given array of file resources.
*/
resolveContents(resources: URI[]): TPromise<IContent[]>;
/**
* Updates the content replacing its previous value.
*/
......@@ -793,4 +788,4 @@ export enum FileKind {
FILE,
FOLDER,
ROOT_FOLDER
}
\ No newline at end of file
}
......@@ -212,10 +212,6 @@ export class FileService implements IFileService {
return this.raw.resolveStreamContent(resource, options);
}
public resolveContents(resources: uri[]): TPromise<IContent[]> {
return this.raw.resolveContents(resources);
}
public updateContent(resource: uri, value: string, options?: IUpdateContentOptions): TPromise<IFileStat> {
return this.raw.updateContent(resource, value, options);
}
......
......@@ -20,7 +20,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import types = require('vs/base/common/types');
import objects = require('vs/base/common/objects');
import extfs = require('vs/base/node/extfs');
import { nfcall, Limiter, ThrottledDelayer } from 'vs/base/common/async';
import { nfcall, ThrottledDelayer } from 'vs/base/common/async';
import uri from 'vs/base/common/uri';
import nls = require('vs/nls');
import { isWindows, isLinux } from 'vs/base/common/platform';
......@@ -75,7 +75,6 @@ export class FileService implements IFileService {
private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms)
private static FS_REWATCH_DELAY = 300; // delay to rewatch a file that was renamed or deleted (in ms)
private static MAX_DEGREE_OF_PARALLEL_FS_OPS = 10; // degree of parallel fs calls that we accept at the same time
private tmpPath: string;
private options: IFileServiceOptions;
......@@ -302,19 +301,6 @@ export class FileService implements IFileService {
});
}
public resolveContents(resources: uri[]): TPromise<IContent[]> {
const limiter = new Limiter(FileService.MAX_DEGREE_OF_PARALLEL_FS_OPS);
const contentPromises = <TPromise<IContent>[]>[];
resources.forEach(resource => {
contentPromises.push(limiter.queue(() => this.resolve(resource).then(model => this.resolveFileContent(model)).then(content => content, error => TPromise.as(null /* ignore errors gracefully */))));
});
return TPromise.join(contentPromises).then(contents => {
return arrays.coalesce(contents);
});
}
public updateContent(resource: uri, value: string, options: IUpdateContentOptions = Object.create(null)): TPromise<IFileStat> {
const absolutePath = this.toAbsolutePath(resource);
......
......@@ -48,20 +48,6 @@ suite('FileService', () => {
extfs.del(parentDir, os.tmpdir(), () => { }, done);
});
test('resolveContents', function (done: () => void) {
service.resolveContents([
uri.file(path.join(testDir, 'index.html')),
uri.file(path.join(testDir, '404.html')),
uri.file(path.join(testDir, 'deep', 'company.js')),
]).done(r => {
assert.equal(r.length, 2);
assert.equal(r.some(c => c.name === 'index.html'), true);
assert.equal(r.some(c => c.name === 'company.js'), true);
done();
});
});
test('createFile', function (done: () => void) {
let event: FileOperationEvent;
const toDispose = service.onAfterOperation(e => {
......
......@@ -707,10 +707,6 @@ export class TestFileService implements IFileService {
});
}
resolveContents(resources: URI[]): TPromise<IContent[]> {
return TPromise.as(null);
}
updateContent(resource: URI, value: string, options?: IUpdateContentOptions): TPromise<IFileStat> {
return TPromise.timeout(1).then(() => {
return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册