Commit graph

343 commits

Author SHA1 Message Date
Tobias Hunger
3626fece0b Make preview UI work with VSCode 2023-11-03 22:14:20 +01:00
Tobias Hunger
d53cebd3e1 lsp: Get signalled by the preview 2023-11-03 22:14:20 +01:00
Tobias Hunger
55d0f5d473 lsp: Make native UI work
The UI is ugly and does not include the Design Mode button yet, but it
is a bit of progress.
2023-11-03 22:14:20 +01:00
Simon Hausmann
28e0c19a1b Prospective fix for windows vscode lsp binary
Build as MSVC binary, as Skia doesn't compile with mingw toolchain (Somehow gcc flags end up in the environment).
2023-10-31 15:06:36 +01:00
J-P Nurmi
c5248c005e Allow specifying paths for @library imports 2023-10-20 16:47:00 +02:00
Tobias Hunger
f12b3d2df4 vscode: Create highlight function again and pass it to the LSP
This stops a panic then triggering a highlight to happen.
2023-10-19 15:01:46 +02:00
Tobias Hunger
f6f369251b Revert "vscode: Use ESM modules"
Using ESM modules causes issues with the web extension: It complains
about use of "ImportScript" in a module. Something adds that into the
module, I need to properly investigate what and why. Let's revert this
till then.

This reverts commit cb66bc1650.
2023-10-19 15:01:46 +02:00
Tobias Hunger
cb66bc1650 vscode: Use ESM modules
A vscode extension must use CJS, but that code may use ESM modules in
turn.

So update to ESM, fixing a warning when importing our WASM code.
2023-10-17 10:28:30 +02:00
Tobias Hunger
4a077e19b2 VSCode: Fix refactoring code
The refatoring code (wrap in eleemnt/remove element) needs some setup to
happen before the client is started. Add a little helper function and
call it.
2023-10-16 14:13:19 +02:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Olivier Goffart
ef39adce30 Prospective fix for nightly build: increase minimum supported vscode version
We use `@types/vscode": "1.82.0"` meaning we need vscode 1.82 minimum
2023-10-14 13:18:58 +02:00
Tobias Hunger
a562c534ad vscode: Mirror the code in slintpad for the LSP worker more closely
The code is not identical, so it can not be shared (yet), but at least
minimize the diff.
2023-10-13 18:44:02 +02:00
Tobias Hunger
8311533cb1 vscode: Update dependencies
Adapt to new APIs and move more code into common.ts so that it is shared
between the web and the "native" extension.
2023-10-13 18:44:02 +02:00
Tobias Hunger
283ef4b461 compiler: Implement resource URL remapping
This is used in slintpad to map relative image URLs to their real
download locations.

This has the side-effect of removing the service worker.

