[mod] java xq parser
This commit is contained in:
parent
c8e4f928b1
commit
99a77cd5bf
4 changed files with 19 additions and 7 deletions
|
|
@ -4,7 +4,8 @@
|
|||
@author Andy Bunce
|
||||
:)
|
||||
module namespace docs="lsp/docs";
|
||||
import module namespace p="xq4" at "xq4.xqm";
|
||||
(: import module namespace p="xq4" at "xq4.xqm"; :)
|
||||
import module namespace xq4="java:quodatum.parser.xq4";
|
||||
import module namespace pos="lsp/position" at "position.xqm";
|
||||
import module namespace rpc = 'rpc' at 'jsonrpc.xqm';
|
||||
import module namespace lsp-diags = 'lsp-diags' at 'lsp-diags.xqm';
|
||||
|
|
@ -118,7 +119,7 @@ declare function docs:parse(
|
|||
)as map(*)?
|
||||
{
|
||||
let $text:=docs:get($socket,$file,"textDocument")?text
|
||||
let $xml:= p:parse-Module($text)=>prof:time("⏱️ p:parse-Module " || $file)
|
||||
let $xml:= xq4:parseModule($text)=>prof:time("⏱️ p:parse-Module " || $file)
|
||||
return (
|
||||
ws:set($socket,docs:key($socket,$file,"parse"),$xml),
|
||||
lsp-diags:publish($file, $text, $xml)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ declare record lsp-diags:nostic(
|
|||
message as xs:string
|
||||
);
|
||||
|
||||
declare variable $lsp-diags:severities:={
|
||||
'error':1,
|
||||
'hint':2,
|
||||
'info':3,
|
||||
'warning':4
|
||||
};
|
||||
|
||||
declare function lsp-diags:publish(
|
||||
$uri as xs:string,
|
||||
$text as xs:string,
|
||||
|
|
@ -42,9 +49,11 @@ as map(*)*{
|
|||
|
||||
lsp-diags:nostic(pos:Range(pos:toPosition($text=>trace("EXML "), $xml/@b),
|
||||
pos:toPosition($text, $xml/@e)),
|
||||
1,$xml/string())=>trace("EEEE "),
|
||||
1,
|
||||
$xml/string()),
|
||||
|
||||
lsp-diags:nostic(pos:Range(pos:toPosition($text=>trace("EXML "), $xml/@e +1 ),
|
||||
lsp-diags:nostic(pos:Range(pos:toPosition($text, $xml/@e +1 ),
|
||||
pos:toPosition($text, string-length($text)-1)),
|
||||
1,"Previous parse error")
|
||||
2,
|
||||
"Previous parse error")
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue