mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
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:
parent
f6f369251b
commit
f12b3d2df4
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue