ide

HolyIDE: an editor and a workbench for HolyPHP, written in HolyPHP on top of HolyHTML. The library is the whole IDE except the window, which is why all of it is tested without one.

stdlib — embedded text buffer + undo syntax + completions explorer, tabs, palette runs hphp from the IDE

Two halves, one import

FileWhat it is
ide/editor.hphpthe document model: lines, caret and selection, editing keys, undo/redo, the syntax tokenizer, the completion vocabulary
ide/workbench.hphpthe chrome: explorer tree, tabs, code pane, terminal and problems panel, status bar, command palette, key table, runner — rendered to HTML and handed to an HtmlView
holyide/holyide.hphpthe window: one canvas, forwarded events, a frame timer. Not part of the library — it is the ~140-line app around it.

The editor on its own

The buffer, the caret and the editing operations have no idea a screen exists. Load a file, type into it, undo, save — no window anywhere.

import "ide";

$ed = new IdeEditor();
$ed->load("holyide/holyide.hphp");
$ed->move("docstart", false);
$ed->type_char("/");
$ed->type_char("/");
echo substr($ed->line(0), 0, 20);   // //// ==== ...
$ed->undo_step();
echo $ed->status();         // undo/redo state, position, tokens

echo $ed->word_at_cursor();
foreach ($ed->completions("str", 8) as $w) { echo $w; }

The workbench, driven headlessly

The workbench owns state and renders it to HTML. A test — or your own tool — builds one with no canvas (0), opens a folder, lays the document out with ensure() and then reads boxes, clicks and key results. tests/positive/ide_workbench.hphp does exactly that.

import "ide";

$wb = new IdeWorkbench(0, 1180, 760, html_theme_dark());
$wb->open_root(".");
$wb->open("lib/ide/workbench.hphp");
$wb->ensure();                          // parse, style, lay out (no ink)

echo $wb->ed()->line_count() . " lines";
echo "code pane: " . $wb->ed_rows() . " rows x " . $wb->ed_cols() . " cols";

$wb->key(80, "", 1);                    // Ctrl+P: the file palette
$wb->key(0, "work", 0);                 // type a query
$wb->key(13, "", 0);                    // Enter: open the first match

Opening it in a window

hphp run holyide/holyide.hphp                 # the current folder
hphp run holyide/holyide.hphp ../my-project   # another one
hphp build holyide/holyide.hphp -o holyide.exe

The app forwards canvas events to key() / mouse(), pumps the running program from a frame timer, follows window resizes and acts on the one string that needs a window: "quit".

Keys

KeysAction
Ctrl+P / Ctrl+Shift+P / Ctrl+Ggo to file · all commands · go to line
Ctrl+S / Ctrl+K Ctrl+Ssave · save all
F5 / Shift+F5 / Ctrl+Rrun the active file · stop · run
Ctrl+Space / Tab / Entercomplete the word at the caret · accept · accept
Ctrl+`the terminal's command line
Ctrl+B / Ctrl+Jtoggle explorer · toggle panel
Ctrl+/ / Ctrl+D / Alt+↑↓toggle comment · duplicate line · move line
Ctrl+= / Ctrl+- / Ctrl+0zoom in · out · reset
Ctrl+Shift+Wquit

What the mouse does

What runs a file

Ctrl+R starts hphp run <file> through the runtime's proc_* pipe API, in the file's own folder. Output appears in the terminal panel; a failing compile is parsed into the problems list, and clicking a problem opens the file at its line.

The panel is also a terminal, in the small sense: a command line at the bottom, Ctrl+` or a click to focus it, Enter to run through cmd /c in the project folder, Up/Down for history, Tab to hand the keyboard back to the editor. It is a command line over pipes, not a TTY - no interactive prompt, no colours, no full-screen programs.

Status

The workbench is complete and tested headlessly: 100+ assertions cover the editor, the layout numbers, the palette ranking, tabs, the runner and the draw list. The window app exists and passes a pixel self-check (holyide --selftest). What is not there yet — search across files, git, a settings system, split editors, a debugger — is listed in STATUS.md at the repo root, next to the rest of the roadmap.