slint/editors/vscode
dependabot[bot] a74cf7ae8e
build(deps): bump @biomejs/biome from 2.0.5 to 2.0.6 (#8810)
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.0.6/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 21:32:18 +03:00
..
.vscode Revert use of pnpm for VS Code extension build, as discussed 2024-08-22 14:32:40 +02:00
snippets vscode: Add a hello world file template (#7089) 2024-12-13 11:25:55 +01:00
src Update to Biome 2.0 (#8730) 2025-06-19 21:38:30 +03:00
static/walkthroughs/welcome refactor: Tidy the vscode project (#5936) 2024-08-26 12:04:49 +02:00
tests/grammar TextMate Grammar: Add support from re-exports 2025-05-19 15:21:37 +02:00
.gitignore Revert use of pnpm for VS Code extension build, as discussed 2024-08-22 14:32:40 +02:00
.vscodeignore Fix VSCE build 2025-02-24 10:00:18 +01:00
biome.json Update to Biome 2.0 (#8730) 2025-06-19 21:38:30 +03:00
esbuild.js Enable more js/tsc biome rules 2024-09-13 10:04:39 +02:00
extension-logo.png Update the VS code extension logo to a variant with a white background 2023-09-13 10:03:16 +02:00
language-configuration.json Replace eslint and prettier with biome.js 2024-08-22 15:29:57 +02:00
package.json build(deps): bump @biomejs/biome from 2.0.5 to 2.0.6 (#8810) 2025-06-30 21:32:18 +03:00
README.md Better dev commands for VScode development (#7951) 2025-03-26 10:46:43 +02:00
slint-file-icon.svg Vscode extension: add Slint icon to .slint file 2024-08-06 22:53:05 +02:00
slint.injection.json vscode: Improve language injection 2024-01-27 00:58:34 +01:00
slint.markdown-injection.json Add support for slint syntax highlighting in markcode code fences 2024-04-26 14:33:32 +02:00
slint.tmLanguage.json TextMate Grammar: Add support from re-exports 2025-05-19 15:21:37 +02:00
telemetry.json Basic live-preview telemetry (#8488) 2025-05-21 11:35:25 +03:00
tsconfig.default.json Fix type check on clean checkout 2024-12-05 13:34:09 +01:00
tsconfig.json slintpad/vscode: Get rid of the shared files 2024-08-12 12:45:59 +02:00

Slint for Visual Studio Code

This extension for VS Code adds support for the Slint design markup language.

Features

  • Syntax highlighting
  • Diagnostics from .slint files
  • Live Preview of a .slint file
  • Completion of properties
  • Jump to definition (currently, only definition of Component)

Installation

You can install the extension directly from the Visual Studio Code Marketplace. Afterwards it is automatically activated when editing files with the .slint extension.

Live-Preview

In addition to the usual code editing features such as completion and syntax highlighting, this extension also offers the ability to view a rendering of the file you're editing and update it on-the-fly when making changes.

You can issue the "Slint: Show Preview" command from the command palette when editing a .slint file. This will create a new top-level window that renders the file you're editing. Any changes you make are immediately visible, it is not necessary to save the file.

Reporting Issues

Issues should be reported in the Slint issue tracker.

Building from Source and Debugging

You need to install the following components:

The following step will build a local version of the vscode extension and the LSP

cargo install wasm-pack
cargo build --features renderer-skia -p slint-lsp
cd editors/vscode
pnpm install --frozen-lockfile
pnpm build:wasm_lsp
pnpm compile

Later, you only need to do the steps for the part you change like cargo build -p slint-lsp to rebuild the lsp binary or pnpm compile to rebuild the typescript.

You can run vscode with that extension by running, in the editors/vscode directory:

code --extensionDevelopmentPath=$PWD <path to a slint project that is different to the one already open in vscode>

If you want to load the web extension, add --extensionDevelopmentKind=web

How to build the extension package

To create a .vsix package for local installation:

  1. Follow the setup steps above to build the lsp binary and install npm dependencies.

  2. Create a .vsix package (needs vsce installed)

pnpm local-package
  1. Install the .vsix file with
code --install-extension slint-*.vsix
  1. Reload your VS code windows

Note that the resulting .vsix package contains your locally built debug LSP server. It is not suitable for distribution.

Rules for PRs

The code is typechecked with tsc and linted/formatted with Biome. If using VS Code then install the biome extension. To ensure your PR does not fail check everything with pnpm type-check && pnpm format && pnpm lint. pnpm lint:fix and pnpm format:fix can be used to auto fix lint and code formatting issues.

Preview the Library, Preview, and Property Editor

The built-in live-preview can be used to preview itself. For this to work, VS Code needs to be restarted with an environment variable:

  1. Close all VS Code Windows and terminate the application.
  2. In a terminal Window, re-launch VS Code:
    SLINT_ENABLE_EXPERIMENTAL_FEATURES=1 code
    
  3. Open tools/lsp/ui/main.slint and launch the preview, or preview individual components such as the library or properties view.

Quality Assurance

This extensions comes with some tools to help with QA:

  • pnpm lint and pnpm lint:fix run the biome linter on the source code
  • pnpm type-check run the typescript compiler
  • pnpm test_grammar run the tests on the TextMate grammar build into the extension