Commit graph

296 commits

Author SHA1 Message Date
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
Olivier Goffart
80a4e2e201 Update tree-sitter grammar for enums 2023-06-12 13:02:14 +02:00
Olivier Goffart
d540c63d21 LSP: support for enum in the outline and in the goto definition 2023-06-12 13:02:14 +02:00
Olivier Goffart
12e6b34e2d Translations: support for plurals 2023-06-07 10:34:34 +02:00
Olivier Goffart
f2281dd900 Adjust tree sitter to parse the context in @tr 2023-06-06 14:48:48 +02:00
Simon Hausmann
a8fcb5acd6 Fix delayed docs preview not working
After commit 7df902b53c, the winit window
is not created when calling show() anymore but it's now created at
component creation time.  That means the event loop workaround removed
in 459f810bd8 is now needed at
construction time.

Since this is a winit and wasm specific issue, it's now dealt with in
the wasm interpreter implementation, by invoking the creation from the
event loop from there and returning a promise in the API.

This changes the API therefore: create() can only be called after the
event loop is running.
2023-06-01 16:51:12 +02:00
Olivier Goffart
1fbbdf83b2 vscode extension: Show an error message when slint-lsp crashes 2023-04-26 16:52:56 +02:00
ogoffart
dfd5fc38b3 Bump version number to 1.0.3 2023-04-26 14:04:08 +00:00
Tobias Hunger
c2a246bddd vscode: Make local-package work on windows and fix license warning
Create a license file in the pre-publish step, so that vsce will not
complain about that.
2023-04-26 14:54:56 +02:00
ogoffart
53cce5bf44 Bump version number to 1.0.2 2023-04-26 11:33:16 +02:00
Tobias Hunger
b38bec6e2c vscode: Trigger queryProperties less often
I somehow ended up in a situation where the Slint LSP logs where open
and VSCode was logging data into that. While my cursor was in an editor
with a .slint file open, the onDidChangeTextDocument events emitted by
the slint log file triggered yet another attempt to queryProperties.

This patch makes sure to ignore events from documents not containing
slint or rust files.
2023-04-25 22:43:49 +02:00
Tobias Hunger
a9b09f21f1 LSP: Add toggleDesignMode command
Add a toggle command to the LS and use them in VSCode.

