當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript uri.revive函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。