当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript labels.getPathLabel函数代码示例

本文整理汇总了TypeScript中vs/base/common/labels.getPathLabel函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getPathLabel函数的具体用法?TypeScript getPathLabel怎么用?TypeScript getPathLabel使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getPathLabel函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getPathLabel

	const folderPicks = folders.map(folder => {
		return {
			label: folder.name,
			description: getPathLabel(resources.dirname(folder.uri), void 0, environmentService),
			folder,
			resource: folder.uri,
			fileKind: FileKind.ROOT_FOLDER
		} as IFilePickOpenEntry;
	});
开发者ID:JarnoNijboer,项目名称:vscode,代码行数:9,代码来源:workspaceCommands.ts

示例2: getResourceForCommand

	handler: (accessor, resource: URI) => {
		resource = getResourceForCommand(resource, accessor.get(IListService), accessor.get(IWorkbenchEditorService));
		if (resource) {
			const clipboardService = accessor.get(IClipboardService);
			clipboardService.writeText(resource.scheme === 'file' ? labels.getPathLabel(resource) : resource.toString());
		} else {
			const messageService = accessor.get(IMessageService);
			messageService.show(severity.Info, nls.localize('openFileToCopy', "Open a file first to copy its path"));
		}
	}
开发者ID:servicesgpr,项目名称:vscode,代码行数:10,代码来源:fileCommands.ts

示例3: onDragStart

	public onDragStart(tree: _.ITree, data: _.IDragAndDropData, originalEvent: Mouse.DragMouseEvent): void {
		const sources: object[] = data.getData();

		let source: object = null;
		if (sources.length > 0) {
			source = sources[0];
		}

		// Apply some datatransfer types to allow for dragging the element outside of the application
		const resource = this.toResource(source);
		if (resource) {
			originalEvent.dataTransfer.setData('text/plain', getPathLabel(resource));
		}
	}
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:14,代码来源:treeDnd.ts

示例4: getWorkspaceLabel

export function getWorkspaceLabel(workspace: (IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier), environmentService: IEnvironmentService, options?: { verbose: boolean }): string {

	// Workspace: Single Folder
	if (isSingleFolderWorkspaceIdentifier(workspace)) {
		return tildify(workspace, environmentService.userHome);
	}

	// Workspace: Untitled
	if (isParent(workspace.configPath, environmentService.workspacesHome, !isLinux /* ignore case */)) {
		return localize('untitledWorkspace', "Untitled (Workspace)");
	}

	// Workspace: Saved
	const filename = basename(workspace.configPath);
	const workspaceName = filename.substr(0, filename.length - WORKSPACE_EXTENSION.length - 1);
	if (options && options.verbose) {
		return localize('workspaceNameVerbose', "{0} (Workspace)", getPathLabel(join(dirname(workspace.configPath), workspaceName), null, environmentService));
	}

	return localize('workspaceName', "{0} (Workspace)", workspaceName);
}
开发者ID:jumpinjackie,项目名称:sqlopsstudio,代码行数:21,代码来源:workspaces.ts

示例5: toResource

export const copyPathCommand = (accessor: ServicesAccessor, resource?: URI) => {

	// Without resource, try to look at the active editor
	if (!resource) {
		const editorGroupService = accessor.get(IEditorGroupService);
		const editorService = accessor.get(IWorkbenchEditorService);
		const activeEditor = editorService.getActiveEditor();

		resource = activeEditor ? toResource(activeEditor.input, { supportSideBySide: true }) : void 0;
		if (activeEditor) {
			editorGroupService.focusGroup(activeEditor.position); // focus back to active editor group
		}
	}

	if (resource) {
		const clipboardService = accessor.get(IClipboardService);
		clipboardService.writeText(resource.scheme === 'file' ? getPathLabel(resource) : resource.toString());
	} else {
		const messageService = accessor.get(IMessageService);
		messageService.show(severity.Info, nls.localize('openFileToCopy', "Open a file first to copy its path"));
	}
};
开发者ID:gokulakrishna9,项目名称:vscode,代码行数:22,代码来源:fileCommands.ts

示例6: setFile

	public setFile(file: uri, provider: IWorkspaceFolderProvider, userHome: IUserHomeProvider): void {
		const parent = paths.dirname(file.fsPath);

		this.setValue(getBaseLabel(file), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath });
	}
开发者ID:sameer-coder,项目名称:vscode,代码行数:5,代码来源:iconLabel.ts

示例7:

		const text = resources.map(r => r.scheme === Schemas.file ? labels.getPathLabel(r) : r.toString()).join(lineDelimiter);
开发者ID:jinlongchen2018,项目名称:vscode,代码行数:1,代码来源:fileCommands.ts

示例8:

		const text = resources.map(r => r.scheme === 'file' ? labels.getPathLabel(r) : r.toString()).join('\n');
开发者ID:JarnoNijboer,项目名称:vscode,代码行数:1,代码来源:fileCommands.ts

示例9: setFile

	public setFile(file: uri, provider: IRootProvider, userHome: IUserHomeProvider): void {
		const parent = paths.dirname(file.fsPath);

		this.setValue(paths.basename(file.fsPath), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath });
	}
开发者ID:Chan-PH,项目名称:vscode,代码行数:5,代码来源:iconLabel.ts


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