[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";
|
||||
let $t:=fetch:text("https://raw.githubusercontent.com/dnovatchev/Articles/refs/heads/main/Generators/Code/generator.xq")=>lazy:cache()
|
||||
return p:parse-Module($t)
|
||||
declare variable $generator.xpath :="https://raw.githubusercontent.com/dnovatchev/Articles/refs/heads/main/Generators/Code/generator.xq";
|
||||
|
||||
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
|
||||
environment:
|
||||
- "BASEX_JVM= -Dorg.basex.RESTXQERRORS=false "
|
||||
- "SERVER_OPTS= "
|
||||
|
||||
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:=())
|
||||
{
|
||||
let $h:= hnd:get-handler($parse,$diags)($parse,$diags)
|
||||
return if($h?skipchildren)
|
||||
then $h?result
|
||||
let $_:=trace(($parse,$diags),"diags")
|
||||
let $h:= hnd:get-handler($parse,$diags)
|
||||
let $walk:=$h($parse,$diags)
|
||||
return if($walk?skipchildren)
|
||||
then $walk?result
|
||||
else fold-left($parse/*,$diags,
|
||||
fn($r,$this){
|
||||
hnd:diags($this,$r)
|
||||
|
|
|
@ -53,13 +53,14 @@ as map(*)?
|
|||
{
|
||||
let $uri:=$json?params?textDocument?uri
|
||||
let $text:=docs:get(ws:id(), $uri, "textDocument")?text
|
||||
let $fmt:="formatted to do"
|
||||
let $fmt:=`(: formatting to do :)
|
||||
`
|
||||
return map{
|
||||
"jsonrpc": "2.0",
|
||||
"id": $json?id,
|
||||
"result":[{
|
||||
"range":pos:full-range($text),
|
||||
"newText": $fmt
|
||||
"newText": $fmt || $text
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue