本文整理匯總了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());
});