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


TypeScript paths.isAbsolute_posix函數代碼示例

本文整理匯總了TypeScript中vs/base/common/paths.isAbsolute_posix函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isAbsolute_posix函數的具體用法?TypeScript isAbsolute_posix怎麽用?TypeScript isAbsolute_posix使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了isAbsolute_posix函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

	constructor(public raw: DebugProtocol.Source, sessionId: string) {
		let path: string;
		if (raw) {
			path = this.raw.path || this.raw.name;
			this.available = true;
		} else {
			this.raw = { name: UNKNOWN_SOURCE_LABEL };
			this.available = false;
			path = `${DEBUG_SCHEME}:${UNKNOWN_SOURCE_LABEL}`;
		}

		if (this.raw.sourceReference > 0) {
			this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}&ref=${this.raw.sourceReference}`);
		} else {
			if (isUri(path)) {	// path looks like a uri
				this.uri = uri.parse(path);
			} else {
				// assume a filesystem path
				if (paths.isAbsolute_posix(path) || paths.isAbsolute_win32(path)) {
					this.uri = uri.file(path);
				} else {
					// path is relative: since VS Code cannot deal with this by itself
					// create a debug url that will result in a DAP 'source' request when the url is resolved.
					this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}`);
				}
			}
		}
	}
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:28,代碼來源:debugSource.ts

示例2:

		].forEach(nonAbsolutePath => {
			assert.ok(!paths.isAbsolute_posix(nonAbsolutePath), nonAbsolutePath);
		});
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:3,代碼來源:paths.test.ts


注:本文中的vs/base/common/paths.isAbsolute_posix函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。