allow empty string as valid document content, fixes #6526

This commit is contained in:
Johannes Rieken
2016-05-19 12:45:37 +02:00
parent b6f0eee29e
commit d37a76dc92
2 changed files with 18 additions and 1 deletions

View File

@@ -294,6 +294,23 @@ suite('workspace-namespace', () => {
});
});
test('registerTextDocumentContentProvider, empty doc', function () {
let registration = workspace.registerTextDocumentContentProvider('foo', {
provideTextDocumentContent(uri) {
return '';
}
});
const uri = Uri.parse('foo:doc/empty');
return workspace.openTextDocument(uri).then(doc => {
assert.equal(doc.getText(), '');
assert.equal(doc.uri.toString(), uri.toString());
registration.dispose();
});
});
test('registerTextDocumentContentProvider, change event', function () {
let callCount = 0;