This extension for VS Code adds support for the Slint design markup language.
- Syntax highlighting
- Diagnostics from .slint files
- Live Preview of a .slint file
- Completion of properties
- Jump to definition (currently, only definition of Component)
You can install the extension directly from the Visual Studio Code Marketplace. Afterwards it is
automatically activated when editing files with the .slint
extension.
In addition to the usual code editing features such as completion and syntax highlighting, this extension also offers the ability to view a rendering of the file you're editing and update it on-the-fly when making changes.
You can issue the "Slint: Show Preview" command from the command palette when editing a .slint
file. This
will create a new top-level window that renders the file you're editing. Any changes you make are immediately
visible, it is not necessary to save the file.
Issues should be reported in the Slint issue tracker.
- Build the LSP
cargo build --bin slint-lsp
- run npm install in the vscode directory
cd editors/vscode
npm install
From another VS Code instance: Load this directory in VS code and then start debugging (Run -> Start Debugging). That will "debug" the vs code extension and create a new VS code window. The LSP server binary will be started if previously built
You can see the output in the output pane "Slint LSP" (that's the drop-down that usually shows "Tasks").
Alternatively, you can start vscode with the following options:
cd editors/vscode
code --extensionDevelopmentPath=$PWD ../..
If you want to load the web extension, add --extensionDevelopmentKind=web
To create a .vsix
package for local installation:
-
Follow the setup steps above to build the lsp binary and install npm dependencies.
-
Create a
.vsix
package (needsvsce
installed)
npm run local-package
- Install the
.vsix
file with
code --install-extension slint-*.vsix
- Reload your VS code windows
Note that the resulting .vsix
package contains your locally built debug LSP server. It is not suitable for distribution.