Kivy for Visual Studio Code
Language support for Kivy KV files powered by
kivy-lsp.
Features
- Completion for widgets, properties, values, IDs, and Python expressions.
- Diagnostics for KV syntax, properties, values, and method arguments.
- Semantic highlighting for KV structure and embedded expressions.
- Go to definition across KV and Python files.
- Python completion and navigation for statically known Kivy IDs.
- Translation-key completion, validation, and navigation.
- Basic TextMate highlighting before the language server is ready.
- KV indentation, brackets, comments, and word boundaries.
Requirements
- Visual Studio Code 1.120 or newer.
kivy-lsp 0.1.1 or newer.
Language-server installation
The extension automatically searches:
- The optional
kivy.server.path override.
- The current
PATH.
- The
uv tool executable directory.
- Common user executable directories.
.venv in the open workspace.
If the server is missing, choose Install with uv in the notification. The
extension installs the server and restarts it automatically. You can also run
Kivy: Install Language Server from the Command Palette.
For a manual installation:
uv tool install kivy-lsp
The server does not need to be present on VS Code's inherited PATH; the
extension can query uv for its executable directory. You can verify the
manual installation with:
kivy-lsp --help
Use the setting only when automatic discovery is unsuitable:
{
"kivy.server.path": "/absolute/path/to/kivy-lsp"
}
Commands
Kivy: Restart Language Server
Kivy: Install Language Server
Kivy: Select Language Server Executable
Kivy: Show Language Server Output
Settings
| Setting |
Default |
Purpose |
kivy.server.path |
Automatic |
Optional executable override |
kivy.server.arguments |
[] |
Additional server arguments |
kivy.trace.server |
off |
LSP message tracing |
Python integration
The extension also attaches kivy-lsp to Python files so it can provide
Kivy-specific self.ids completion and navigation. It does not replace
Pyright or another general Python language server.
Tree-sitter
Visual Studio Code does not require
tree-sitter-kivy.
The extension uses a TextMate grammar for immediate highlighting and receives
semantic tokens and diagnostics from kivy-lsp.
tree-sitter-kivy remains available for Neovim and other editors that support
Tree-sitter grammars directly.
Development
Install dependencies and compile the extension:
npm ci
npm run compile
Open this repository in Visual Studio Code and press F5 to start an Extension
Development Host.
Create an installable VSIX:
npm run package
Install it locally:
code --install-extension kivy-0.1.0.vsix
License
MIT