Python+PySide6 desktop IDE for the Krypton
language. Talks LSP to kls.exe and shells out to kcc.exe to build
and run programs. Windows-only — macOS gets its own variant.
Krypton 2.0 ready. Works against the 2.0 toolchain (kcc.exe,
kls.exe, krypton_rt.dll). The native pipeline (kcc -o foo.exe)
is the default build path; F5 invokes it directly. The optional
Krypton-side run.k shell IDE inside this repo doubles as a
long-running 2.0 reference program — it spawns kls.exe + a
backend, pumps both via a 100ms timer, and benefits from
gcCollect() cycles to keep memory bounded.
- Multi-tab editor with line numbers + dark theme + syntax highlighting
- LSP integration (kls.exe) — squiggles, completion, debounced didChange
- File tree (left), Output / kls log (bottom)
- Run button —
kcc.exe -o build/file.exe file.k && file.exe - Per-session restore (open folder, open tabs, active tab)
- Document outline panel — TODO, kls already returns DocumentSymbol
- Find/Replace — TODO
- Multi-cursor — TODO (would need QScintilla)
- Settings dialog — TODO
pip install -r requirements.txtPySide6 6.6+. No other deps.
cd kcode-win
python main.pyFirst run probes for kcc.exe and kls.exe in:
C:\Users\brian\Documents\GitHub\krypton\(dev checkout)C:\Program Files\Krypton\C:\Program Files (x86)\Krypton\PATH
If it can't find them, paste explicit paths into
%APPDATA%\kcode-win\settings.json:
{
"kcc_path": "C:\\path\\to\\kcc.exe",
"kls_path": "C:\\path\\to\\kls.exe"
}(File auto-creates after first launch.)
| Key | Action |
|---|---|
| Ctrl+O | Open file |
| Ctrl+S | Save |
| F5 | Build + run current file |
| Shift+F5 | Stop running process |
| Ctrl+Space | Trigger completion |
main.py
├─ FileTreePane (file_tree.py) QFileSystemModel + QTreeView
├─ QTabWidget
│ └─ CodeEditor (editor.py) QPlainTextEdit + line gutter
│ ├─ KryptonHighlighter (highlighter.py)
│ └─ → LspClient
├─ OutputPanel (output_panel.py) QTabWidget(Output, kls log)
├─ KryptonRunner (runner.py) kcc.exe → built.exe via QProcess
└─ LspClient (lsp_client.py) kls.exe stdio JSON-RPC
├─ didOpen / didChange / didClose
├─ documentSymbol → outline (TODO)
├─ completion → CompletionItem popup
└─ publishDiagnostics → squiggles
Don't have one? Build from the krypton 2.0 repo:
cd C:\path\to\krypton
.\lsp\build.batThat produces kls.exe in the krypton repo root, which kcode-win picks
up on the next launch.
kls.exe currently builds via the C path (the cfunc block in
stdlib/jsonrpc.k handles setvbuf+fread for binary stdin —
needs a C compiler once). Native build via Win32 ReadFile/WriteFile
is on the 2.1 list. The IDE doesn't care which path built kls.exe.
- Completion is position-insensitive — kls returns the same 150-item list regardless of cursor context. Filtering by prefix happens client-side in QCompleter. Good enough for MVP.
- Diagnostics tooltip — Qt's wave underline triggers tooltips on hover; if you don't see one, hover directly on the squiggle.
- No incremental sync — every keystroke debounces a full-buffer didChange after 150ms. Fine up to ~10K lines.