1# Copyright © SixtyFPS GmbH <info@slint.dev>
2# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4[package]
5name = "slint-lsp"
6description = "A language server protocol implementation for Slint"
7authors = ["Slint Developers <info@slint.dev>"]
8edition.workspace = true
9homepage = "https://slint.dev"
10license.workspace = true
11repository.workspace = true
12rust-version.workspace = true
13version = "1.11.0"
14categories = ["gui", "development-tools", "command-line-utilities"]
15keywords = ["lsp", "ui", "toolkit"]
16
17[package.metadata.bundle]
18name = "Slint Live Preview"
19icon = ["../../logo/slint-logo-small-light.png"]
20
21[[bin]]
22name = "slint-lsp"
23path = "main.rs"
24
25[lib]
26# lib is there only for the web
27crate-type = ["cdylib"]
28path = "wasm_main.rs"
29# On windows building this package creates slint-lsp.exe and slint-lsp.dll.
30# To avoid that both end up trying to create slint-lsp.pdb for their debug
31# symbols, rename the lib.
32name = "slint_lsp_wasm"
33
34[features]
35backend-qt = ["slint/backend-qt", "preview"]
36
37backend-winit = ["slint/backend-winit", "preview"]
38backend-winit-x11 = ["slint/backend-winit-x11", "preview"]
39backend-winit-wayland = ["slint/backend-winit-wayland", "preview"]
40backend-linuxkms = ["slint/backend-linuxkms", "preview"]
41backend-linuxkms-noseat = ["slint/backend-linuxkms-noseat", "preview"]
42backend-default = ["slint/backend-default", "preview"]
43
44renderer-femtovg = ["slint/renderer-femtovg", "preview"]
45renderer-skia = ["slint/renderer-skia", "preview"]
46renderer-skia-opengl = ["slint/renderer-skia-opengl", "preview"]
47renderer-skia-vulkan = ["slint/renderer-skia-vulkan", "preview"]
48renderer-software = ["slint/renderer-software", "preview"]
49
50# Compat
51backend-gl-all = ["backend-winit", "renderer-femtovg"]
52backend-gl-wayland = ["backend-winit-wayland", "renderer-femtovg"]
53backend-gl-x11 = ["backend-winit-x11", "renderer-femtovg"]
54eventloop-qt = ["backend-qt"]
55renderer-winit-qt = ["backend-qt"]
56renderer-winit-femtovg = ["renderer-femtovg"]
57renderer-winit-skia = ["renderer-skia"]
58renderer-winit-skia-opengl = ["renderer-skia-opengl"]
59renderer-winit-skia-vulkan = ["renderer-skia-vulkan"]
60renderer-winit-software = ["renderer-software"]
61
62## Enable support for previewing .slint files
63preview = ["preview-builtin", "preview-external", "preview-engine"]
64## [deprecated] Used to enable the "Show Preview" lenses and action on components.
65preview-lense = []
66## [deprecated] Used to enable partial support for external previewers.
67## Use "preview-external" (and maybe "preview-engine" if you want the LSP binary
68## to provide an implementation of the external preview API when building for WASM)
69preview-api = ["preview-external"]
70## Build in the actual code to act as a preview for slint files.
71preview-engine = [
72 "dep:slint",
73 "dep:slint-interpreter",
74 "dep:i-slint-core",
75 "dep:i-slint-backend-selector",
76 "dep:slint-build",
77 "dep:i-slint-backend-winit",
78 "dep:muda",
79 "dep:objc2-foundation",
80]
81## Build in the actual code to act as a preview for slint files. Does nothing in WASM!
82preview-builtin = ["preview-engine"]
83## Support the external preview optionally used by e.g. the VSCode plugin
84preview-external = []
85
86default = ["backend-default", "renderer-femtovg", "renderer-software", "preview"]
87
88[dependencies]
89i-slint-compiler = { workspace = true, features = ["display-diagnostics"] }
90
91by_address = { workspace = true }
92clru = { workspace = true }
93dissimilar = "1.0.7"
94itertools = { workspace = true }
95# Not updated because of https://github.com/gluon-lang/lsp-types/issues/284
96lsp-types = { version = "0.95.0", features = ["proposed"] }
97serde = { workspace = true }
98serde_json = { workspace = true }
99smol_str = { workspace = true }
100
101# for the preview-engine feature
102i-slint-backend-selector = { workspace = true, optional = true }
103i-slint-core = { workspace = true, features = ["std"], optional = true }
104slint = { workspace = true, features = ["compat-1-2"], optional = true }
105slint-interpreter = { workspace = true, features = ["compat-1-2", "internal", "internal-highlight", "internal-json", "image-default-formats"], optional = true }
106
107[target.'cfg(not(any(target_os = "windows", target_arch = "wasm32", all(target_arch = "aarch64", target_os = "linux"))))'.dependencies]
108tikv-jemallocator = { workspace = true }
109
110[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
111clap = { workspace = true }
112crossbeam-channel = "0.5" # must match the version used by lsp-server
113lsp-server = "0.7"
114
115[target.'cfg(target_arch = "wasm32")'.dependencies]
116console_error_panic_hook = "0.1.5"
117js-sys = { version = "0.3.57" }
118web-sys = { workspace = true, features = ["Navigator"] }
119send_wrapper = { workspace = true }
120serde-wasm-bindgen = "0.6.0"
121wasm-bindgen = "0.2.80"
122wasm-bindgen-futures = "0.4.30"
123i-slint-backend-winit = { workspace = true }
124
125[target.'cfg(target_vendor = "apple")'.dependencies]
126i-slint-backend-winit = { workspace = true, optional = true }
127muda = { version = "0.16.0", optional = true }
128objc2-foundation = { version = "0.3.0", optional = true }
129
130[dev-dependencies]
131i-slint-backend-testing = { path = "../../internal/backends/testing" }
132spin_on = { workspace = true }
133
134[build-dependencies]
135slint-build = { workspace = true, features = ["default"], optional = true }
136
137# [package.metadata.wasm-pack.profile.release]
138# wasm-opt = false
139