import module namespace pos="lsp/position" at "../webapp/lsp/position.xqm"; declare variable $msg:=json:doc("sample.msg/didChange/client2.json",{"format":"w3"}); declare variable $text:=`12345678 bbbbb cccccc`; (: return pos:resolvePosition($text,$p) :) pos:apply-changes($text,$msg?params?contentChanges) (: $msg?params?contentChanges :) ,$msg