Keep the existing set_design_mode commands for Slintpad, as it is easier
for the state stored on the web site and in the WASM side to go out of
sync. This is not an issue in VS Code at this point.
2023-04-25 14:49:54 +02:00
Tobias Hunger
89e1e68e6f vscode: Enable design mode in VSCode 2023-04-22 18:31:52 +02:00
Tobias Hunger
26bc425f7d vscode: Remove some dead code
All interceptions happen via the middleware layer now, so remove old
code that did redirect traffic on the client side.
2023-04-22 18:31:52 +02:00
Olivier Goffart
2e173989d3 vscode: Fix the wasm preview not previewing the specific component
That's because since Slint 1.0 we show the last exported component,
and the `_Preview` component wasn't exported.
(The equivalent in the native LSP is already exported)
2023-04-21 10:30:26 +02:00
Tobias Hunger
c259683783 vscode: Share more code
Share more code between Slintpad and VSCode as well as between VSCode
and the web version of VSCode.
2023-04-20 18:50:36 +02:00
Tobias Hunger
ca461d2580 vscode: Rename web_preview to wasm_preview
That's what this is called in slintpad as well :-)
2023-04-20 18:50:36 +02:00
Tobias Hunger
f062f1c30d vscode: Rename file and simplify it a bit
Rename common.ts to properties_webview.ts, that's the only thing in
there.
2023-04-20 18:50:36 +02:00
Jonatan Hatakeyama Zeidler
d1918e65c1 Update the neovim plugin
Replace the non-existent neovim plugin by neovim/nvim-lspconfig
2023-04-20 13:10:38 +02:00
Tobias Hunger
0a4490a388 vscode: Improve package.json a bit
Make it work on windows, too, and allow to run the individual steps
separately.
2023-04-20 11:38:21 +02:00
ogoffart
bd63218412 Bump version number to 1.0.1 2023-04-18 14:56:40 +00:00
Olivier Goffart
b444feb1ca vscode: use |null to indicate some variable might be null
As per review in #2500
2023-04-12 12:03:08 +02:00
Olivier Goffart
78e81299b0 vscode extension: Add an option to show the preview in a tab 2023-04-12 12:03:08 +02:00
Olivier Goffart
f8bbb257f3 vscode extension: Move the web preview to a different file 2023-04-12 12:03:08 +02:00
Tobias Hunger
de0dc20e5b
slintpad: Move into tools/slintpad (#2435)
* Add "slintpad" to cspell white list for all languages
* Mention online_editor to slintpad rename in CHANGELOG
* Move tools/online_editor into tools/slintpad
* Update github actions accordingly

Co-authored-by: Olivier Goffart <olivier@woboq.com>
2023-03-29 16:32:30 +02:00
Tobias Hunger
a454ffe8f9 tree-sitter: Polish queries 2023-02-13 09:22:42 +01:00
Tobias Hunger
671d22d762
tools: Tree sitter update for 1.0 (#2144)
Make our tree-sitter parser handle all the 1.0 syntax.
2023-02-10 14:46:47 +01:00
Simon Hausmann
1bd0e479c7 Declare the Slint VS code extension as stable
... and not preview anymore, for releases.
2023-02-09 10:22:34 +01:00
Tobias Hunger
05e00fe057 vscode: Add some more keywords to highlight definition 2023-02-08 14:20:18 +01:00
ogoffart
e7f48512ee Bump version number to 1.0.0 2023-02-03 11:07:15 +01:00
Tobias Hunger
8782890016 vscode: Undo some fixes for linter warnings
Turns out you need to compare `X == null` here as `X` may be `null` or
`undefined`, even with the linter asking to change `==` to `===`.
2023-01-25 11:47:29 +01:00
Tobias Hunger
b718c9c043 tools: Remove progress reporting for file loading
Stop the LSP from reporting progress information on file loading. This
caused problems with VSCode: First it triggered popups in the UI and
secondly it caused problems for the LSP that was asked to process
requests while calling back into the client.

Adapt the online editor and the two VSCode plugins to work with the
updated code.

Note: I did leave in the progress reporting code that can be used to
handle progress initiated by the _client_ side. That is just
notifications which will not block the LSP in any way and we might need
to support that at some point.

I did remove the Middleware code from the client side though that acted
on the progress information.
2023-01-23 19:51:55 +01:00
Olivier Goffart
16354c2c25 vscode browser: implement the highlight 2023-01-22 10:16:15 +01:00
Tobias Hunger
ad3bdbd096 vscode: Adapt to new WASM lsp API
WASM bindgen does not work when using cfg to hide function arguments. So
adapt to the new API.
2023-01-20 18:27:11 +01:00
Tobias Hunger
afdd450d86 vscode: Fix some lints 2023-01-20 18:27:11 +01:00
Olivier Goffart
3d67cf6c57 vscode extension: use the languageId when possible 2022-12-20 06:40:33 -08:00
Olivier Goffart
a55ed47fed vscode extension: polish the slint! macro integration
- Make the browser extention preview work
 - Enable the properties tab on rust files
 - Only call `offset_to_position_mapper` if the token is valid,
   otherwise we might get an error visible in the UI.
2022-12-20 06:40:33 -08:00
Olivier Goffart
3d171320e9 LSP: support the slint! macro within slint files 2022-12-19 09:13:58 -08:00
Olivier Goffart
9117d8e78a vscode: inject Slint syntax highligting in rust's slint! macro 2022-12-19 09:13:58 -08:00
ogoffart
ce07d078ce Bump version number to 0.3.4 2022-12-16 09:36:15 +00:00
Olivier Goffart
94bba83446 LSP: reply to the textDocument/prepareRename request 2022-12-13 16:23:26 +01:00
Olivier Goffart
1a063ecbf5 vscode extension: Fixup the appearence of the property panel
Avoid useless padding on the sides, but keep small padding within the
rows
2022-12-13 13:13:00 +01:00
Olivier Goffart
f3ec7489bb vscode: makes the codicon a dependency
instead of a devDependencies, then it is included in the bundle
2022-12-13 13:13:00 +01:00
Tobias Hunger
4e3c8f52e7 tools: Prefix our custom LSP commands with "slint/"
Keep the global namespace clean!
2022-12-12 13:01:04 +01:00
Tobias Hunger
423a3b2619 vscode: Add removal of properties 2022-12-09 17:38:04 +01:00
Tobias Hunger
524e6ed2cf tools: Extract some small helper funtion into shared/utils 2022-12-09 11:19:48 +01:00
Tobias Hunger
a9e74b1e90 vscode: Refresh properties view whenever the LSP reports it is done
... this gets rid of the remaining timeout and should make the whole
thing a bit more reliable.

It refreshes on *all* "done" messages from the LSP for now. I think this
is acceptable as the LSP is taking less than 10ms each time with the
printer demo (WASM).
2022-12-09 11:19:48 +01:00
Olivier Goffart
c2895a44af Update syntax highlight for Functions and in-out things 2022-12-08 10:14:54 +01:00