Use the spec editor

The spec editor lets you create and edit P4 change specs and job specs directly in Visual Studio Code. Specs open as text documents in the editor, with save and refresh actions available in the editor toolbar.

Open a change spec

You can open a new change spec or edit an existing one.

  • To create a new changelist, from the View menu bar, open the Command Palette and select P4: Create changelist in editor.

  • To edit an existing changelist, right‑click the changelist in the Source Control view and select Edit Change Spec.

The change spec opens in the editor.

Save a spec

With the spec open in the editor:

  • Press Ctrl+S, or

  • Select Save Changelist in the editor toolbar.

The spec is saved and applied on the P4 Server.

Indentation in specs

Some fields in P4 specs require tab‑based indentation. Using spaces instead of tabs in these fields can cause the save operation to fail. The extension warns you when it detects spaces where tabs are expected.

This behavior is controlled by the following setting under Extensions > P4 VS Code:

  • Show Indent Warning: Show a warning when incorrect indentation is detected. Default: enabled.