Commit graph

296 commits

Author SHA1 Message Date
Olivier Goffart
c98ba05d95 janitor: vscode: remove useless activation event
Fix warning in json file:

> This activation event can be removed as VS Code generates these automatically from your package.json contribution declarations.
2024-08-07 09:39:07 +02:00
Olivier Goffart
7b4668b481 Vscode extension: add Slint icon to .slint file 2024-08-06 22:53:05 +02:00
ogoffart
aa25e3cd44 Bump version number to 1.7.1 2024-07-23 12:05:34 +00:00
Tobias Hunger
c260fe892d vscode: Fix error while loading our extension 2024-07-16 14:19:44 +02:00
Tobias Hunger
1e7b3a6958 slintpad/vscode: Remove the TS-based Property Editor
The one in the Preview is better already, so remove the two copies of a property
editor we used to have.
2024-07-11 10:40:46 +02:00
Simon Hausmann
97de0d8ad8 Fix VS code extension not loading when building with latest wasm-pack
The latest wasm-pack version creates, by default, a package.json
that has a "type": "module" entry in it.

We invoke wasm-pack to build the lsp module and store it in the out/
folder. Next we run esbuild to place out/extension.js - the main entry
point - into the same directory. That directory now also has the
wasm-pack generated package.json, which has the "type": "module", which
doesn't match our CJS out/extension.js.

When VS code does require("/path/to/extension/out/extension.js"),
node.js complains that extension.js is not an ESM because
out/package.json claims that it should be.

The fix here is to not generate the package.json file we don't need
anyway.
2024-07-03 10:42:51 +02:00
Olivier Goffart
36ccc9d658 Changed callback syntax coloration 2024-06-28 10:45:45 +02:00
Olivier Goffart
ecd790ff6e vscode extension: improve description and keywords 2024-06-16 12:34:46 +02:00
ogoffart
3a6e34ba45 Bump version number to 1.7.0 2024-06-04 20:34:29 +00:00
Tobias Hunger
199a7286a8 tree-sitter: Relicense grammar.js to MIT
Code is generated from grammar.js, which gets built into a library. That
library gets loaded by a text editor. So someone might argue that the GPL might
infect that text editor.

