Editor support
The KScript extension adds errors as you type, completion, hover, go to definition, rename and highlighting for scripts and kscript serve pages. Install it into VS Code, Cursor, VSCodium or Windsurf:
| Command | What it does |
|---|---|
kscript ide install | Every editor it finds. |
kscript ide install cursor | Just one. |
kscript ide | List the editors it found. |
kscript ide uninstall | Remove the extension again. |
The extension works out types as it goes. $person. and $name-> offer the fields and methods of that value, including what your own functions return. Inlay hints show the types you didn't write, and thin lines divide a script into blocks like a notebook.
Press F5 in a script to debug it: it stops at your breakpoints, steps through a line at a time and shows every variable. See Debugging.
It runs kscript lsp from your installed kscript, so keep that current with kscript update. To use a different kscript, set kscript.server.path in the editor's settings. Every command and setting of the extension is listed in VS Code commands and settings.
Other editors
Other editors with LSP support work too. kscript ide config prints the settings to add:
| Command | What it does |
|---|---|
kscript ide config neovim | Also helix, sublime or emacs. |
kscript check <folder> reports the same problems on the command line, for CI. See the language server for how it works.