[mod] symbols vs dummy
This commit is contained in:
parent
5409755b71
commit
732a1c98e3
5 changed files with 152 additions and 143 deletions
|
|
@ -1,7 +1,9 @@
|
|||
module namespace comp = 'lsp-completions';
|
||||
import module namespace lspt = 'lsp-typedefs' at "../lsp-typedefs.xqm";
|
||||
|
||||
(: (:{"triggerCharacter":":","triggerKind":2.0e0}:):)
|
||||
declare function comp:list($context as map(*)){
|
||||
declare function comp:list($context as map(*))
|
||||
as lspt:CompletionItem*{
|
||||
message($context,"context: "),
|
||||
()
|
||||
(1 to 5)!lspt:CompletionItem("item"+.,.)
|
||||
};
|
||||
|
|
@ -3,8 +3,9 @@ xquery version '4.0';
|
|||
module namespace syms="lsp/symbols";
|
||||
import module namespace hnd="lsp/handlers" at "../handlers.xqm";
|
||||
import module namespace lspt = 'lsp-typedefs' at "../lsp-typedefs.xqm";
|
||||
import module namespace pos="lsp/position" at "../position.xqm";
|
||||
|
||||
declare function syms:list($parse as element(),$syms as lspt:DocumentSymbol* :=() )
|
||||
declare function syms:list($parse as element(),$text as xs:string)
|
||||
as lspt:DocumentSymbol*{
|
||||
let $actions as hnd:actionMap :={
|
||||
"ContextValueDecl": syms:action#2,
|
||||
|
|
@ -18,6 +19,17 @@ as lspt:DocumentSymbol*{
|
|||
return $result?result
|
||||
};
|
||||
|
||||
declare function syms:dummy($parse as element(),$text as xs:string )
|
||||
as lspt:DocumentSymbol*{
|
||||
let $fr:=(pos:full-range($text),message("dummy"))
|
||||
(: dummy data :)
|
||||
let $nameRange:=$fr
|
||||
return map:for-each($lspt:SymbolKindMap,
|
||||
fn($k,$v){
|
||||
lspt:DocumentSymbol($k,$v,$fr,$nameRange,`{$k} v:{$v}`)
|
||||
})
|
||||
};
|
||||
|
||||
(:~ just trace :)
|
||||
declare function syms:action($parse as element(),$state as hnd:Result )
|
||||
as hnd:Result{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue