• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript uri.revive函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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');
	});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:7,代码来源:extHost.api.impl.test.ts


示例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();
	});
开发者ID:CPoirot3,项目名称:vscode,代码行数:29,代码来源:uri.test.ts


示例3:

					folders = arg.map(folder => {
						if (typeof folder === 'string') {
							return folder;
						}

						return URI.revive(folder);
					});
开发者ID:golf1052,项目名称:vscode,代码行数:7,代码来源:workspacesIpc.ts


示例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);
			}
开发者ID:servicesgpr,项目名称:vscode,代码行数:19,代码来源:extHostDocumentSaveParticipant.test.ts


示例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.`);
					}
				});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:22,代码来源:diagnostics.ts


示例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.`);
					}
				});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:24,代码来源:diagnostics.ts


示例7: call

	call(command: string, arg?: any): TPromise<any> {
		switch (command) {
			case 'handleURL': return this.handler.handleURL(URI.revive(arg));
		}
		return undefined;
	}
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:6,代码来源:urlIpc.ts


示例8:

					folders = rawFolders.map(rawFolder => {
						return {
							uri: URI.revive(rawFolder.uri), // convert raw URI back to real URI
							name: rawFolder.name
						} as IWorkspaceFolderCreationData;
					});
开发者ID:AllureFer,项目名称:vscode,代码行数:6,代码来源:workspacesIpc.ts


示例9: _transform

	private _transform(extension: ILocalExtension): ILocalExtension {
		return extension ? { ...extension, ...{ location: URI.revive(extension.location) } } : extension;
	}
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:3,代码来源:extensionManagementIpc.ts


示例10: _transformIncoming

	private _transformIncoming(extension: ILocalExtension): ILocalExtension {
		return extension ? { ...extension, ...{ location: URI.revive(this.uriTransformer.transformIncoming(extension.location)) } } : extension;
	}
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:3,代码来源:extensionManagementIpc.ts



注:本文中的vs/base/common/uri.revive函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript uri.toJSON函数代码示例发布时间:2022-05-25
下一篇:
TypeScript uri.parse函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap