Commit graph

69 commits

Author SHA1 Message Date
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
Simon Hausmann
b48c5a4cdb
Specify target platform for esbuild calls for vs code extension (#1924)
This patch has no effect on the currently generated output (apart from a
dummy few lines in out/extension.js), but may help to avoid issues in
the future like we had last week, where esbuild processed an import from
"vscode-languageclient" and due to browser mode it picked the browser
version of the languageclient for out/extension.js that's running in the
node environment.
2022-11-29 09:42:54 +01:00
ogoffart
fb02b4118b Bump version number to 0.3.3 2022-11-28 13:11:11 +00:00
Tobias Hunger
9845f47d8e Revert "Dont add vscode-languageclient in the externals"
This reverts commit e940c4316d.
2022-11-26 19:45:56 +01:00
Tobias Hunger
e9d28f00e3 tools: Unshare some code
Do not interact with the language server directly in vscode, but use
vscode.commands.executeCommand(...) instead. The online_editor will of
course need to continue to interact with the language server directy, so
this unshares a bit of code. It is not too much and straight forward
code, so that is not too bad.
2022-11-26 18:26:37 +01:00
Olivier Goffart
e940c4316d Dont add vscode-languageclient in the externals 2022-11-26 14:16:34 +01:00
Tobias Hunger
6abbaf2df4 Revert "vscode extension: Fix local build"
This reverts commit 22b54b72f0.
2022-11-25 17:34:32 +01:00
Tobias Hunger
b949689e35 Revert "tools: Put code shared between online editor and vscode in NPM package"
This caused trouble with both the online editor as well as the VSCode
extension when built in CI.

This reverts commit c8b434021e.
2022-11-25 17:34:32 +01:00
Olivier Goffart
22b54b72f0 vscode extension: Fix local build 2022-11-25 08:47:56 +01:00
Tobias Hunger
0672e02115
Tools: Retry getting properties on error (#1907)
* Tools: trigger updates for properties view more often

So far you had to move the cursor to refresh the properties view after
start-up. This is no longer necessary.
2022-11-24 19:40:19 +01:00
Tobias Hunger
83b64eaecb
vscode: Have welcome pages in property view
Add a way to have welcome pages to the properties view. Make the
properties view reflect changes in the IDE better.
2022-11-24 16:49:54 +01:00
Tobias Hunger
c8b434021e tools: Put code shared between online editor and vscode in NPM package
Put the shared code into an NPM package. This makes especially vscode
much happier as it does not need to build code outside its project root
anymore:-)
2022-11-24 12:57:47 +01:00
Simon Hausmann
d8a1f2cf01 Introduce a rem unit in the type system
This allows specifying font sizes relative to the Window's
default-font-size, similar to CSS rem.
2022-11-24 11:33:38 +01:00
Tobias Hunger
1a0e0bcfaa vscode: Update version requirements
I just noticed that I had broken the package build before by updating
the types downloaded for vscode. Those types need to be in sync with
the vscode engine version!

Hard-code both to 1.70 for now, I think that is old enough to cover most
installaions of VSCode (which tend to be very new in my experience).
2022-11-23 18:46:42 +01:00
Tobias Hunger
f8a0cf6d81 tools: Use setBinding in the LSP to set bindings 2022-11-23 14:03:44 +01:00
Tobias Hunger
bf340f62c1 tools: Make properties view use document version 2022-11-23 14:03:44 +01:00
Tobias Hunger
40ec6953a3 vscode: Update packages.json to make eslint work again
The version in there was too old of the typescript compiler I am using.
2022-11-23 14:03:44 +01:00
Olivier Goffart
0714a9f6c6 Prospective fix for nightly build 2022-11-23 07:40:28 +01:00
Tobias Hunger
11a5c2e3a9 vscode: Fix warnings
Fix warnings raised in the editor.
2022-11-22 12:47:43 +01:00
Tobias Hunger
aa47ef8a55 vscode: Delay registration of client
This avoids errors when the user starts to interact with our widgets
before the LSP is fully up.
2022-11-22 12:47:43 +01:00
Tobias Hunger
5e786e3486 vscode: Split up scripts in package.json
Handle the LSP/interpreter building in vscode:pre-publish instead of
compile to speed up compilation loops.
2022-11-22 12:47:43 +01:00
Tobias Hunger
2a351c1727 Reformat vscode 2022-11-22 11:32:17 +01:00
Olivier Goffart
88e5cb881d vscode extension: don't send a queryProperties for non-slint files
Otherwise the LSP replies with an error whish show an annoying popup
2022-11-17 20:02:39 +01:00
Tobias Hunger
631ad3d8d1 tools: Make use of embedded properties value
Make use of embedded properties values in VSCode extension and online
editor.

This removes all code related to `BindingTextProvider`.
2022-11-14 14:48:25 +01:00
Olivier Goffart
cbe2d6d631 LSP: add a setting to change the style
... and the include paths
2022-11-13 14:22:27 +01:00
Tobias Hunger
8f29f22c6c lsp: Use proper LSP types for queryProperties 2022-11-11 20:19:35 +01:00
Tobias Hunger
67712d2b46 LSP: Keep current document version around
This will become helpful when actually updating the documents as it can
help to detect races.
2022-11-11 10:34:18 +01:00
Olivier Goffart
0d598ed1e4 Cleanups 2022-11-03 13:15:45 +01:00