mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
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:
parent
49d0c96a9e
commit
1639274486
8 changed files with 37 additions and 41 deletions
26
editors/vscode/src/lsp_commands.ts
Normal file
26
editors/vscode/src/lsp_commands.ts
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue