KScript docs
EN

VS Code commands and settings

Every command and setting of the KScript extension for VS Code. Install it with kscript ide install. Everything the editor does as you type, such as completion and quick fixes, comes from the language server in kscript, so other editors get it too: see Editor support.

Commands

Run these from the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS). In a workspace with several folders, the project commands use the folder of the file you have open, and save its changed files first.

CommandKeyWhat it does
KScript: Open Install GuideOpens the install guide. It works in an empty window, before KScript is installed.
KScript: Restart Language ServerRestarts the language server, such as after changing a setting. It restarts by itself when kscript is updated.
KScript: Show Language Server OutputShows the language server's log. Clicking KScript in the status bar does the same.
KScript: Run ScriptCtrl+F5Saves the open script and runs it in the terminal. Runtime errors link to the file and line. A new file that hasn't been saved yet runs too.
KScript: Debug ScriptSaves the open script and runs it in the debugger, stopping at its breakpoints. F5 does the same, and Debug above a script's first line. See Debugging.
KScript: Run Project (main.kscript)Runs kscript run in the project's folder: its main script (app.main, main.kscript or index.kscript). Run Script does this too when no script is open.
KScript: Run TestsRuns kscript test for the project in a task.
KScript: Run Tests in This FileRuns the tests in the open test file (*.test.kscript or *.test.ks.xml). Each test is also in the Testing view, where it can run on its own.
KScript: Serve SiteRuns kscript serve in the project's folder.
KScript: Check This FileSaves the open script, runs kscript check on it and lists what it finds in Problems. It works on a file outside a project too.
KScript: Check ProjectRuns kscript check on the whole project and lists what it finds in Problems.
KScript: Format ProjectRuns kscript fmt on the whole project.
KScript: New ScriptOpens a short script that runs as it is, as a place to start. Also in File > New File….
KScript: New Project…Asks for a name and a folder, runs kscript make project and offers to open it.
KScript: Open DocsRuns kscript docs, which opens these docs in your browser. The Open docs link in a hover opens them on what the hover is about.

Settings

Change these in VS Code's settings (Ctrl+,), or in .vscode/settings.json for one project. The lint and format rules a project uses are in kscript.json instead, so everyone on the project gets the same ones.

SettingDefaultWhat it does
kscript.server.pathemptyThe kscript executable that runs the language server. Leave empty to use the installed KScript (~/.kscript/bin, %LOCALAPPDATA%\Programs\kscript, then your PATH). A KScript.dll from a source build also works (run with dotnet). ~ and ${env:NAME} are expanded.
kscript.server.args["lsp"]Arguments that start the language server.
kscript.pages.enabledautoCheck KScript in .html and .md pages (sites run with kscript serve). One of auto (check .html and .md files in folders that look like a kscript serve site (_components/, _layout.html, _layouts/ or kscript.json)), always (always check .html and .md files), never (only check KScript scripts).
kscript.trace.serveroffLog the messages between VS Code and the language server. One of off, messages, verbose.
kscript.autoCloseTagstrueAdd the end tag when you finish typing a start tag in a .ks.xml script: <echo> becomes <echo></echo>.
kscript.blocks.dividerstrueDraw a thin line between the top-level blocks of a script (functions, loops and comment-headed sections), like cells in a notebook.
kscript.problems.workspacetrueList problems for every KScript file in the project, as kscript check reports them, not only for open files.
kscript.codeLens.enabledtrueShow Run above a script, Run test above each test and how many times each function is used.