Code viewer

The code viewer is a read-only interface in Code Workspaces for browsing, comparing, and sharing the committed state of a repository. Use it as a consistent reference for code developed in Foundry editors, local development environments, or AI-assisted workflows.

The code viewer shows the committed state stored in the repository. Editor changes appear only after they are committed and synchronized. It is available alongside VS Code, JupyterLab®, and RStudio® Workbench. You can use the code viewer without creating or starting an editor workspace.

Browse code

To open the code viewer:

  1. Open Code Workspaces.
  2. Open a repository.
  3. Select the Code viewer tab in the page header.

Use the code viewer to:

  • Browse files on a branch, tag, or commit.
  • Search by file name or across file contents.
  • View supported files, including Markdown files and Jupyter® notebooks, as rendered documents or source code.
  • Preview published functions in function repositories.

Browse files and view committed code in the code viewer.

Compare changes

To compare two points in repository history:

  1. Select Compare changes.
  2. Choose a branch for each side of the comparison, then select a commit or tag.
  3. Select a changed file to view a side-by-side diff.

Compare two repository references in a side-by-side diff.

Share code

Links to branches change as the branch advances. To share a stable reference to an exact commit and line range:

  1. Select a line number. To select a range, drag across the line numbers or hold Shift while selecting another line.
  2. Open the Line actions menu next to the selection.
  3. Select Copy permalink.

Copy a permalink to selected lines.

Continue in an editor

To make changes, select the tab for an editor such as VS Code, Jupyter, or RStudio.

By default, when you open a stopped VS Code workspace, the code viewer opens while its workspace session starts in the background. The VS Code tab icon shows the workspace status. The code viewer remains open when the workspace is ready, so select VS Code to continue editing.

To disable this behavior, select Settings > Preferences, then clear Open code viewer while workspace is loading.