[add] format keymap

This commit is contained in:
Andy Bunce 2025-08-29 15:27:18 +01:00
parent 3833219e99
commit 83c80a4b8f
6 changed files with 30 additions and 16 deletions

View file

@ -15,8 +15,8 @@
<body>
<nav class="navbar bg-body-tertiary">
<div class="container-fluid">
<a id="help" class="navbar-brand" >XQuery 4.0 LSP client
<button popovertarget="popHelp"><i class="bi bi-info-circle"></i></button></a>
<a id="help" class="navbar-brand">XQuery 4.0 LSP client
<button popovertarget="popHelp"><i class="bi bi-info-circle"></i></button></a>
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Editor</a>
@ -86,14 +86,23 @@
<label for="symbols">Symbols:</label><select id="symbols" disabled="disabled"></select>
</div>
<div class="btn-group btn-group-sm " role="group" aria-label="Second group">
<button id="search" type="button" class="btn btn-light"><i class="bi bi-search"></i></button>
<button id="lint" type="button" class="btn btn-light"><i class="bi bi-info-square"></i></button>
<button id="sync" type="button" class="btn btn-light">
<button id="search" title="Search" type="button" class="btn btn-light"><i
class="bi bi-search"></i></button>
<button id="lint" title="Diagnostics" type="button" class="btn btn-light"><i
class="bi bi-info-square"></i></button>
<button id="sync" title="Sync changes to server" type="button" class="btn btn-light">
<i class="bi bi-arrow-repeat"></i>
</button>
</div>
<div class="btn-group" role="group" aria-label="Third group">
<button id="format" type="button" class="btn btn-light" title="Format"><i
<button id="syntax" type="button" class="btn btn-light" title="Syntax"><i
class="bi bi-chat"></i></button>
<button id="format" type="button" class="btn btn-light" title="Format (Shift-Alt-f)"><i
class="bi bi-justify-left"></i></button>
<button type="button" class="btn btn-light" popovertarget="popSettings" title="Settings">
@ -112,7 +121,7 @@
</header>
<div class="modal-body">
<div id="state">🔴</div>
<input id="iServer" type="text" style="width:25em" />
<input id="iServer" type="text" style="width:25em" />
</div>
<div class="modal-footer">
<button id="connect">connect</button>

View file

@ -30109,6 +30109,8 @@ ${text}</tr>
exports.baseExts = baseExts;
exports.debouncedChangeListener = debouncedChangeListener;
exports.formatDocument = formatDocument;
exports.formatKeymap = formatKeymap;
exports.keymap = keymap;
exports.languageServerExtensions = languageServerExtensions;
exports.languageServerSupport = languageServerSupport;
exports.linter = linter;

File diff suppressed because one or more lines are too long

View file

@ -91,7 +91,8 @@ function connect() {
view.dispatch({
effects: lsp.StateEffect.appendConfig.of(
[lsp.linter(null, { autoPanel: true }), ...extLsp, up])
[lsp.linter(null, { autoPanel: true }), ...extLsp, up,
lsp.keymap.of([...lsp.formatKeymap])])
})
})
.catch(r => { connectStatus(false); alert("connection failed: " + server) });