Fixes: #2905
2023-10-12 21:41:26 +02:00
Tobias Hunger
6546d1a02f editors: Mention intellij plugin
... and remove the instructions on hopw to set up the generic LSP plugin
for Intellij that seems to be unmaintained nowadays.
2023-10-10 20:05:05 +02:00
Simon Hausmann
8684cbf959 Update the VS code extension logo to a variant with a white background
Commit e01e9685be made the logo we were
using transparent, which doesn't look good in the vs code extension
list.
2023-09-13 10:03:16 +02:00
Aurindam Jana
e01e9685be
Update Slint logo folder with new design (#3432)
This PR updates the logos and branding guideline of Slint to match the new website design. The new logos are a 1:1 replacement of the old logos except for the circular logo. In the new logo design, there isn't a separate circular logo, as the square logo with circular crop can be used. Further, the logo folder also contains logos in CMYK for use in printed materials. The PMS is just the color value in the naming and can be used where Pantome colors are required. The README has been updated to explain which logos to use when as well as the Slint "blue" color.
2023-09-11 16:41:06 +02:00
Tobias Hunger
b2cfe21699 VSCode: Add some spacing above WASM preview canvas
VSCode draws a frame around the canvas when it gets keyboard focus. We
used to cut that off, which did not look nice.
2023-09-07 13:57:43 +02:00
J-P Nurmi
5ce11e302a
vscode: add "wrap in element" code action (#3420) 2023-09-07 12:11:14 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Olivier Goffart
1f5da4ad97 Fixes to wasm_preview
- the "preview" command don't contain a "design_mode" arg, but later
   the generated js for the wasm checked that it is a boolean.
 - The url comparison did not work when using the binary lsp and wasm
   preview. Event though the URL string is the same, the object were not
   exactly equals.
 - Fix rust warnings in the wasm lsp build
2023-08-31 14:38:06 +02:00
Tobias Hunger
acfa07594c vscode: Use the new LSP/Previewer WASM bundle 2023-08-25 13:19:34 +02:00
darknight
879438a27a auto complete for animate block 2023-08-24 07:32:37 +02:00
Tobias Hunger
22cbb9caf8
Fix reuse compliance 2023-08-17 18:17:38 +02:00
Tobias Hunger
0b40431c7b
vscode: Add a walkthrough to help getting started with Slint (#3292)
The walkthrough:

 * Creates a .slint file
 * Explains Live Preview
 * Shows Properties Editor
 * Explains where to get help

No code change, this is all just added configuration/markdown/images.

Remove the Welcome page we had earlier (which does change some code).

Co-authored-by: Olivier Goffart <olivier@woboq.com>
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2023-08-17 17:38:02 +02:00
Tobias Hunger
de093db4d9 vscode: Add button in PropertiesView to open our Welcome Page
This checks one more box in #3083.
2023-08-17 10:49:52 +02:00
Tobias Hunger
0139eea4f9 xtask: Fix up license headers
* Keep project related .md files triple licensed as the rest of the
  crate
* Make vtable MIT OR Apache 2.0 (as suggested by @ogoffart)
2023-08-17 08:55:28 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Simon Hausmann
f3f7d1de33 Don't show live-preview in fullscreen when running VS code with WSL
Generally, disable the fullscreen rendering. This selection mechanism
needs reworking, as one might want to use the live-preview in a setup
where weston, etc. are running side-by-side.

This could be made configurable in the future, i.e. choosing a backend
like linuxkms, or having the window state as property in Slint.
2023-07-31 20:10:49 +02:00
Olivier Goffart
6920f9ea7f
vscode extension: Use the wasm preview in codespaces (#3159)
Attempt to detect when we are running in a codespace and force the
preview to render in wasm.
Remote view don't make sense as there is no graphical server where the
extension runs
2023-07-26 11:56:12 +02:00
ogoffart
aebaa7d6c9 Bump version number to 1.2.0 2023-07-25 10:44:53 +00:00
Tobias Hunger
355464e850 vscode: Fix web extension
Make sure to pass around the extensionUrl, not the extensioPath. The web
extension seems to need the full URL when actually deploying this. It
works file in web extension test mode either way.
2023-07-24 18:16:43 +02:00
Tobias Hunger
f306e049e8 vscode: Make utf8 decoding of the welcome page more portable 2023-07-24 14:10:57 +02:00
Simon Hausmann
752e92b1e7 Fix the links in the welcome page for the nightly releases 2023-07-23 07:54:11 +02:00
Tobias Hunger
53355a6e9e vscode: Add a simple Welcome page 2023-07-21 18:12:46 +02:00
Olivier Goffart
21eff9cf10 Instruction to build the vscode extension locally 2023-07-19 14:37:59 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
fc1570b19d Fix tree sitter
The tree-sitter test start failling with the introduction of the test
from the previous commit which has an expression for the model
2023-06-27 10:06:20 +02:00
ogoffart
c8c9496722 Bump version number to 1.1.1 2023-06-26 12:50:02 +00:00
Tobias Hunger
bda431134a tools: Fix property editor rendering input too big
The text input in our properties viewer was too wide and got a few
pixels rendered below the button in the next column of the table.

Fix that.
2023-06-23 13:03:05 +02:00
Tobias Hunger
efff76bfbb vscode: Update color scheme 2023-06-23 13:03:05 +02:00
Bundyo (Kamen Bundev)
bbfbff99fa Update README.md with the name of the IDE 2023-06-16 19:07:07 +02:00
Bundyo (Kamen Bundev)
2ab84ba463 Update README.md with more tested JetBrains IDEs 2023-06-16 19:07:07 +02:00
Simon Hausmann
222b2bd782 Serialize component creation and initial show in slintpad and vs code web preview
Turn the instance variable into a Promise itself, where the first
promise that's assigned to it creates the component and shows
it, before resolving the promise with it.

Some associated helper functions that use this.#instance - which is now a Promise - are also async.
In some call sites it doesn't matter, in others an await was added.
2023-06-16 15:53:04 +02:00
Simon Hausmann
26f3aa84fa Fix race in Slintpad causing preview to panic (esp. in FF)
With the following snippet there was a race:

```
if (instance === null) {
    instance = await create();
    await instance.show();
} else {
    instance.create_with_existing_window(...);
}
```

When awaiting for the promise that show() returns to settle, we would re-enter
this function (due to a broken recursion guard, that's now removed).
When re-entering, create_with_existing_window() is called, which - in order to
access the slint::Window to re-use - must create the window adapter.
Since that didn't happen from within an event loop invocation, winit would panic.

Consequently, this patch set also makes create_with_existing_window() return
a promise, as well as hide() (for the sake of it).

The broken recursion guard is easy to fix (with a .finally() handler setting
the boolean back), but that would mean we end up not always rendering
the very latest sources. Plus, the same issue exists in wasm_preview.ts.

Now, in case of subsequent re-entrancy in this code, we end up creating
a bunch of create_with_exiting_window() promises, which will eventually
settle and then we go back to the original show() call that will show the canvas.
2023-06-16 15:53:04 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Tobias Hunger
04d1229685 Fix licnese information using xtask 2023-06-16 09:14:20 +02:00
ogoffart
641cab0e75 Bump version number to 1.1.0 2023-06-15 16:01:28 +00:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
401a6dda4d
Fix preview in SlintPad and VS code web extension (#2871)
The interpreter now creates the window typically in show(), so similar
to commit a8fcb5acd6 make show() return a
promise and invoke show() from within the event loop.

Amends d98c6773e1
2023-06-13 16:29:43 +02:00