slintpad/vscode: Get rid of the shared files

Theyre are no more shared files, so move the files
into vscode and set up a syntax check over there.

That was not possible before as the typescript
compiler would error out on the shared files being
outside its root directory.
This commit is contained in:
Tobias Hunger 2024-08-09 11:09:26 +00:00
parent 49d0c96a9e
commit 1639274486
8 changed files with 37 additions and 41 deletions

View file

@ -0,0 +1,26 @@
// 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 { 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);
}