diff --git a/test/ast.xq b/test/ast.xq
new file mode 100644
index 0000000..575520b
--- /dev/null
+++ b/test/ast.xq
@@ -0,0 +1,10 @@
+import module namespace syms="lsp/symbols" at "../webapp/lsp/ast/ast.xqm";
+
+declare $file:="C:\Users\mrwhe\git\quodatum\basex-lsp\test\sample.docs\pdfbox.xqm";
+
+declare variable $A:=doc("C:\Users\mrwhe\git\quodatum\basex-lsp\test\sample.docs\parse-pdfbox.xml");
+$A update{
+ for $e in .//element()
+ let $len:=string-length($e)
+ return insert node attribute len { $len } into $e
+}
diff --git a/webapp/lsp/ast/ast.xqm b/webapp/lsp/ast/ast.xqm
index 51ac864..b731136 100644
--- a/webapp/lsp/ast/ast.xqm
+++ b/webapp/lsp/ast/ast.xqm
@@ -34,10 +34,11 @@ declare function ast:flatten($input as element()) as element() {
(:-------------------------------------------:)
declare function ast:report($el as element(*)) {
-
- {count($el//element())}
- {ast:max-node-depth($el)}
-
+{
+ "total-elements": count($el//element()),
+ "max-depth": ast:max-node-depth($el),
+ "char-count": string-length($el)
+}
};
declare function ast:max-depth($nodes as node()*) as xs:integer {
diff --git a/webapp/static/clients/codemirror/grail.html b/webapp/static/clients/codemirror/grail.html
index d24d46e..9b74b73 100644
--- a/webapp/static/clients/codemirror/grail.html
+++ b/webapp/static/clients/codemirror/grail.html
@@ -165,11 +165,16 @@
- Show canvas
- Show grid
- Show source
+ Follow cursor
+
- Preferences…
+
+ sort by: position
+ sort by: name
+ sort by: category
+
+
+