slint/editors/vscode/src/lsp_commands.ts
Nigel Breslaw 2bee820ccf
Start to enable default javscript/typescript lint rules
This enables the recommended rules useConst and useImportType
2024-09-12 16:08:52 +02:00

26 lines
862 B
TypeScript

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
import type { URI as LspURI } from "vscode-languageserver-types";
import * as vscode from "vscode";
// Use the auto-registered VSCode command for the custom executables offered
// by our language server.
//
// Talking to the server directly like this:
//
// ```typescript
// return await client.sendRequest(ExecuteCommandRequest.type, {
// command: "slint/showPreview",
// arguments: [url, component],
// } as ExecuteCommandParams);
// ```
//
// has the side effect of going around our middleware.
export async function showPreview(
url: LspURI,
component: string,
): Promise<unknown> {
return vscode.commands.executeCommand("slint/showPreview", url, component);
}