[mod] surface client

This commit is contained in:
Andy Bunce 2025-08-07 16:21:29 +01:00
parent 5f094cdd95
commit 5c859d014f
9 changed files with 37 additions and 19 deletions

View file

@ -51,3 +51,21 @@ return (
)
};
(:~ close a file :)
declare function docs:close($socket as xs:string,$uri as xs:string)
as map(*){
let $files:=ws:get($socket,"files",{})
return if(map:contains($files,$uri))
then let $props:=$files($uri)
return (
map:items($props)!ws:delete($socket,.),
ws:set($socket,"files",map:remove($files,$uri))
)
else ()
};
(:~ list a file :)
declare function docs:list($socket as xs:string)
as xs:string*{
ws:get($socket,"files",{})=>map:keys()
};

View file

@ -14,7 +14,7 @@
"selectionRangeProvider": true,
"documentLinkProvider": {},
"serverInfo": {
"name": "BaseX Language Server",
"name": "XQuery 4.0 Language Server",
"version": "0.0.1"
}
}

View file

@ -64,7 +64,7 @@ as empty-sequence()
return ()
};
(:~ didOpen method response :)
(:~ didChange method response :)
declare
function lsp-text:didChange($json as map(*))
as map(*)?