slint/tools/lsp
Olivier Goffart c3e32c1665
Don't enable image-default-formats by default, remove compat-1-10 feature
We decided that the compatibility with people having enabled the extra
format in image 0.24 [1] is not worth it compared to the extra compilation
time most people gets by default when they don't need this feature.
(Which is less than 10% slower when the feature is enabled)

Since then there is no need for compat-1-10, remove it

[1] by depending directly on image 0.24 in their Cargo.toml and enabling
the features, which will not work with Slint 1.10 that now use image 0.25
2025-02-22 11:15:18 +01:00
..
common Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
fmt Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
language Menu API changes 2025-02-21 16:03:47 +01:00
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
preview live-preview: Enums in preview data mode 2025-02-21 16:30:47 +01:00
ui [autofix.ci] apply automated fixes 2025-02-21 16:25:05 +01:00
build.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
Cargo.toml Don't enable image-default-formats by default, remove compat-1-10 feature 2025-02-22 11:15:18 +01:00
common.rs lsp: Fix comparision of ElementRcNodes 2025-02-17 18:29:48 +01:00
fmt.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
language.rs Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
main.rs lsp: Do not send status nmessages 2025-02-11 11:29:01 +01:00
preview.rs live-preview: Refactor Api between backend and UI 2025-02-21 10:50:53 +01:00
README.md lsp: Document debian dependencies 2025-01-30 15:22:38 +01:00
util.rs Auto-fixed clippy::unnecessary_map_or 2025-02-07 09:02:31 +01:00
wasm_main.rs lsp: Do not send status nmessages 2025-02-11 11:29:01 +01:00

LSP (Language Server Protocol) Server for Slint

This directory contains the implementation of the LSP server for Slint featuring diagnostics, code completion, goto definition, and more importantly, live-preview

Generic usage

The LSP server consists of a binary, slint-lsp (or slint-lsp.exe on Windows). It provides all the functionality and allows any programming editor that also implements the standardized LSP protocol to communicate with it.

If you have Rust installed, you can install the binary by running the following command:

cargo install slint-lsp

This makes the latest released version available in $HOME/.cargo/bin. If you would like to try a development version, you can also point cargo install to the git repository: for the released version. Or, to install the development version:

cargo install slint-lsp --git https://github.com/slint-ui/slint --force

Alternatively, you can download one of our pre-built binaries for Linux or Windows:

  1. Open https://github.com/slint-ui/slint/releases
  2. Click on the latest release
  3. From "Assets" download either slint-lsp-linux.tar.gz for a Linux x86-64 binary or slint-lsp-windows.zip for a Windows x86-64 binary.
  4. Uncompress the downloaded archive into a location of your choice.

As the next step, configure your editor to use the binary, no arguments are required

Make sure the required dependencies are found. On Debian-like systems install them with the following command:

sudo apt install -y build-essential libx11-xcb1 libx11-dev libxcb1-dev libxkbcommon0 libinput10 libinput-dev libgbm1 libgbm-dev

Code formatting

The slint code formatting tool is part of the lsp. To learn how to use it as a standalone tool, see fmt README

Editor configuration

Please check the editors folder in the Slint repository for instructions on how to set up different editors to work with Slint.