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


TypeScript editorGroupsService.IEditorGroupsService类代码示例

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


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

示例1: viewColumnToEditorGroup

export function viewColumnToEditorGroup(editorGroupService: IEditorGroupsService, position?: EditorViewColumn): GroupIdentifier {
	if (typeof position !== 'number' || position === ACTIVE_GROUP) {
		return ACTIVE_GROUP; // prefer active group when position is undefined or passed in as such
	}

	const groups = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE);

	let candidate = groups[position];
	if (candidate) {
		return candidate.id; // found direct match
	}

	let firstGroup = groups[0];
	if (groups.length === 1 && firstGroup.count === 0) {
		return firstGroup.id; // first editor should always open in first group independent from position provided
	}

	return SIDE_GROUP; // open to the side if group not found or we are instructed to
}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:19,代码来源:editor.ts

示例2: editorGroupToViewColumn

export function editorGroupToViewColumn(editorGroupService: IEditorGroupsService, editorGroup: IEditorGroup | GroupIdentifier): EditorViewColumn {
	const group = (typeof editorGroup === 'number') ? editorGroupService.getGroup(editorGroup) : editorGroup;

	return editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE).indexOf(group);
}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:5,代码来源:editor.ts


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