We do not want that argument to come up, so let's use MIT for that code.
2024-06-03 11:11:35 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Olivier Goffart
9e497e7569 vscode web extension: Fix loading of images
Prospective fix for loading of image when using the vscode extension from the web
(eg, via https://github.dev)

URL is different in a local web extension and in a online web extension.
In a local web extension, it still use file:// for urls, but online, it
uses vscode-vfs:// url. And we wouldn't map it because it doesn't start
with file://

I couldn't find a reason looking at the git history why we check for
file://, I assumed this might have been because of builtin:/, but I
checked and these still work both with the wasm in the native extension,
and as a web extension
2024-05-13 09:14:12 +02:00
Olivier Goffart
659dcfb92e Fixed tree_sitter for changed callbacks 2024-05-02 22:25:53 +02:00
Simon Hausmann
79a188516a Add support for slint syntax highlighting in markcode code fences
Use an injection grammar to achieve this.
2024-04-26 14:33:32 +02:00
Simon Hausmann
b885190a4c Mention the zed-slint extension in the editors README 2024-04-19 10:21:41 +02:00
Simon Hausmann
8a7bb0a7d2 Fix tree-sitter grammar to support optional trailing semicolon after else block
Commit 183278c0e8 exposed the following
statement to the parser with a trailing semicolon:

            if (val > 50) {
                return green;
            } else if val > 40 {
                return yellow;
            } else {
                return blue;
            };
2024-04-16 15:54:13 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Olivier Goffart
6522ddb3ba
editor docs: improve Kate section
Fixes #5022
2024-04-06 10:41:01 +02:00
ogoffart
6bf40989d9 Bump version number to 1.6.0 2024-03-27 07:49:22 +00:00
ogoffart
20c570ab1d Bump version number to 1.5.1 2024-03-18 08:55:01 +00:00
Olivier Goffart
f642743e49 Fix vscode web extension
`process` is only defined with nodejs
2024-03-12 11:36:57 +01:00
Olivier Goffart
255dc59ef4 Rename @image-url(..., 9slice(...)) to @image-url(..., nine-slice(...))
As per API review:
 - In the Rust and C++ API we use `set_nine_slice_edges` because the getter couldn't start with 9
 - in english we spell number less than 10 with letters and this is a name
2024-03-07 17:01:57 +01:00
Olivier Goffart
d90b9185ad vscode extension: Fix wasm preview in debug
It asserts that the "experimental" argument to create is not set
2024-03-06 08:30:05 +01:00
Tobias Hunger
fde411408e janitor: Reformat package.json of vscode using the defined prettier config
No change otherwise...
2024-03-05 19:25:16 +01:00
Olivier Goffart
945b3573cb tmlanguage: don't make everything a keyword
The `storage.type`  is for the type keyword such as `class` or
`function` or `var`, not for our own types. These are `entity.name.type`

Similarily, `variable.langguage` is for the variable keyword like `this`
or `self`

Reference: https://macromates.com/manual/en/language_grammars#naming_conventions

Also the "property"  scope was putting all identifiers in the binding as
a variable, which is just highlighting the whole binding
2024-02-28 15:22:37 +01:00
Tobias Hunger
be8fdd15d5 tree-sitter: Fix some MISSING nodes
The latest tree-sitter made it glaringly obvious
that some of our tests ended up containing
`MISSING` nodes, inserted where tree-sitter
expected a token that it did not see in the input.

Fix those bugs in the parser.
2024-02-22 13:17:41 +01:00
Tobias Hunger
bdf162b124 janitor: Reformat grammar.js (no change!) 2024-02-22 13:17:41 +01:00
ogoffart
a0eed4e58e Bump version number to 1.5.0 2024-02-20 17:33:11 +00:00
Montel Laurent
9ff926b351
Kate syntax highlighting: add missing @... as keywords (#4593)
* add missing @tr as keywords

* Add @children @image-url @linear-gradient @radial-gradient too
2024-02-19 17:49:39 +01:00
Olivier Goffart
d99c320ea4 Update tree sitter gramar for the 9slice 2024-02-13 14:46:27 +01:00
Tobias Hunger
a4cbd6607a
live preview: Use env var to turn on experimental features in live preview
Set `SLINT_ENABLE_EXPERIMENTAL_FEATURES` to anything but `0` in your
environment to turn on experimental mode.
2024-02-07 19:20:50 +01:00
Tobias Hunger
84ce4ee440 tree-sitter: Incorporate feedback from nvim review 2024-02-07 15:12:14 +01:00
Tobias Hunger
caf11f5334 tree-sitter: Polish the parser
* Remove stray `else` branch in `if` statement
* Rename `visibility` to `function_visibility`
* Rename `visibility_modifier` to `property_visibility`
2024-02-06 15:46:23 +01:00
Olivier Goffart
201a727931 vscode extension: make the "Q&A" link point to github discussion
The default otherwise is github issues, but we don't want people to ask questions as issues.

(This is the link shown in https://marketplace.visualstudio.com/items?itemName=Slint.slint&ssr=false#qna)
2024-02-04 09:17:10 +01:00
ogoffart
fec2b961db Bump version number to 1.4.1 2024-02-01 09:12:42 +00:00
Tobias Hunger
d6eff87cdb tree-sitter: Clean up grammar and improve queries
Clean up the `grammar.js` file and improve the queries.

Document how to inject `slint` into the rust parser to get highlighting
for the `slint!` macro in rust files.
2024-01-28 22:55:22 +01:00
Tobias Hunger
ea81f6b5e5 vscode: Improve regex-based highlighting
Do not match keywords in identifiers and update the easing types while
at it.

Fixes: #2762
2024-01-27 00:58:34 +01:00
Tobias Hunger
6a79867fd2 vscode: Improve language injection
We already handled `slint! { ... }`, now we also handle `slint! ( ... )`
2024-01-27 00:58:34 +01:00
Tobias Hunger
63b12874ae tree-sitter: Update for latest tree-sitter release
Tree-sitter got a bit less lenient, so gradients and @image-url needed
special rules to be added.
2024-01-26 18:14:33 +01:00
Tobias Hunger
ad72f5499c lsp: Add experimental feature flag and forward it to preview UI 2024-01-19 09:14:02 +01:00
Simon Hausmann
dc2dad9b5f doc: slint_lsp now also works on macOS
I've verified that locally.

cc #4240
2024-01-08 13:17:25 +01:00
Olivier Goffart
2ff9399e04
Slintpad: resize the cansvas after showing the UI
Right now, the winit window adaptor will force a px value on the width
and height once the ui is up.
We should then override that again with 100% after the UI is shown
2024-01-03 15:38:06 +01:00
ogoffart
b081c489d6 Bump version number to 1.4.0 2023-12-11 11:21:37 +00:00
ogoffart
b9255ab8e2 Bump version number to 1.3.2 2023-12-01 08:05:15 +00:00
Olivier Goffart
d7368f732e vscode: add default to false
Asked in https://github.com/slint-ui/slint/pull/4000#discussion_r1404258497
2023-11-24 14:08:06 +01:00
Olivier Goffart
26e8d308b7 LSP: rename and fix the hide toolbar option
- rename the command line option to --no-toolbar
 - Make it default to not hide the toolbar (so it is visible by default)
2023-11-24 14:08:06 +01:00
Tobias Hunger
548f10be2b lsp: Add option to show/hide preview ui
... and use that option in VSCode configuration.
2023-11-23 20:44:06 +01:00
ogoffart
0a5bf6c37b Bump version number to 1.3.1 2023-11-23 07:47:07 +00:00
Tobias Hunger
06dbf73d7a vscode: Make icons load in WASM preview mode again
Fixes: #3857
2023-11-08 17:50:18 +01:00