本文整理汇总了TypeScript中vs/workbench/services/files/node/fileService.FileService.dispose方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FileService.dispose方法的具体用法?TypeScript FileService.dispose怎么用?TypeScript FileService.dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/workbench/services/files/node/fileService.FileService
的用法示例。
在下文中一共展示了FileService.dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
fs.readFile(resource.fsPath, (error, data) => {
assert.equal(encodingLib.detectEncodingByBOMFromBuffer(data, 512), null);
model.dispose();
_service.dispose();
done();
});
示例2:
return _service.resolveContent(uri.file(path.join(testDir, 'deep', 'conway.js'))).done(c => {
assert.equal(c.charset, 'utf16le');
// teardown
_service.dispose();
done();
});
示例3: FileService
fs.readFile(resource.fsPath, (error, data) => {
assert.equal(encoding.detectEncodingByBOMFromBuffer(data, 512), encoding.UTF8);
_service.dispose();
_service = new FileService(_testDir, null, {
bom: BOMConfiguration.REMOVE,
disableWatcher: true
});
// Update content: BOM => REMOVE
_service.updateContent(resource, 'Hello Bom').done(() => {
fs.readFile(resource.fsPath, (error, data) => {
assert.equal(encoding.detectEncodingByBOMFromBuffer(data, 512), null);
_service.dispose();
_service = new FileService(_testDir, null, {
bom: BOMConfiguration.PRESERVE,
disableWatcher: true
});
// Update content: BOM => PRESERVE
_service.updateContent(resource, 'Hello Bom').done(() => {
fs.readFile(resource.fsPath, (error, data) => {
assert.equal(encoding.detectEncodingByBOMFromBuffer(data, 512), null);
_service.dispose();
done();
});
});
});
});
});
示例4: teardown
teardown((done) => {
service.dispose();
events.dispose();
extfs.del(parentDir, os.tmpdir(), () => { }, done);
});
示例5:
return pfs.readFile(resource.fsPath).then(data => {
assert.equal(encodingLib.detectEncodingByBOMFromBuffer(data, 512), null);
model.dispose();
_service.dispose();
});
示例6: teardown
teardown(() => {
service.dispose();
return pfs.del(parentDir, os.tmpdir());
});