Commit graph

20 commits

Author SHA1 Message Date
Tobias Hunger
5dc9ce5204 LSP: Start external process for live preview
Start the live preview in a separate process. This simplifies
a couple of things:

* Starting the UI
* UI state handling
* Threading setup
* "Quitting" the preview on Mac

... and many more :-)
2025-07-28 17:13:15 +02:00
Olivier Goffart
ba7e31dd3b Fix more nightly warnings 2025-06-06 12:30:45 +02:00
Simon Hausmann
827b0b1d5c Improve diagnostics and error handling when encountering unknown url schemes
When asked to drop a document, don't make it a fatal error. Also, when the conversion fails for loading or closing, print the path to stderr. Maybe we can learn something there.

cc #8089
cc #7333
cc #4926
2025-04-15 17:24:42 +02:00
Tobias Hunger
d6a19d78cb
live-preview: Improve std-widget use detection (#8086)
live-preview: Improve std-widget use detection

... so we do not hide the Style combobox when std-widgets get used by
imported components, even if they are not used by the previewed
component.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-10 12:59:52 +02:00
Yuri Astrakhan
bcb2953f00 Auto-fixed clippy::unnecessary_map_or
This is a hacky approach, but does help a lot with the tedious fixes.

See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or

```
__CARGO_FIX_YOLO=1 cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or

cargo fmt --all
```
2025-02-07 09:02:31 +01:00
Tobias Hunger
2bb1ec1a9d lsp: Invalidate all files in DocumentCache when config changes
We need to re-evaluate all files as the library/include resolution has changed.
2025-01-13 13:10:11 +01:00
Olivier Goffart
e44f7d7a4c LSP: fix reloading loaded dependencies
The change in https://github.com/slint-ui/slint/pull/6747
invalidated the cache, but it was only reloaded when one of the dependent was reloaded.
We need to reload the cache for all open file so that LSP feature continue to work on
open document even if they get no changes
2024-11-26 14:27:56 +01:00
Olivier Goffart
5b3ea5cdd5 LSP: record dependencies and invalid all dependents when a dependencies changes
Fixes #5797
2024-11-14 14:35:22 +01:00
Milian Wolff
0f6c3a4fd7 Use SmolStr in more places of the compiler infrastructure
This removes a lot of allocations and speeds up the compiler step
a bit. Sadly, this patch is very invasive as it touches a lot of
files. That said, each individual hunk is pretty trivial.

For a non-trivial real-world example, the impact is significant,
we get rid of ~29% of all allocations and improve the runtime by
about 4.8% (measured until the viewer loop would start).

Before:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
  Time (mean ± σ):     664.2 ms ±   6.7 ms    [User: 589.2 ms, System: 74.0 ms]
  Range (min … max):   659.0 ms … 682.4 ms    10 runs

        allocations:            4886888
        temporary allocations:  857508
```

After:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
  Time (mean ± σ):     639.5 ms ±  17.8 ms    [User: 556.9 ms, System: 76.2 ms]
  Range (min … max):   621.4 ms … 666.5 ms    10 runs

        allocations:            3544318
        temporary allocations:  495685
```
2024-10-17 18:04:58 +02:00
Tobias Hunger
2008136316 lsp: Clean up language::test module use 2024-10-15 16:27:25 +02:00
Tobias Hunger
3d3bf9f01b lsp: Pass invalidation of files on to live-preview 2024-10-10 09:31:11 +02:00
Olivier Goffart
aec4b9b2dd janitor: remove unused function
I added that in the previous commit, but that was actually not needed
2024-09-18 18:17:27 +02:00
Olivier Goffart
db5b4686ad property editor: Show the default value from base component when no binding exist
When no bindings exist on the component, the value that is shown in the
property editor should be the default value for that property as defined
in the base component or in the builtin element. Not just the default
value of the type
2024-09-18 18:14:28 +02:00
Tobias Hunger
cab41c3d0c lsp: Use more TextSize
I got carried away, I replaced `u32` with `TextSize` in one place
because that's what I got and I did not want to convert... and
then I fixed the fallout.

No functional change is intended in any of this.

FIXUP
2024-09-10 13:31:52 +02:00
Tobias Hunger
0f0b76e952 lsp: Clippy fixes 2024-08-23 18:58:44 +02:00
Tobias Hunger
45c24803f2 compiler: Remove version info from SourceFile again
... and fix the fallout of that change.
2024-08-21 16:55:13 +02:00
Tobias Hunger
0713a91b87 lsp: Make DocumentCache constructible from a TypeLoader
... while making sure we have all the extra information around that
we need to keep the DocumentCache snap-shottable.
2024-08-21 16:55:13 +02:00
Tobias Hunger
c9b4c8d665 lsp: Make DocumentCache source file version aware 2024-08-21 16:55:13 +02:00
Tobias Hunger
08f92bbe88 lsp: Use a custom CompilerConfiguration in DocumentCache
This is so that we have all the information necessary to
have a snop-shottable DocumentCache later.
2024-08-21 16:55:13 +02:00
Tobias Hunger
74338fcee5 lsp: Move DocumentCache into extra file
It gets too big :-)
2024-08-21 16:55:13 +02:00