Skip to main content

Code Editing, Build, Terminal and Documents

What This Chapter Covers​

This chapter covers the general development tools: how to edit, build and run the C, C++ and Rust sources in the project's code folder, the integrated terminal, and the Markdown document editor for the doc folder.

  • Audience: developers who write and build application code inside PAIO
  • Prerequisite: a project is open
  • On a remote target (an SSH host or a vECU container), read 17. Remote Development (SSH, vECU Container) alongside this chapter.

16.1 The Code Editor (C / C++ / Rust)​

16.1.1 Which Files Open Here​

  1. Click the top icon of the left rail (tooltip Design) to open the EDITOR view.
  2. Expand the CODE section (files of code/) or the DOC section (files of doc/).
  3. Double-click a file to open it.

The CODE and DOC sections of the EDITOR view

① The rail icon, ② the CODE header, ③ New File, New Folder, Collapse All, ④ the DOC header.

The extension alone decides which editor opens, in any folder.

16.1.2 Layout and Shortcuts​

The PROBLEMS panel sits below the edit area. When a build starts, an Output panel appears below that.

A C file opened in the code editor

① A warning squiggle on line 2, ② PROBLEMS, ③ the editor bar, ④ IntelliSense: Ready.

ShortcutAction
Ctrl+BBuild: compiles the current file only
Ctrl+F5Build & Run: detects the project type, then builds and runs
Ctrl+SSave
F12Go to definition

16.1.3 Language Servers (LSP)​

Completion, hover, go to definition and formatting come from language servers: clangd for C and C++, rust-analyzer for Rust. Both ship with the app. Rename (F2) and quick fixes are not provided.

Once a C or C++ file is open, the status bar shows the item IntelliSense. When completion and diagnostics quietly stop working, click it and choose Restart IntelliSense.

The IntelliSense menu in the status bar

① IntelliSense: Ready, ② its menu with Restart IntelliSense.

code/Cargo.toml is generated automatically and overwritten, so keep a hand-managed Cargo project in a subfolder.

16.1.4 The PROBLEMS Panel​

The diagnostics list, grouped by file. Click an entry to jump to that location.

The PROBLEMS panel expanded

① The header with its count, ② the file group, ③ an entry.

Errors from the code editor's Build and Build & Run do not arrive here; they appear in the Output panel. Compiler diagnostics from Build ECU do arrive, with the tag BUILD.

16.1.5 Saving and External Changes​

Press Ctrl+S to save. When an open file with unsaved edits changes on disk, the editor keeps your edits and shows a warning; saving then writes them over that change.

16.2 Build and Run​

Build and Build & Run build the open file, or its CMake or Cargo project, in the environment of the window. An ECU is built in its vECU with Build ECU: see 17.9.

16.2.1 Build and Build & Run Are Different​

  • Ctrl+B (Build) compiles only the file that is currently open, with gcc or g++.
  • Ctrl+F5 (Build & Run) is the project-level build.

Both save unsaved edits first.

16.2.2 The Order Build & Run Uses to Detect a Project​

From the current file's folder upward, PAIO uses the first match: a CMakeLists.txt (configure and build, no run), a Cargo.toml (cargo run), or a single .c / .cpp file (compile, then run).

16.2.3 Commands Executed and Their Output​

The build type is fixed to Debug. The Output panel shows the command, the result in real time, and Process exited with code <number>.

A Rust project built and run with Build &amp; Run

① The tab where Ctrl+F5 was pressed, ② the Output panel.

There is no button to cancel a build in progress.

16.2.4 The Toolchain Used​

The Rust toolchain ships with the app. PAIO uses a bundled tool first and falls back to the tool on the system PATH.

16.3 The Integrated Terminal​

16.3.1 Opening and Operating It​

  1. Press Ctrl+` to show or hide the terminal panel. A new terminal starts in the project folder.
  2. To start in a particular folder, right-click it in the Explorer and choose Open in Integrated Terminal.

The integrated terminal open

① Decrease, Increase, New Terminal, Split Terminal, Kill Terminal, Close Panel. ② The terminal list. ③ cargo --version answered in the terminal.

16.3.2 Which Shell Opens​

A vECU container window opens the shell inside the container, and an SSH window the remote SSH shell. The default local shell is PowerShell on Windows.

16.3.3 The Bundled Toolchain and PATH​

A local terminal has the bundled toolchain paths on PATH, so you can type cargo directly. This does not apply to SSH shells; build tools for remote targets are covered in 17.6.

16.4 The Markdown Document Editor​

16.4.1 Editing and Preview​

Any .md file opens in the Markdown editor, with a live preview beside it.

The Markdown editor and preview side by side

① The formatting toolbar, ② the three view buttons, ③ a mermaid block drawn in the preview.

Apply bold and italic with the toolbar buttons: Ctrl+B and Ctrl+I do not format text here.

16.4.2 Diagrams​

Set a code block's language to mermaid, drawio, zenuml or plantuml and the preview draws it. Only PlantUML needs an internet connection.

16.5 Other Viewers and Editors​

The extension decides the editor: HTML preview, image viewer, XML editor, read-only JSON view for PAIO's own documents, and a text editor for other text files. Open the design editors from the DESIGN and MODULE sections of the EDITOR view, not from model files in the Explorer.