import * as vscode from 'vscode' ; import { IDocument } from "../documents/templates/IDocument" ; import { assert } from "../fixed_assert" ; import { LineColPos } from '../language/LineColPos' ; import { Span } from '../language/Span' ; export function getVSCodeRangeFromSpan ( deploymentDocument , span ) { assert ( span ) ; assert ( deploymentDocument ) ; const startPosition = deploymentDocument . getDocumentPosition ( span . startIndex ) ; const vscodeStartPosition = new vscode . Position ( startPosition . line , startPosition . column ) ; const endPosition = deploymentDocument . getDocumentPosition ( span . afterEndIndex ) ; const vscodeEndPosition = new vscode . Position ( endPosition . line , endPosition . column ) ; return new vscode . Range ( vscodeStartPosition , vscodeEndPosition ) ; } export function getVSCodePositionFromPosition ( position ) { return new vscode . Position ( position . line , position . column ) ; }