本文整理匯總了TypeScript中vs/base/common/uri.revive函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript revive函數的具體用法?TypeScript revive怎麽用?TypeScript revive使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了revive函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('issue #51387: originalFSPath', function () {
assert.equal(originalFSPath(URI.file('C:\\test')).charAt(0), 'C');
assert.equal(originalFSPath(URI.file('c:\\test')).charAt(0), 'c');
assert.equal(originalFSPath(URI.revive(JSON.parse(JSON.stringify(URI.file('C:\\test'))))).charAt(0), 'C');
assert.equal(originalFSPath(URI.revive(JSON.parse(JSON.stringify(URI.file('c:\\test'))))).charAt(0), 'c');
});
示例2: test
test('URI - (de)serialize', function() {
var values = [
URI.parse('http://localhost:8080/far'),
URI.file('c:\\test with %25\\c#code'),
URI.file('\\\\shäres\\path\\c#\\plugin.json'),
URI.parse('http://api/files/test.me?t=1234'),
URI.parse('http://api/files/test.me?t=1234#fff'),
URI.parse('http://api/files/test.me#fff'),
];
// console.profile();
// let c = 100000;
// while (c-- > 0) {
for(let value of values) {
let data = value.toJSON();
let clone = URI.revive(data);
assert.equal(clone.scheme, value.scheme);
assert.equal(clone.authority, value.authority);
assert.equal(clone.path, value.path);
assert.equal(clone.query, value.query);
assert.equal(clone.fragment, value.fragment);
assert.equal(clone.fsPath, value.fsPath);
assert.equal(clone.toString(), value.toString());
}
// }
// console.profileEnd();
});
示例3:
folders = arg.map(folder => {
if (typeof folder === 'string') {
return folder;
}
return URI.revive(folder);
});
示例4:
$tryApplyWorkspaceEdit(_edits: IWorkspaceResourceEdit[]) {
for (const { resource, edits } of _edits) {
const uri = URI.revive(resource);
for (const { newText, range } of edits) {
documents.$acceptModelChanged(uri.toString(), {
changes: [{
range,
rangeLength: undefined,
text: newText
}],
eol: undefined,
versionId: documents.getDocumentData(uri).version + 1
}, true);
}
}
return TPromise.as(true);
}
示例5: Folder
window.folderURIs.forEach(uriComponents => {
const folderUri = URI.revive(uriComponents);
if (folderUri.scheme === 'file') {
const folder = folderUri.fsPath;
workspaceStatPromises.push(collectWorkspaceStats(folder, ['node_modules', '.git']).then(async stats => {
let countMessage = `${stats.fileCount} files`;
if (stats.maxFilesReached) {
countMessage = `more than ${countMessage}`;
}
workspaceInfoMessages.push(`| Folder (${basename(folder)}): ${countMessage}`);
workspaceInfoMessages.push(formatWorkspaceStats(stats));
const launchConfigs = await collectLaunchConfigs(folder);
if (launchConfigs.length > 0) {
workspaceInfoMessages.push(formatLaunchConfigs(launchConfigs));
}
}));
} else {
workspaceInfoMessages.push(`| Folder (${folderUri.toString()}): RPerformance stats not available.`);
}
});
示例6: collectLaunchConfigs
window.folderURIs.forEach(uriComponents => {
const folderUri = URI.revive(uriComponents);
if (folderUri.scheme === 'file') {
const folder = folderUri.fsPath;
workspaceStatPromises.push(collectWorkspaceStats(folder, ['node_modules', '.git']).then(async stats => {
let countMessage = `${stats.fileCount} files`;
if (stats.maxFilesReached) {
countMessage = `more than ${countMessage}`;
}
console.log(`| Folder (${basename(folder)}): ${countMessage}`);
console.log(formatWorkspaceStats(stats));
await collectLaunchConfigs(folder).then(launchConfigs => {
if (launchConfigs.length > 0) {
console.log(formatLaunchConfigs(launchConfigs));
}
});
}).catch(error => {
console.log(`| Error: Unable to collect workspace stats for folder ${folder} (${error.toString()})`);
}));
} else {
console.log(`| Folder (${folderUri.toString()}): Workspace stats not available.`);
}
});
示例7: call
call(command: string, arg?: any): TPromise<any> {
switch (command) {
case 'handleURL': return this.handler.handleURL(URI.revive(arg));
}
return undefined;
}
示例8:
folders = rawFolders.map(rawFolder => {
return {
uri: URI.revive(rawFolder.uri), // convert raw URI back to real URI
name: rawFolder.name
} as IWorkspaceFolderCreationData;
});
示例9: _transform
private _transform(extension: ILocalExtension): ILocalExtension {
return extension ? { ...extension, ...{ location: URI.revive(extension.location) } } : extension;
}
示例10: _transformIncoming
private _transformIncoming(extension: ILocalExtension): ILocalExtension {
return extension ? { ...extension, ...{ location: URI.revive(this.uriTransformer.transformIncoming(extension.location)) } } : extension;
}