diff --git a/webapp/lsp/lsp-diags.xqm b/webapp/lsp/lsp-diags.xqm index eff59f5..247df30 100644 --- a/webapp/lsp/lsp-diags.xqm +++ b/webapp/lsp/lsp-diags.xqm @@ -46,16 +46,19 @@ as map(*){ :) declare function lsp-diags:parse-error($text as xs:string, $xml as element(ERROR)) as map(*)*{ - +let $dmesg:=$xml/string() +let $dmesg:=translate($dmesg," ",";") +return ( lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@b), pos:toPosition($text, $xml/@e)), $lsp-diags:severities('error'), - $xml/string()), + $dmesg), lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@e +1 ), pos:toPosition($text, string-length($text)-1)), $lsp-diags:severities('warning'), "Unparsed due to previous parser error.") +) }; (: test data :) diff --git a/webapp/lsp/lsp-text.xqm b/webapp/lsp/lsp-text.xqm index d4d3e3f..322f0d8 100644 --- a/webapp/lsp/lsp-text.xqm +++ b/webapp/lsp/lsp-text.xqm @@ -31,10 +31,9 @@ A [link](http://google.com) The last line.` , -`A hover at { pos:ln-col($json?params?position) } -uri: {$json?params?textDocument?uri} ` +`A hover at { pos:ln-col($json?params?position) } uri: {$json?params?textDocument?uri} ` ] -return rpc:response($r,$json) +return rpc:response({"contents":$r},$json) };