mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 07:04:34 +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
|
@ -195,6 +195,7 @@
|
|||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"lint": "eslint src --ext ts",
|
||||
"syntax_check": "tsc --build --force",
|
||||
"test": "node ./out/test/runTest.js",
|
||||
"clean": "shx rm -rf out bin LICENSE.txt slint-*.vsix"
|
||||
},
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
import slint_init, * as slint_lsp from "../out/slint_lsp_wasm.js";
|
||||
import slint_wasm_data from "../out/slint_lsp_wasm_bg.wasm";
|
||||
import { InitializeParams, InitializeResult } from "vscode-languageserver";
|
||||
import {
|
||||
createConnection,
|
||||
|
@ -10,7 +9,7 @@ import {
|
|||
BrowserMessageWriter,
|
||||
} from "vscode-languageserver/browser";
|
||||
|
||||
slint_init(slint_wasm_data).then((_) => {
|
||||
slint_init().then((_) => {
|
||||
const reader = new BrowserMessageReader(self);
|
||||
const writer = new BrowserMessageWriter(self);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import * as vscode from "vscode";
|
||||
|
||||
import * as wasm_preview from "./wasm_preview";
|
||||
import * as lsp_commands from "../../../tools/slintpad/src/shared/lsp_commands";
|
||||
import * as lsp_commands from "./lsp_commands";
|
||||
import * as snippets from "./snippets";
|
||||
|
||||
import {
|
||||
|
|
|
@ -1,17 +1,9 @@
|
|||
// 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 {
|
||||
OptionalVersionedTextDocumentIdentifier,
|
||||
Range as LspRange,
|
||||
URI as LspURI,
|
||||
WorkspaceEdit,
|
||||
} from "vscode-languageserver-types";
|
||||
|
||||
import { URI as LspURI } from "vscode-languageserver-types";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export type WorkspaceEditor = (_we: WorkspaceEdit) => boolean;
|
||||
|
||||
// Use the auto-registered VSCode command for the custom executables offered
|
||||
// by our language server.
|
||||
//
|
||||
|
@ -32,16 +24,3 @@ export async function showPreview(
|
|||
): Promise<unknown> {
|
||||
return vscode.commands.executeCommand("slint/showPreview", url, component);
|
||||
}
|
||||
|
||||
export async function removeBinding(
|
||||
doc: OptionalVersionedTextDocumentIdentifier,
|
||||
element_range: LspRange,
|
||||
property_name: string,
|
||||
): Promise<boolean> {
|
||||
return vscode.commands.executeCommand(
|
||||
"slint/removeBinding",
|
||||
doc,
|
||||
element_range,
|
||||
property_name,
|
||||
);
|
||||
}
|
8
editors/vscode/src/tsconfig.json
Normal file
8
editors/vscode/src/tsconfig.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"extends": "../tsconfig.default.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["es2021", "webworker"],
|
||||
"types": ["vscode"]
|
||||
},
|
||||
"include": ["./*.ts"],
|
||||
}
|
18
editors/vscode/tsconfig.default.json
Normal file
18
editors/vscode/tsconfig.default.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"baseUrl": "./node_modules",
|
||||
"composite": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"lib": ["es2021"],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "./out",
|
||||
"rootDir": ".",
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"target": "es6",
|
||||
"typeRoots": ["./node_modules/@types"]
|
||||
}
|
||||
}
|
|
@ -1,17 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2020",
|
||||
"outDir": "out",
|
||||
"lib": ["es2021", "WebWorker", "dom"],
|
||||
"sourceMap": true,
|
||||
"rootDir": ".",
|
||||
"strict": true /* enable all strict type-checking options */
|
||||
/* Additional Checks */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a
|
||||
// value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in
|
||||
// switch statement. */ "noUnusedParameters": true, /* Report errors on unused parameters.
|
||||
// */
|
||||
},
|
||||
"exclude": ["node_modules", ".vscode-test"]
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "src"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"lib": ["dom", "es2021"],
|
||||
"types": ["vscode"]
|
||||
},
|
||||
"include": ["./*.ts", "./shared/*.ts", "../package.json", "./welcome/*.ts"],
|
||||
"include": ["./*.ts", "../package.json", "./welcome/*.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "worker"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue