Skip to main content
The code editor shows every file in your project and lets you change them directly. Polymet checks your changes as you type and holds back Save while it finds errors. Every plan can open and edit code. Downloading the code is a separate feature, see Export your code.
The code editor with the file tree on the left and a component open in the editor

Open a file

  1. Click Code in the switch at the top left of the canvas (Canvas, Focus, Code, Backend).
  2. Pick a file in the file tree on the left.
If you open a file in Focus that has no preview, such as a utility file, click Open in Code. Some files, often prototypes, are drawn on the canvas by a second file. When that is the case, Show render and Show source appear above the editor to switch between the two.

Change and save

  1. Edit the file. You can change several files before saving.
  2. Save and Discard appear at the top of the editor.
  3. Click Save. A dialog lists every file you changed.
  4. Click Save again to confirm.
The save becomes a new version in your project’s history, so you can roll it back like any other. Discard asks first, then throws away every unsaved change. It cannot be undone. If you try to leave with unsaved changes, Polymet asks whether to discard them.

Errors block Save

While you type, Polymet checks that your code is valid and, for files shown on the canvas, that they still build. Problems show in the Errors panel under the editor, marked Syntax Error, Bundle Error or Error, with the file and line. Save stays off until they are fixed. Its tooltip says why: An empty file counts as an error (“Code cannot be empty”). To remove a file, delete it from the file navigator instead.

When the editor is read-only

Click into the editor to see why. The common reasons:
  • A generation is running. Wait for it to finish.
  • You have pending notes from Select. Send or remove them first.
  • You have unsaved changes in the visual editor. Save or discard them first.
  • You are looking at an older version. Switch to the latest one to edit.
  • The file is a plan. Plan files are read-only.