Skip to content
PaskalCPP
Tools

The editor

The PaskalCPP Editor: an Electron application whose editing surface is Monaco, driving the compiler's own language server and debugger.

Starting

pcpp editor [files] starts the editor, res\editor\editor.exe beside pcpp.exe, and opens the files given.

  • The editor runs one pcpp --lsp for its whole lifetime: every language feature comes from the compiler's own frontend. See The language server.
  • Everything the editor keeps lives in data\ beside editor.exe, never in AppData: state.json (the explorer's folders, open tabs, window and layout, the toolbar's level and target, the debug host per dll) and settings.json.
  • File > Show Examples shows the bundled examples folder (res\examples) in the explorer; it is on by default.

Menus and keys

MenuCommands
FileNew (Ctrl+N), New Project..., Open (Ctrl+O), Open Folder, Close All Folders, Show Examples, Save (Ctrl+S), Save As (Ctrl+Shift+S), Save All, Rename, Quit
EditUndo, Redo, Cut, Copy, Paste, Select All, Find (Ctrl+F), Replace (Ctrl+H), Format Document (Shift+Alt+F)
GoGo to Symbol in Workspace (Ctrl+T), Show Call Hierarchy (Shift+Alt+H)
BuildBuild (Ctrl+B), Run (Ctrl+F5), Stop (Shift+F5), Pack (Ctrl+Alt+B, in a project)
DebugStart Debugging / Continue (F5), Step Over (F10), Step Into (F11), Step Out (Shift+F11), Pause (F6), Stop Debugging
Viewzoom, full screen, developer tools
PreferencesFormat Settings
HelpReport Issue, About PaskalCPP

Build and Run

Build and Run take a saved .pcpp file (an unsaved one is refused) and run pcpp <file> -opt <level> -t <target> --defaults --progress in pcpp.exe's folder, so the program builds into the same output folder as a console build there. The command line is the first line of OUTPUT.

  • The toolbar's optimize level is one of debug, safe, fast, small, and its target one of x86_64-windows-gnu, x86_64-linux-gnu; the first of each is the default. With --defaults the source's own @optimize / @target wins over the toolbar. A level saved under a retired name (release_fast) is read back as its new one (fast).
  • Run adds -r --terminal <pipe>: the program's terminal is the TERMINAL tab (its keys, its size), while pcpp's own lines stay in OUTPUT.
  • The TERMINAL tab copies and pastes as VS Code's terminal does: Ctrl+C copies when text is selected (with nothing selected the program gets ^C), Ctrl+Shift+C always copies, Ctrl+V and Ctrl+Shift+V paste into the program's input, and a right-click opens Copy / Paste.
  • One build or run at a time, and none while a debug session runs; Stop ends the compiler and the program it started.

Projects

A folder in the explorer whose project.toml is valid is a project (see Projects); the editor asks pcpp --project-info and never reads project.toml itself. Its root carries a badge with its type, and its output folder is dimmed and starts collapsed. An invalid project.toml leaves a plain folder whose tooltip lists pcpp's reports.

  • For a file inside a project, Build and Run run pcpp build <root> whatever file is active, and Build > Pack runs pcpp pack <root>. Debug debugs the project's main module: an exe on its own, a dll in the host picked once for the project; a lib project builds and packs but cannot run or debug.
  • File > New Project... asks for a name, a type (exe, dll or lib) and a parent folder, runs pcpp init there, then adds the folder to the explorer and opens its main module; a failure stays in the dialog with pcpp's lines.

Panels

The bottom panel has the tabs OUTPUT, TERMINAL, PROBLEMS (with a count), CALL HIERARCHY and DEBUG. OUTPUT shows pcpp's text without colour codes and redraws its in-place progress line.

Settings

Preferences > Format Settings opens settings.json in a tab, created with the defaults the first time; saving it applies it at once.

KeyDefaultRange
indentSize21..8
useTabsfalse
spaceAroundAssigntrue
spaceAroundOperatorstrue
spaceAfterCommatrue
spaceBeforeColonfalse
spaceAfterColontrue
maxBlankLines10..9
trimTrailingWhitespacetrue
finalNewlinetrue
maxLineLength8060..200
formatOnSavefalse

Reporting an issue

Help > Report Issue opens the form at paskalcpp.org/report in its own window, with the editor's version and platform filled in. A right-click on a PROBLEMS row offers Report This Error, which also fills in that row's diagnostic code.

The report window stays on the form's site; a link to github.com opens in the browser. When the form cannot be reached the editor says so and gives the address.