[mod] css
This commit is contained in:
parent
24c1ae3c5a
commit
53d78573b1
4 changed files with 61 additions and 27 deletions
|
|
@ -17,7 +17,12 @@ function lsp-ws:error($error) {
|
||||||
declare
|
declare
|
||||||
%ws:connect('/lsp')
|
%ws:connect('/lsp')
|
||||||
function lsp-ws:connect() as empty-sequence() {
|
function lsp-ws:connect() as empty-sequence() {
|
||||||
let $id:=(ws:id(),rpc:admin-log("CONNECT","🌹"))
|
let $id:=(ws:id(),
|
||||||
|
rpc:admin-log("CoNNECT","🌹"),
|
||||||
|
rpc:admin-log(request:header-map(),"🌹")
|
||||||
|
)
|
||||||
|
let $props:=("host","http-version","is-secure","origin","protocol-version","query-string","request-uri","sub-protocols")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
ws:set($id, "id", $id),
|
ws:set($id, "id", $id),
|
||||||
ws:set($id, "connectTime", current-dateTime()),
|
ws:set($id, "connectTime", current-dateTime()),
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,15 @@ import module namespace pos="lsp/position" at "../position.xqm";
|
||||||
declare type lsp-diags:ParseResult as element(Module|ERROR);
|
declare type lsp-diags:ParseResult as element(Module|ERROR);
|
||||||
|
|
||||||
declare variable $lsp-diags:actions as hnd:actionMap :={
|
declare variable $lsp-diags:actions as hnd:actionMap :={
|
||||||
"Module": lsp-diags:Module#2
|
"Module": lsp-diags:Module#2,
|
||||||
|
"ModuleDecl": lsp-diags:ModuleDecl#2
|
||||||
};
|
};
|
||||||
|
|
||||||
declare function lsp-diags:list(
|
declare function lsp-diags:list(
|
||||||
$uri as xs:string,
|
$uri as xs:string,
|
||||||
$text as xs:string,
|
$text as xs:string,
|
||||||
$xml as lsp-diags:ParseResult)
|
$xml as lsp-diags:ParseResult)
|
||||||
as map(*)*{
|
as lspt:Diagnostic*{
|
||||||
if($xml/self::ERROR)
|
if($xml/self::ERROR)
|
||||||
then lsp-diags:parse-error($text, $xml)
|
then lsp-diags:parse-error($text, $xml)
|
||||||
else lsp-diags:parse-xquery($text,$xml)
|
else lsp-diags:parse-xquery($text,$xml)
|
||||||
|
|
@ -63,9 +64,9 @@ as lspt:Diagnostic*
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
(: test data :)
|
(: walk in tree :)
|
||||||
declare function lsp-diags:parse-xquery($text as xs:string, $parse as element(Module))
|
declare function lsp-diags:parse-xquery($text as xs:string, $parse as element(Module))
|
||||||
as map(*)*{
|
as lspt:Diagnostic*{
|
||||||
let $state:= hnd:State((),false(),{"text":$text})
|
let $state:= hnd:State((),false(),{"text":$text})
|
||||||
let $state:= hnd:walk($parse,$lsp-diags:actions,$state)
|
let $state:= hnd:walk($parse,$lsp-diags:actions,$state)
|
||||||
return $state?result
|
return $state?result
|
||||||
|
|
@ -73,7 +74,7 @@ as map(*)*{
|
||||||
|
|
||||||
declare function lsp-diags:Module($parse as element(Module),$state as hnd:State )
|
declare function lsp-diags:Module($parse as element(Module),$state as hnd:State )
|
||||||
as hnd:State{
|
as hnd:State{
|
||||||
let $new:=if(exists($parse/VersionDecl)=>trace("has ver: "))
|
let $new:=if(exists($parse/VersionDecl))
|
||||||
then ()
|
then ()
|
||||||
else let $text:=$state?extras?text
|
else let $text:=$state?extras?text
|
||||||
|
|
||||||
|
|
@ -91,4 +92,15 @@ as hnd:State{
|
||||||
|
|
||||||
,message(name($parse),"Module: ")
|
,message(name($parse),"Module: ")
|
||||||
)
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
declare function lsp-diags:ModuleDecl($parse as element(ModuleDecl),$state as hnd:State )
|
||||||
|
as hnd:State{
|
||||||
|
(: ModuleDecl ::= 'module' 'namespace' NCName '=' URILiteral ';':)
|
||||||
|
let $mod:=$parse/NCName/string()=>trace("pre")
|
||||||
|
let $extras:=$state?extras=>map:put("mod",$mod)
|
||||||
|
return $state
|
||||||
|
=>map:put("extras",$extras)
|
||||||
|
=>map:put("skipchildren",true())
|
||||||
};
|
};
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
--quiet-primary-seed: #e98d61;
|
--quiet-primary-seed: #e98d61;
|
||||||
--quiet-content-spacing: 0.75rem;
|
--quiet-content-spacing: 0.75rem;
|
||||||
--quiet-form-control-height-md:0.9rem;
|
--quiet-form-control-height-md:0.9rem;
|
||||||
|
--quiet-focus-width: 2px;
|
||||||
|
--quiet-focus-offset: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,20 +24,26 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="page-wrap">
|
<div class="page-wrap">
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<quiet-button-group>
|
<quiet-dropdown placement="right">
|
||||||
<quiet-button id="bnNew" title="New file">
|
<quiet-button slot="trigger">File
|
||||||
<quiet-icon slot="start" name="file"></quiet-icon>New
|
<quiet-icon slot="end" name="chevron-right"></quiet-icon>
|
||||||
</quiet-button>
|
</quiet-button>
|
||||||
|
<quiet-dropdown-item id="bnNew">
|
||||||
|
<quiet-icon slot="start" name="file"></quiet-icon>New...
|
||||||
|
<div slot="details">create a new doc</div>
|
||||||
|
</quiet-dropdown-item>
|
||||||
|
|
||||||
<quiet-button id="bnRead" title="Open local file">
|
<quiet-dropdown-item id="bnRead">
|
||||||
<quiet-icon slot="start" name="folder-open"></quiet-icon>Open
|
<quiet-icon slot="start" name="folder-open"></quiet-icon>Open...
|
||||||
</quiet-button>
|
<div slot="details">select a local file</div>
|
||||||
|
</quiet-dropdown-item>
|
||||||
<input type="file" id="fileElem" multiple accept="*/*" style="display: none;" />
|
<input type="file" id="fileElem" multiple accept="*/*" style="display: none;" />
|
||||||
|
|
||||||
<quiet-button id="popover__url" title="Open web file">
|
<quiet-dropdown-item id="popover__url">
|
||||||
<quiet-icon slot="start" name="link"></quiet-icon>Web
|
<quiet-icon slot="start" name="link"></quiet-icon>Url...
|
||||||
</quiet-button>
|
<div slot="details">Fetch from a url</div>
|
||||||
</quiet-button-group>
|
</quiet-dropdown-item>
|
||||||
|
</quiet-dropdown>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span class="quiet-h4">XQuery 4.0 LSP client</span>
|
<span class="quiet-h4">XQuery 4.0 LSP client</span>
|
||||||
|
|
@ -52,7 +58,7 @@
|
||||||
|
|
||||||
<quiet-button-group>
|
<quiet-button-group>
|
||||||
<quiet-dropdown>
|
<quiet-dropdown>
|
||||||
<quiet-button slot="trigger" with-caret>Links</quiet-button>
|
<quiet-button slot="trigger" with-caret>Dev tools</quiet-button>
|
||||||
<quiet-dropdown-item href="/app/home" target="lsp" rel="noreferrer noopener">
|
<quiet-dropdown-item href="/app/home" target="lsp" rel="noreferrer noopener">
|
||||||
LSP Manager <quiet-icon name="external-link" slot="icon"></quiet-icon></quiet-dropdown-item>
|
LSP Manager <quiet-icon name="external-link" slot="icon"></quiet-icon></quiet-dropdown-item>
|
||||||
<quiet-dropdown-item href="/dba/logs" target="dba" rel="noreferrer noopener">
|
<quiet-dropdown-item href="/dba/logs" target="dba" rel="noreferrer noopener">
|
||||||
|
|
@ -67,16 +73,20 @@
|
||||||
|
|
||||||
|
|
||||||
<main id="main" class="page-main" style="overflow: auto;">
|
<main id="main" class="page-main" style="overflow: auto;">
|
||||||
<quiet-toolbar>
|
<quiet-toolbar style="padding:2px;">
|
||||||
|
|
||||||
<quiet-button-group>
|
<quiet-button-group style="background-color: var(--quiet-neutral-fill-softer);">
|
||||||
<button id="search" title="Search" type="button"><i class="codicon codicon-search"></i></button>
|
<quiet-button id="search" title="Search" icon-label="search" size="xs">
|
||||||
|
<quiet-icon name="search"></quiet-icon>
|
||||||
|
</quiet-button>
|
||||||
|
|
||||||
<button id="lint" title="Display diagnostics" type="button"><i
|
<quiet-button id="lint" title="Display diagnostics" icon-label="diagnostics" size="xs">
|
||||||
class="codicon codicon-report"></i></button>
|
<quiet-icon name="message-report"></quiet-icon>
|
||||||
|
</quiet-button>
|
||||||
|
|
||||||
<button id="symbols2" type="button" title="symbols">
|
<quiet-button id="symbols2" title="symbols" icon-label="Symbols" size="xs">
|
||||||
<i class="codicon codicon-symbol-misc"></i></button>
|
<quiet-icon name="icons"></quiet-icon>
|
||||||
|
</quiet-button>
|
||||||
|
|
||||||
<button id="format" type="button" title="Format (Shift-Alt-f)"><i
|
<button id="format" type="button" title="Format (Shift-Alt-f)"><i
|
||||||
class="codicon codicon-list-flat"></i></button>
|
class="codicon codicon-list-flat"></i></button>
|
||||||
|
|
@ -180,7 +190,14 @@
|
||||||
|
|
||||||
<!-- dialogs -->
|
<!-- dialogs -->
|
||||||
<quiet-popover id="popWeb" for="popover__url">
|
<quiet-popover id="popWeb" for="popover__url">
|
||||||
<form id="popUrl" style="background: #ffecb3;">
|
<div style="display:flex;background: #ffecb3;">
|
||||||
|
<div style="flex: 1 1 auto;">Load a document from the web</div>
|
||||||
|
<quiet-button icon-label="Close" appearance="text" data-popover="close">
|
||||||
|
<quiet-icon name="x"></quiet-icon>
|
||||||
|
</quiet-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="popUrl">
|
||||||
<quiet-text-field type="url" name="url" label="URL to fetch" placeholder="http://..." with-clear required
|
<quiet-text-field type="url" name="url" label="URL to fetch" placeholder="http://..." with-clear required
|
||||||
style="width: 20em;">
|
style="width: 20em;">
|
||||||
<datalist>
|
<datalist>
|
||||||
|
|
@ -199,8 +216,6 @@
|
||||||
</datalist>
|
</datalist>
|
||||||
</quiet-text-field>
|
</quiet-text-field>
|
||||||
<quiet-button type="submit" variant="primary">Fetch</quiet-button>
|
<quiet-button type="submit" variant="primary">Fetch</quiet-button>
|
||||||
<quiet-button data-popover="close" variant="neutral">Cancel</quiet-button>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</quiet-popover>
|
</quiet-popover>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue