[fix] hover

This commit is contained in:
Andy Bunce 2025-08-18 11:28:21 +01:00
parent e9a2d46272
commit 8453101c03
2 changed files with 7 additions and 5 deletions

View file

@ -46,16 +46,19 @@ as map(*){
:) :)
declare function lsp-diags:parse-error($text as xs:string, $xml as element(ERROR)) declare function lsp-diags:parse-error($text as xs:string, $xml as element(ERROR))
as map(*)*{ as map(*)*{
let $dmesg:=$xml/string()
let $dmesg:=translate($dmesg,"
",";")
return (
lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@b), lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@b),
pos:toPosition($text, $xml/@e)), pos:toPosition($text, $xml/@e)),
$lsp-diags:severities('error'), $lsp-diags:severities('error'),
$xml/string()), $dmesg),
lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@e +1 ), lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@e +1 ),
pos:toPosition($text, string-length($text)-1)), pos:toPosition($text, string-length($text)-1)),
$lsp-diags:severities('warning'), $lsp-diags:severities('warning'),
"Unparsed due to previous parser error.") "Unparsed due to previous parser error.")
)
}; };
(: test data :) (: test data :)

View file

@ -31,10 +31,9 @@ A [link](http://google.com)
The last line.` The last line.`
, ,
`A hover at { pos:ln-col($json?params?position) } `A hover at { pos:ln-col($json?params?position) } uri: {$json?params?textDocument?uri} `
uri: {$json?params?textDocument?uri} `
] ]
return rpc:response($r,$json) return rpc:response({"contents":$r},$json)
}; };