sKSP for VS CodeCompile SublimeKSP projects directly from VS Code, with sKSP syntax highlighting, function navigation, project-aware compilation, and compiler updates. The extension uses the real SublimeKSP compiler. It includes a compiler for offline use. Sublime Text is not required. Requirements
You do not need Node.js, npm, or additional Python packages to use the extension. Only compile source you trust: sKSP scripts can execute embedded Python. Install from a VSIX
Quick start
After that, compile while editing any fragment: the command compiles the project's main script, not just the file in the editor. A notification confirms success or reports a compilation error. Projects and entry pointsEach workspace folder has its own entry point. In a multi-root workspace, the active KSP file selects the project to compile. If the file is outside the workspace, or the active editor is not a KSP file, a project picker appears. The status bar shows the active project and entry point. Click it to compile. To change the main script, run sKSP: Select Project Entry Point. The selection is saved in that project's folder settings:
Files containing Where compiled code goesClipboardIf the script has no output pragma, compiled code is copied to your clipboard, ready to paste into Kontakt. Output filesTo write a file instead, add an output pragma to the main script:
The path is relative to the main script's directory. Create the destination directory before compiling. Output is written using Latin-1 encoding. When output paths are specified, the extension writes those files instead of copying code to the clipboard. Multiple output pragmas are supported. CommandsOpen the Command Palette and search for
Function navigationHover over a user-defined function name to see its declaration and source file. Cmd+click on macOS, Ctrl+click on Windows/Linux, or press F12 to jump to the definition. Right-click and choose Go to Definition also works. VS Code's mouse-modifier settings may change the click modifier. Navigation supports Definitions are searched within the active file's workspace folder, so another open project's matching function will not be selected. No compilation or entry-point selection is needed. Outside a workspace folder, only the current file is searched. Unsaved editor changes are included. If several definitions match, VS Code presents the available locations. This is source navigation, not compiler expansion: it does not resolve import aliases or generated function names, evaluate conditional compilation, or restrict results to imports of the configured entry point. Built-ins without a source declaration in the project do not have a navigation target. Saving changesThe main script is compiled from its current editor contents, including unsaved changes. Imported files are read from disk, just as in Sublime Text, so save edited imports before compiling. Imports and output paths are resolved relative to the main script, not the file you happen to be editing or the terminal's working directory. Errors and compilation outputCompilation errors appear in Problems and navigate to the original source line, including errors inside imported files. For full details, open View > Output and select sKSP. The output shows the entry point, compiler version, compilation errors, and saved output paths. Compilations can be cancelled from the progress notification. Only one compilation runs at a time in each VS Code window. Syntax highlighting and file associationsThe extension recognizes For
Alternatively, merge this into your workspace or user settings:
The compile shortcut is enabled only while the editor's language is sKSP. Compiler settingsOpen Extensions, find sKSP for VS Code, and choose Extension Settings from its gear menu. Defaults match Sublime:
Compiler options can be set per workspace folder. Source pragmas retain their normal precedence. Set sKSP: Python Path to the Python executable you want to use; this is separate from the interpreter selected by VS Code's Python extension. Compiler updatesThe extension checks for stable releases from nojanath/SublimeKSP when it activates and every six hours while active.
After an update or rollback, reload the window when prompted to apply the matching syntax highlighting. If the installed extension directory is read-only, the update fails explicitly instead of switching the compiler. Troubleshooting
Credits and licensePowered by SublimeKSP. This extension and its bundled compiler retain their applicable GPL license notices. |