import { TextDocument } from "vscode-languageserver" ; import { Range as LSPRange } from "vscode-languageserver-types" ; import { OffsetRange } from "@ui5-language-assistant/logic-utils" ; export function LSPRangeToOffsetRange ( LSPRange , document ) { return { start : document . offsetAt ( LSPRange . start ) , end : document . offsetAt ( LSPRange . end ) - 1 , } ; } export function offsetRangeToLSPRange ( offsetRange , document ) { return { start : document . positionAt ( offsetRange . start ) , end : document . positionAt ( offsetRange . end + 1 ) , } ; }