[mod] tidy
This commit is contained in:
parent
28b4799ee0
commit
eaebbd12aa
10 changed files with 19 additions and 89 deletions
|
|
@ -13,7 +13,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"hoverProvider": {},
|
||||
"hoverProvider": true,
|
||||
"documentSymbolProvider": false,
|
||||
"documentRangeFormattingProvider": false,
|
||||
"colorProvider": false,
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ declare
|
|||
function rpc:method-initialize($json as map(*))
|
||||
as map(*)
|
||||
{
|
||||
ws:set(ws:id(),"client", $json?params),
|
||||
rpc:result($json,
|
||||
json:doc("etc/capabilities.json",{"format":"w3"}))
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,9 +24,14 @@ declare
|
|||
function lsp-text:hover($json as map(*))
|
||||
as map(*)
|
||||
{
|
||||
let $pos:=$json?params?position
|
||||
let $uri:= $json?params?textDocument?uri
|
||||
let $word:="TODO"
|
||||
let $r:= [
|
||||
`At { pos:ln-col($json?params?position) }, uri: {$json?params?textDocument?uri},
|
||||
[path](https://quodatum.github.io/basex-xqparse/i-BaseX.xhtml#EQName)`
|
||||
`At { pos:ln-col($pos) }, uri: {$uri},
|
||||
[path](https://quodatum.github.io/basex-xqparse/i-BaseX.xhtml#EQName)
|
||||
|
||||
WordAt: {$word}`
|
||||
]
|
||||
return rpc:result($json,{"contents":$r})
|
||||
};
|
||||
|
|
@ -39,9 +44,11 @@ as map(*)?
|
|||
let $uri:=$json?params?textDocument?uri
|
||||
let $text:=docs:get(ws:id(), $uri, "textDocument")?text
|
||||
let $fr:=pos:full-range($text)
|
||||
(: dummy data :)
|
||||
let $nameRange:=$fr
|
||||
let $result:=map:for-each($lspt:SymbolKindMap,
|
||||
fn($k,$v){
|
||||
lspt:DocumentSymbol($k,$v,$fr,$fr,"todo")
|
||||
lspt:DocumentSymbol($k,$v,$fr,$nameRange,"todo description")
|
||||
})=>array:build()
|
||||
return rpc:result($json,$result)=>trace("SSS")
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function lsp-ws:message(
|
|||
$message as xs:string
|
||||
) as empty-sequence() {
|
||||
|
||||
let $json := rpc:parse($message=>trace("MSG "))
|
||||
let $json := rpc:parse($message)
|
||||
return if(exists($json))
|
||||
then rpc:reply($json)
|
||||
else message($message,"bad RPC: ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue