[mof] fix F #10
This commit is contained in:
parent
e1a46c8577
commit
0508901f72
9 changed files with 549 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
import module namespace p="xq4" at "C:\Users\mrwhe\git\quodatum\basex-lsp\webapp\lsp\xq4.xqm";
|
import module namespace p="xq4" at "C:\Users\mrwhe\git\quodatum\basex-lsp\webapp\lsp\xq4.xqm";
|
||||||
let $t:=fetch:text("https://raw.githubusercontent.com/dnovatchev/Articles/refs/heads/main/Generators/Code/generator.xq")=>lazy:cache()
|
declare variable $generator.xpath :="https://raw.githubusercontent.com/dnovatchev/Articles/refs/heads/main/Generators/Code/generator.xq";
|
||||||
return p:parse-Module($t)
|
|
||||||
|
declare variable $pdfbox-good.xqm :="../../test/sample.docs/pdfbox.xqm";
|
||||||
|
declare variable $dest:="C:\Users\mrwhe\git\quodatum\basex-lsp\test\sample.docs\parse-pdfbox.xml";
|
||||||
|
|
||||||
|
let $parse:= $pdfbox-good.xqm
|
||||||
|
=>fetch:text()
|
||||||
|
=>lazy:cache()
|
||||||
|
=>p:parse-Module()
|
||||||
|
|
||||||
|
return file:write($dest,$parse)
|
|
@ -16,6 +16,7 @@ services:
|
||||||
|
|
||||||
# - ./repo:/srv/basex/repo
|
# - ./repo:/srv/basex/repo
|
||||||
environment:
|
environment:
|
||||||
|
- "BASEX_JVM= -Dorg.basex.RESTXQERRORS=false "
|
||||||
- "SERVER_OPTS= "
|
- "SERVER_OPTS= "
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|
5
test/diagnostic.xq
Normal file
5
test/diagnostic.xq
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import module namespace hnd="lsp/handlers" at "../webapp/lsp/handlers.xqm";
|
||||||
|
declare variable $src:="sample.docs/parse-pdfbox.xml";
|
||||||
|
declare variable $parse:=doc($src);
|
||||||
|
|
||||||
|
hnd:diags($parse )
|
524
test/sample.docs/parse-pdfbox.xml
Normal file
524
test/sample.docs/parse-pdfbox.xml
Normal file
File diff suppressed because one or more lines are too long
0
webapp/lsp/diagnostic.xqm
Normal file
0
webapp/lsp/diagnostic.xqm
Normal file
|
@ -22,9 +22,11 @@ as function(*)
|
||||||
|
|
||||||
declare function hnd:diags($parse as element(),$diags:=())
|
declare function hnd:diags($parse as element(),$diags:=())
|
||||||
{
|
{
|
||||||
let $h:= hnd:get-handler($parse,$diags)($parse,$diags)
|
let $_:=trace(($parse,$diags),"diags")
|
||||||
return if($h?skipchildren)
|
let $h:= hnd:get-handler($parse,$diags)
|
||||||
then $h?result
|
let $walk:=$h($parse,$diags)
|
||||||
|
return if($walk?skipchildren)
|
||||||
|
then $walk?result
|
||||||
else fold-left($parse/*,$diags,
|
else fold-left($parse/*,$diags,
|
||||||
fn($r,$this){
|
fn($r,$this){
|
||||||
hnd:diags($this,$r)
|
hnd:diags($this,$r)
|
||||||
|
|
|
@ -53,13 +53,14 @@ as map(*)?
|
||||||
{
|
{
|
||||||
let $uri:=$json?params?textDocument?uri
|
let $uri:=$json?params?textDocument?uri
|
||||||
let $text:=docs:get(ws:id(), $uri, "textDocument")?text
|
let $text:=docs:get(ws:id(), $uri, "textDocument")?text
|
||||||
let $fmt:="formatted to do"
|
let $fmt:=`(: formatting to do :)
|
||||||
|
`
|
||||||
return map{
|
return map{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"id": $json?id,
|
"id": $json?id,
|
||||||
"result":[{
|
"result":[{
|
||||||
"range":pos:full-range($text),
|
"range":pos:full-range($text),
|
||||||
"newText": $fmt
|
"newText": $fmt || $text
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue