diff --git a/README.md b/README.md index f3787af..cdde9cf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ Work in progress. An attempt to write a [Language Server Protocol](https://en.wikipedia.org/wiki/Language_Server_Protocol) server for and in XQuery 4.0. It tracks the draft specifications at https://qt4cg.org/ -It written for BaseX 12.0 and uses the [BaseX websocket](https://docs.basex.org/main/WebSockets) feature. +It written for BaseX 12.0 and uses the [BaseX websocket](https://docs.basex.org/main/WebSockets) feature. See [The WebSocket Protocol +RFC 6455](https://www.rfc-editor.org/rfc/rfc6455.html) # Demo The demos expect `Docker` or `Podman` on the local machine. This is only a requirement for the demos. diff --git a/webapp/lsp/set.xqm b/webapp/lsp/set.xqm index c27d4eb..79748b2 100644 --- a/webapp/lsp/set.xqm +++ b/webapp/lsp/set.xqm @@ -36,7 +36,7 @@ module namespace set = "http://qt4cg.org/atomic-set"; except as fn($set as set:atomic-set, $value as set:atomic-set) as set:atomic-set, * ); - declare %private variable DATA := "'_data'"; + declare %private variable $DATA := "'_data'"; (: The private function set:replaceData processes the internal map diff --git a/webapp/static/clients/codemirror/script.js b/webapp/static/clients/codemirror/script.js index 1299d40..efaf2b7 100644 --- a/webapp/static/clients/codemirror/script.js +++ b/webapp/static/clients/codemirror/script.js @@ -85,7 +85,14 @@ $("symList").addEventListener("itemSelected", e => { console.log("SYM selection range", sel); const an = plugin.fromPosition(sel.start) const hd = plugin.fromPosition(sel.end) - view.dispatch({ selection: { anchor: an, head: hd }, scrollIntoView: true }); + //view.dispatch({ selection: { anchor: an, head: hd }, scrollIntoView: true }); + + view.dispatch({ + selection: { anchor: an, head: hd }, + scrollIntoView: true , + effects: [lsp.EditorView.scrollIntoView(an,{y:"center"})] + }); + }); $("lint").onclick = async e => {