vscode: Create highlight function again and pass it to the LSP

This stops a panic then triggering a highlight to happen.
This commit is contained in:
Tobias Hunger 2023-10-18 12:32:09 +02:00 committed by Tobias Hunger
parent f6f369251b
commit f12b3d2df4

View file

@ -23,6 +23,13 @@ slint_init(slint_wasm_data).then((_) => {
return true;
}
function highlight(path: string, offset: number) {
connection.sendRequest("slint/preview_message", {
command: "highlight",
data: { path: path, offset: offset },
});
}
async function send_request(method: string, params: any): Promise<unknown> {
return await connection.sendRequest(method, params);
}
@ -37,6 +44,7 @@ slint_init(slint_wasm_data).then((_) => {
send_notification,
send_request,
load_file,
highlight,
);
return the_lsp.server_initialize_result(params.capabilities);
});