Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faster content resolve #38074

Merged
merged 8 commits into from Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/vs/platform/files/common/files.ts
Expand Up @@ -449,6 +449,14 @@ export interface IContent extends IBaseStat {
encoding: string;
}

// this should eventually replace IContent such
// that we have a clear separation between content
// and metadata (TODO@Joh, TODO@Ben)
export interface IContentData {
encoding: string;
stream: IStringStream;
}

/**
* A Stream emitting strings.
*/
Expand Down
338 changes: 230 additions & 108 deletions src/vs/workbench/services/files/node/fileService.ts

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions src/vs/workbench/services/files/test/node/fileService.test.ts
Expand Up @@ -524,7 +524,7 @@ suite('FileService', () => {

test('resolveFile', function (done: () => void) {
service.resolveFile(uri.file(testDir), { resolveTo: [uri.file(path.join(testDir, 'deep'))] }).done(r => {
assert.equal(r.children.length, 6);
assert.equal(r.children.length, 7);

const deep = utils.getByName(r, 'deep');
assert.equal(deep.children.length, 4);
Expand All @@ -540,7 +540,7 @@ suite('FileService', () => {
]).then(res => {
const r1 = res[0].stat;

assert.equal(r1.children.length, 6);
assert.equal(r1.children.length, 7);

const deep = utils.getByName(r1, 'deep');
assert.equal(deep.children.length, 4);
Expand Down Expand Up @@ -625,6 +625,16 @@ suite('FileService', () => {
}, error => onError(error, done));
});

test('resolveContent - large file', function (done: () => void) {
const resource = uri.file(path.join(testDir, 'lorem.txt'));

service.resolveContent(resource).done(c => {
assert.ok(c.value.length > 64000);

done();
}, error => onError(error, done));
});

test('resolveContent - FILE_IS_BINARY', function (done: () => void) {
const resource = uri.file(path.join(testDir, 'binary.txt'));

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

121 changes: 0 additions & 121 deletions src/vs/workbench/services/files/test/node/fixtures/resolver/index.html

This file was deleted.