This commit is contained in:
Andy Bunce 2025-09-13 12:44:22 +01:00
parent 47b49c36f4
commit 9dadee8b84
3 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
data/ data/
node_modules/ node_modules/
webapp/static/clients/beercss-3.12.3/

View file

@ -2,6 +2,7 @@ xquery version '4.0';
(:~ Symbols from XQuery source file :) (:~ Symbols from XQuery source file :)
module namespace syms="lsp/symbols"; module namespace syms="lsp/symbols";
import module namespace pos="lsp/position" at "position.xqm"; import module namespace pos="lsp/position" at "position.xqm";
declare type syms:SymbolKind as xs:integer; declare type syms:SymbolKind as xs:integer;
declare type syms:SymbolTag as xs:string; declare type syms:SymbolTag as xs:string;
@ -35,24 +36,23 @@ declare variable $syms:SymbolKindMap :={
}; };
declare record syms:DocumentSymbol( declare record syms:DocumentSymbol(
(: The name of this symbol. Will be displayed in the user interface and (: The name of this symbol. Will be displayed in the user interface and
therefore must not be an empty string or a string only consisting of white spaces. therefore must not be an empty string or a string only consisting of white spaces. :)
:)
name as xs:string, name as xs:string,
(: The kind of this symbol. :) (: The kind of this symbol. :)
kind as syms:SymbolKind, kind as syms:SymbolKind,
(: (: The range enclosing this symbol not including leading/trailing whitespace
* The range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to
* but everything else like comments. This information is typically used to determine if the clients cursor is inside the symbol to reveal it in the UI. :)
* determine if the clients cursor is inside the symbol to reveal it in the
* UI. :)
range as pos:Range, range as pos:Range,
(:The range that should be selected and revealed when this symbol is being (:The range that should be selected and revealed when this symbol is being
* picked, e.g. the name of a function. Must be contained by the `range`. :) picked, e.g. the name of a function. Must be contained by the `range`. :)
selectionRange as pos:Range, selectionRange as pos:Range,
(: More detail for this symbol, e.g the signature of a function.:) (: More detail for this symbol, e.g the signature of a function.:)
detail? as xs:string, detail? as xs:string,

View file

@ -100,5 +100,5 @@ as xs:string{
(:~ full range for $text :) (:~ full range for $text :)
declare function pos:full-range($text as xs:string) declare function pos:full-range($text as xs:string)
as pos:Range{ as pos:Range{
pos:Range(pos:toPosition($text,0), pos:toPosition($text, string-length($text)-1)) pos:Range(pos:toPosition($text,0), pos:toPosition($text, string-length($text)))
}; };