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


TypeScript PrefixSumComputer.getIndexOf方法代码示例

本文整理汇总了TypeScript中vs/editor/common/viewModel/prefixSumComputer.PrefixSumComputer.getIndexOf方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PrefixSumComputer.getIndexOf方法的具体用法?TypeScript PrefixSumComputer.getIndexOf怎么用?TypeScript PrefixSumComputer.getIndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/editor/common/viewModel/prefixSumComputer.PrefixSumComputer的用法示例。


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

示例1: getRangeAt

	public getRangeAt(offset: number, length: number): Range {
		const startResult = this._lineStarts.getIndexOf(offset);
		const startLineLength = this._lines[startResult.index].length;
		const startColumn = Math.min(startResult.remainder + 1, startLineLength + 1);

		const endResult = this._lineStarts.getIndexOf(offset + length);
		const endLineLength = this._lines[endResult.index].length;
		const endColumn = Math.min(endResult.remainder + 1, endLineLength + 1);

		return new Range(startResult.index + 1, startColumn, endResult.index + 1, endColumn);
	}
开发者ID:JarnoNijboer,项目名称:vscode,代码行数:11,代码来源:linesTextBuffer.ts

示例2: getOutputLineTokens

	public getOutputLineTokens(outputLineNumber: number, inaccurateTokensAcceptable: boolean): editorCommon.IViewLineTokens {
		this._ensureValidState();
		this.prefixSumComputer.getIndexOf(outputLineNumber - 1, this.tmpIndexOfResult);
		var lineIndex = this.tmpIndexOfResult.index;
		var remainder = this.tmpIndexOfResult.remainder;

		return this.lines[lineIndex].getOutputLineTokens(this.model, lineIndex + 1, remainder, inaccurateTokensAcceptable);
	}
开发者ID:pieandcakes,项目名称:vscode,代码行数:8,代码来源:splitLinesCollection.ts

示例3: getOutputLineMaxColumn

	public getOutputLineMaxColumn(outputLineNumber: number): number {
		this._ensureValidState();
		this.prefixSumComputer.getIndexOf(outputLineNumber - 1, this.tmpIndexOfResult);
		var lineIndex = this.tmpIndexOfResult.index;
		var remainder = this.tmpIndexOfResult.remainder;

		return this.lines[lineIndex].getOutputLineMaxColumn(this.model, lineIndex + 1, remainder);
	}
开发者ID:pieandcakes,项目名称:vscode,代码行数:8,代码来源:splitLinesCollection.ts

示例4: getOutputLineTokens

	public getOutputLineTokens(outputLineNumber: number): editorCommon.ViewLineTokens {
		this._ensureValidState();
		outputLineNumber = this._toValidOutputLineNumber(outputLineNumber);
		let r = this.prefixSumComputer.getIndexOf(outputLineNumber - 1);
		let lineIndex = r.index;
		let remainder = r.remainder;

		return this.lines[lineIndex].getOutputLineTokens(this.model, lineIndex + 1, remainder);
	}
开发者ID:1833183060,项目名称:vscode,代码行数:9,代码来源:splitLinesCollection.ts

示例5: getOutputLineMaxColumn

	public getOutputLineMaxColumn(outputLineNumber: number): number {
		this._ensureValidState();
		outputLineNumber = this._toValidOutputLineNumber(outputLineNumber);
		let r = this.prefixSumComputer.getIndexOf(outputLineNumber - 1);
		let lineIndex = r.index;
		let remainder = r.remainder;

		return this.lines[lineIndex].getOutputLineMaxColumn(this.model, lineIndex + 1, remainder);
	}
开发者ID:1833183060,项目名称:vscode,代码行数:9,代码来源:splitLinesCollection.ts

示例6: getOutputLineContent

	public getOutputLineContent(outputLineNumber: number): string {
		this._ensureValidState();
		outputLineNumber = this._toValidOutputLineNumber(outputLineNumber);
		this.prefixSumComputer.getIndexOf(outputLineNumber - 1, this.tmpIndexOfResult);
		var lineIndex = this.tmpIndexOfResult.index;
		var remainder = this.tmpIndexOfResult.remainder;

		return this.lines[lineIndex].getOutputLineContent(this.model, lineIndex + 1, remainder);
	}
开发者ID:578723746,项目名称:vscode,代码行数:9,代码来源:splitLinesCollection.ts

示例7: convertOutputPositionToInputPosition

	public convertOutputPositionToInputPosition(viewLineNumber: number, viewColumn: number): editorCommon.IEditorPosition {
		this._ensureValidState();
		this.prefixSumComputer.getIndexOf(viewLineNumber - 1, this.tmpIndexOfResult);
		var lineIndex = this.tmpIndexOfResult.index;
		var remainder = this.tmpIndexOfResult.remainder;

		var inputColumn = this.lines[lineIndex].getInputColumnOfOutputPosition(remainder, viewColumn);
//		console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn);
		return new Position(lineIndex+1, inputColumn);
	}
开发者ID:pieandcakes,项目名称:vscode,代码行数:10,代码来源:splitLinesCollection.ts

示例8: getPositionAt

	public getPositionAt(offset: number): Position {
		offset = Math.floor(offset);
		offset = Math.max(0, offset);

		let out = this._lineStarts.getIndexOf(offset);

		let lineLength = this._lines[out.index].length;

		// Ensure we return a valid position
		return new Position(out.index + 1, Math.min(out.remainder + 1, lineLength + 1));
	}
开发者ID:JarnoNijboer,项目名称:vscode,代码行数:11,代码来源:linesTextBuffer.ts

示例9: convertOutputPositionToInputPosition

	public convertOutputPositionToInputPosition(viewLineNumber: number, viewColumn: number): editorCommon.IEditorPosition {
		this._ensureValidState();
		viewLineNumber = this._toValidOutputLineNumber(viewLineNumber);

		let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1);
		let lineIndex = r.index;
		let remainder = r.remainder;

		let inputColumn = this.lines[lineIndex].getInputColumnOfOutputPosition(remainder, viewColumn);
		// console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn);
		return this.model.validatePosition(new Position(lineIndex+1, inputColumn));
	}
开发者ID:1833183060,项目名称:vscode,代码行数:12,代码来源:splitLinesCollection.ts

示例10: getOutputPositionOfInputOffset

	public getOutputPositionOfInputOffset(inputOffset: number): OutputPosition {
		let r = this._prefixSums.getIndexOf(inputOffset);
		return new OutputPosition(r.index, r.remainder);
	}
开发者ID:Chan-PH,项目名称:vscode,代码行数:4,代码来源:characterHardWrappingLineMapper.ts


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