[fix] diags

This commit is contained in:
Andy Bunce 2025-08-19 17:18:14 +01:00
parent 6829f17673
commit 9c805c2a21
3 changed files with 7 additions and 9 deletions

View file

@ -31387,10 +31387,7 @@ ${text}</tr>
});
});
}function client(transport){
return new LSPClient().connect(transport)
}
const baseExts = [
lineNumbers(),
highlightActiveLineGutter(),
@ -31447,7 +31444,6 @@ ${text}</tr>
exports.LSPClient = LSPClient;
exports.LSPPlugin = LSPPlugin;
exports.baseExts = baseExts;
exports.client = client;
exports.createEditorState = createEditorState;
exports.createEditorView = createEditorView;
exports.languageServerSupport = languageServerSupport;

File diff suppressed because one or more lines are too long

View file

@ -13,6 +13,7 @@ window.addEventListener('load', () => {
const view = lsp.createEditorView(undefined, document.getElementById("editor"));
let doc = `3+1`;
var client;
var extLint;
// Save content to localStorage when the page is about to unload
@ -68,9 +69,10 @@ function connect() {
.then(transport => {
transport.subscribe(incoming);
client = new lsp.LSPClient().connect(transport);
let plugin=lsp.languageServerSupport(client,file,"xquery")
let extLsp=lsp.languageServerSupport(client,file,"xquery");
extLint=lsp.linter(null,{autoPanel:true});
const doc = view.state.doc.toString();
const state = lsp.createEditorState(doc, [...lsp.baseExts, plugin]);
const state = lsp.createEditorState(doc, [...lsp.baseExts, extLsp,extLint]);
view.setState(state);
})
.catch(r => alert("connection failed: "+ server));
@ -99,6 +101,7 @@ function log(rpc){
const ol=document.getElementById("msg");
ol.insertBefore(li,ol.firstChild)
};
function diags(params){
console.log("--",params)
let plugin= lsp.LSPPlugin.get(view);
@ -127,6 +130,5 @@ function diags(params){
}
return 0;
});
view.dispatch(lsp.setDiagnostics(view.state, diagnostics));
view.dispatch(lsp.setDiagnostics(view.state, diagnostics));
};