Commit graph

2197 commits

Author SHA1 Message Date
dependabot[bot]
8baa47eebd
build(deps-dev): bump @lumino/default-theme from 2.1.7 to 2.1.8 (#7520)
Bumps [@lumino/default-theme](https://github.com/jupyterlab/lumino) from 2.1.7 to 2.1.8.
- [Release notes](https://github.com/jupyterlab/lumino/releases)
- [Changelog](https://github.com/jupyterlab/lumino/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/lumino/compare/@lumino/default-theme@2.1.7...@lumino/default-theme@2.1.8)

---
updated-dependencies:
- dependency-name: "@lumino/default-theme"
  dependency-type: direct:development
  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-02-03 12:51:44 +02:00
Simon Hausmann
a28ec80917 winit: Fix support for menu bars provided by native code
Add `with_default_menu_bar` to winit's `BackendBuilder` to permit applications
to provide their own menu bar.

Fixes the lsp's Window -> Keep on top menu on macOS.
2025-02-03 11:30:03 +01:00
Tobias Hunger
38fd5586b8 lsp: Document debian dependencies
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2025-01-30 15:22:38 +01:00
Simon Hausmann
67940f8ff9 Fix cross-compilation of slint-compiler in Yocto environments (or when CC, etc. are set)
Don't enable jemalloc when cross-compiling.

Fixes #7463
2025-01-29 09:05:56 +01:00
Tobias Hunger
e24e9ffb60 lsp: Improve renaming of properties
Make that work accross exports for properties that
are accessible to the outside world.

Add a few tests for it.
2025-01-27 14:04:00 +01:00
dependabot[bot]
e958d6b31b
build(deps): bump the playwright group with 2 updates (#7467)
Bumps the playwright group with 2 updates: [@playwright/test](https://github.com/microsoft/playwright) and [playwright](https://github.com/microsoft/playwright).


Updates `@playwright/test` from 1.49.1 to 1.50.0
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.49.1...v1.50.0)

Updates `playwright` from 1.49.1 to 1.50.0
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.49.1...v1.50.0)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: playwright
- dependency-name: playwright
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: playwright
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 13:09:26 +02:00
Nigel Breslaw
facd460037
Convert Figma project to Vite + React (#7453)
A Figma plugin is just a single javascript file which means no out of the box way to split files, import helper libraries and scale the project. It's also a vanilla web site for making the UI.

The PR updates the project to use Vite. It allows normal project spliting for typescript and css files. It provides a simpler way for the plugin and backend code to communicate. React is used to then build the plugin interface.
2025-01-27 12:54:09 +02:00
Milian Wolff
18300429c1
Use jemalloc for slint-viewer, slint-compiler, and slint-lsp
* optimize: use jemalloc for slint-viewer

The lots of allocations are slowing down slint-viewer.
By using the faster jemalloc, we get a significant time boost
on Linux at least,  where I can observe a 15% time reduction:

Before:
```
  Time (mean ± σ):     936.6 ms ±  13.5 ms    [User: 688.8 ms, System: 191.1 ms]
  Range (min … max):   918.9 ms … 955.6 ms    10 runs
```

After:
```
  Time (mean ± σ):     794.8 ms ±  16.2 ms    [User: 645.4 ms, System: 99.2 ms]
  Range (min … max):   755.0 ms … 810.7 ms    10 runs
```

* optimize: also use jemalloc for slint-compiler

As with the slint-viewer, we can observe a drastic time improvement
of around 13% when using jemalloc for slint-compiler:

Before:
```
  Time (mean ± σ):     772.8 ms ±   9.2 ms    [User: 633.5 ms, System: 136.5 ms]
  Range (min … max):   763.3 ms … 787.8 ms    10 runs
```

After:
```
  Time (mean ± σ):     672.5 ms ±  13.5 ms    [User: 610.4 ms, System: 60.1 ms]
  Range (min … max):   655.1 ms … 700.7 ms    10 runs
```

* optimize: also use jemalloc for slint-lsp

The impact here was not measured, but it should be in a similar
ballpark to the slint-compiler and slint-viewer, and thus quite
noticeable in practice.
2025-01-25 17:40:33 +01:00
Olivier Goffart
ed179cd5b1
Refactoring: get rid in the callable in the Expression tree
Have a special node for them in FunctionCall
2025-01-24 20:26:35 +01:00
Simon Hausmann
de87bf2a43 Update to new objc2 versions 2025-01-24 18:57:09 +01:00
Nigel Breslaw
de687b4093
Simple Figma attributes inspector plugin (#7446)
Converts properties figma normally shows as CSS values, but converted to the equivalent Slint syntax.
2025-01-24 13:10:00 +02:00
Tobias Hunger
f9d5b1684c lsp: Support export modules when renaming 2025-01-23 12:28:20 +01:00
dependabot[bot]
5781c45c1a build(deps-dev): bump vite from 6.0.7 to 6.0.9
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.7 to 6.0.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 07:14:44 +01:00
Tobias Hunger
af03842bf7 lsp: rename Globals 2025-01-20 11:04:13 +01:00
autofix-ci[bot]
0304c7a410 [autofix.ci] apply automated fixes 2025-01-17 18:03:30 +01:00
Tobias Hunger
de0fcc4805 lsp: Rename properties 2025-01-17 18:03:30 +01:00
Tobias Hunger
f4b09226c4 lsp: Wire up more renaming for component, structs and enums
... and their usages and imports/exports

Use the token_info to do this.
2025-01-17 10:27:12 +01:00
Tobias Hunger
1b081429fc lsp: Make token_info work with a const DocumentCache 2025-01-17 10:27:12 +01:00
Tobias Hunger
0a648dfa41 lsp: Move token_info.rs from language to common 2025-01-17 10:27:12 +01:00
Simon Hausmann
b8ffca01b4 live-preview(macOs): Add a Window menu with keep on top item
Fixes #7371
2025-01-15 17:14:02 +01:00
Olivier Goffart
8a5df27469
Update to Image 0.25 (#7365)
Added image-default-formats with all the format supported by image by
default, and enable that feature by default.
Also put that feature in compat-1-2 for compatibility with user that
have used image 0.24 with enabled features.
Make a new compat-1-10 feature that does not enable default format by
default

ChangeLog: upgraded image crate to 0.25, added a new cargo feature
to enable all image formats. (that feature is enabled by default with
compat-1-2, added compat-1-10 to disable it

Fixes https://github.com/slint-ui/slint/issues/7251
2025-01-14 16:31:05 +01:00
dependabot[bot]
870805ec19 build(deps): bump typescript from 5.2.2 to 5.7.3
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.2.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.2.2...v5.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 15:25:56 +01:00
Simon Hausmann
53f2d572b1 Remove some uses of once_cell 2025-01-14 14:18:24 +01:00
Simon Hausmann
0449ea24a4 lsp(macOS): Bump muda dependency 2025-01-14 13:52:21 +01:00
Olivier Goffart
5cf9c6806e LSP: don't auto-compete private properties 2025-01-14 11:26:57 +01:00
Olivier Goffart
c1bab16d6d Janitor: dependencies update 2025-01-14 10:48:46 +01:00
Tobias Hunger
9e0a68afa0 live-preview: Normalize component names when looking them up in AST 2025-01-13 16:27:24 +01:00
Tobias Hunger
70742a212d lsp: Import more types in rename_component 2025-01-13 16:27:24 +01:00
Tobias Hunger
eb4fa61f25 lsp: Simplify tests in rename_component
No behavior change is intended...
2025-01-13 16:27:24 +01:00
ogoffart
c83af3ca5c Bump version number to 1.10.0 2025-01-13 13:38:41 +00:00
Tobias Hunger
f4cca6ef24 live-preview: Do not race the LSP on config changes
When the LS gets new configuration, it will now
start to re-parse all files, sending `SetContents`
messages as it discovers files in new locations (e.g.
due to library path changes).

The live-preview will ignore those: Nothing it knows
depends on those paths.

Finally the LS will send a `SetConfiguration` request,
which will unconditionally trigger a re-rendering
in the live-preview. At this point all files
are known and the request should succeed.
2025-01-13 13:10:11 +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
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Olivier Goffart
57f42c0870 LSP: Submit the full backtrace to the crash reporter 2025-01-10 23:23:43 +01:00
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
Tobias Hunger
56697f27ea lsp: Improve test to rename components 2025-01-07 16:18:46 +01:00
Tobias Hunger
cfb2324526 lsp: Rename structs and enums
... but only when directly on the name of the struct
when it is declared.
2025-01-07 16:18:46 +01:00
Tobias Hunger
7893c5a00c lsp: Generalize some renaming related functionality 2025-01-07 16:18:46 +01:00
Tobias Hunger
6b4db19fb0 lsp: Extract common code needed to rename a DeclaredIdentifier 2025-01-07 16:18:46 +01:00
Tobias Hunger
e1e8f04e9f lsp: Fix error reporting when opening the live-preview fails
Fixes: #7255
2025-01-06 18:13:19 +01:00
Olivier Goffart
dc321fc50b Janitor: update which and notify deps 2025-01-06 17:25:08 +01:00
dependabot[bot]
7128e28f8e
build(deps-dev): bump vite from 6.0.6 to 6.0.7 (#7278)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.6 to 6.0.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  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-01-06 15:50:04 +02:00
Olivier Goffart
10510be232 LSP: Document symbol: make sure the selectionRange is contained in the full range
Otherwise we get a lot of error in vscode such as:

```
Error: selectionRange must be contained in fullRange
	at Gd.validate (file:///snap/code/178/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:109:33728)
	at new Gd (file:///snap/code/178/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:109:33936)
	at Ke (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:35:72279)
	at Ke (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:35:72456)
	at o (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:35:46654)
	at Object.$P [as map] (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:35:46740)
	at Object.Se [as asDocumentSymbols] (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:35:72246)
	at c (/home/olivier/.vscode/extensions/slint.slint-nightly-2025.1.109/out/extension.js:39:56055)
	at async uI.provideDocumentSymbols (file:///snap/code/178/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:138:126457)
[Error - 11:41:30 AM] Request textDocument/documentSymbol failed.
```

We shouldn't need to trim the whitespace from the node range.
Because the selected range might be the end of the range and it might
end up being trimmed.

In normal cases, whitespace are not part of the Node anyway
2025-01-06 10:47:05 +01:00
Olivier Goffart
61b4dcf233
Workaround panic of autocompletion of import with unicode
(As seen in the crash reporter)

Eg:
```
thread 'LanguageServer' panicked at tools/lsp/language/completion.rs:731:17:
byte index 4 is not a char boundary; it is inside '🍒' (bytes 2..6) of `./🍒🍓🍇"`
```

This can happen because offset might not be on a char boundary because
of the utf-16 / utf-8 mismatch.
2025-01-02 12:17:38 +01:00
ogoffart
f309a551b5 Bump version number to 1.9.2 2024-12-30 10:18:16 +00:00
Tasuku Suzuki
be60b74eb9
Viewer: convert struct to json in callback args (#7206)
Fixes #4553

ChangeLog: Viewer: struct are now supported in callback argument (passed as JSON)
2024-12-30 10:13:53 +01:00
dependabot[bot]
cbc8a5c90c
build(deps-dev): bump vite from 6.0.3 to 6.0.6 (#7235)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.3 to 6.0.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  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>
2024-12-30 10:18:50 +02:00
szecket
275483b39e
the instructions for interaction at bottom were sometimes inconsistent (#7184) 2024-12-20 10:19:37 -05:00
Tobias Hunger
48c1909fb0
live-preview: Remember filter settings in selection popup (#7178) 2024-12-20 08:03:45 +13:00
Tobias Hunger
93edeebe2c
live-preview: Fix filter in selection popup being init to empty (#7177)
... till the filter button is pressed for the first time.
2024-12-20 06:58:52 +13:00