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


TypeScript extHostTypes.Position类代码示例

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


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

示例1: test

	test('Position, isBefore(OrEqual)?', function() {
		let p1 = new types.Position(1, 3);
		let p2 = new types.Position(1, 2);
		let p3 = new types.Position(0, 4);

		assert.ok(p1.isBeforeOrEqual(p1));
		assert.ok(!p1.isBefore(p1));
		assert.ok(p2.isBefore(p1));
		assert.ok(p3.isBefore(p2));
	});
开发者ID:578723746,项目名称:vscode,代码行数:10,代码来源:extHostTypes.test.ts

示例2: test

	test('Position, compareTo', function() {
		let p1 = new types.Position(1, 3);
		let p2 = new types.Position(1, 2);
		let p3 = new types.Position(0, 4);

		assert.equal(p1.compareTo(p1), 0);
		assert.equal(p2.compareTo(p1), -1);
		assert.equal(p1.compareTo(p2), 1);
		assert.equal(p2.compareTo(p3), 1);
		assert.equal(p1.compareTo(p3), 1);
	});
开发者ID:13572293130,项目名称:vscode,代码行数:11,代码来源:extHostTypes.test.ts

示例3: test

	test('Position, with', function () {
		let p1 = new types.Position(1, 3);

		assert.ok(p1.with() === p1);
		assert.ok(p1.with(1) === p1);
		assert.ok(p1.with(undefined, 3) === p1);
		assert.ok(p1.with(1, 3) === p1);
		assert.ok(p1.with(undefined) === p1);
		assert.ok(p1.with({ line: 1 }) === p1);
		assert.ok(p1.with({ character: 3 }) === p1);
		assert.ok(p1.with({ line: 1, character: 3 }) === p1);

		let p2 = p1.with({ line: 0, character: 11 });
		assert.equal(p2.line, 0);
		assert.equal(p2.character, 11);

		assert.throws(() => p1.with(null));
		assert.throws(() => p1.with(-9));
		assert.throws(() => p1.with(0, -9));
		assert.throws(() => p1.with({ line: -1 }));
		assert.throws(() => p1.with({ character: -1 }));
	});
开发者ID:jumpinjackie,项目名称:sqlopsstudio,代码行数:22,代码来源:extHostTypes.test.ts

示例4:

		assert.throws(() => p1.with(0, -9));
开发者ID:13572293130,项目名称:vscode,代码行数:1,代码来源:extHostTypes.test.ts

示例5:

		assert.throws(() => p1.with({ character: -1 }));
开发者ID:jumpinjackie,项目名称:sqlopsstudio,代码行数:1,代码来源:extHostTypes.test.ts


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