[mod] idle detect
This commit is contained in:
parent
e32e3437a1
commit
1787a8e31f
7 changed files with 2016 additions and 1964 deletions
|
|
@ -57,8 +57,8 @@ declare function pos:toPosition($text as xs:string,
|
|||
$index as pos:num
|
||||
)
|
||||
as pos:Position {
|
||||
let $nl:= if($index=>trace("IN ") ge string-length($text)=>trace("L "))
|
||||
then error(xs:QName("pos:range"),"out of range")
|
||||
let $nl:= if($index=>trace("IN ") gt string-length($text)=>trace("L "))
|
||||
then error(xs:QName("pos:range"),`out of range: index={$index},length={string-length($text)}`)
|
||||
else index-of(string-to-codepoints($text),10)
|
||||
let $line:=pos:lineAt($nl,$index)
|
||||
let $off:=if($line eq 0)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<option value="xml">xml</option>
|
||||
</select>
|
||||
<label for="file">File:</label>
|
||||
<input id="iFile" type="url" value="file:///some/file.xml" />
|
||||
<input id="iFile" type="url" value="file:///some/file.xqm" />
|
||||
|
||||
|
||||
<!-- <div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -71,11 +71,16 @@ function connect() {
|
|||
$("mypopover").hidePopover();
|
||||
connectStatus(true);
|
||||
let extLsp = lsp.languageServerSupport(client, file, "xquery");
|
||||
extLint = lsp.linter(
|
||||
view => { client.sync(); return []; },
|
||||
{ autoPanel: true });
|
||||
extLint = lsp.linter(null,{ autoPanel: true });
|
||||
const doc = view.state.doc.toString();
|
||||
const state = lsp.createEditorState(doc, [...lsp.baseExts, extLsp, extLint]);
|
||||
const state = lsp.createEditorState(doc, [...lsp.baseExts, extLsp, extLint,
|
||||
lsp.debouncedChangeListener({
|
||||
delay: 5000,
|
||||
onChange: (content, state) => {
|
||||
console.log('Debounced change detected:'+content);
|
||||
client.sync();
|
||||
}})
|
||||
]);
|
||||
view.setState(state);
|
||||
})
|
||||
.catch(r => { connectStatus(false); alert("connection failed: " + server) });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue