Revue
DocumentationBrowsing code

Browsing code

Read a pull request's whole code, or a repository's at any commit, with a file tree, tabs, search and go to definition, without cloning anything.

The Code tab shows every file of the repository, not only the ones a pull request changed. It's there in a pull request (the code at its head commit) and in a repository (the code at whichever commit or branch you're looking at). Revue fetches the code for you the first time you open the tab, then works from its own copy, so it's fast and works the same on GitHub, Bitbucket and Forgejo.

Open the Code tab#

  • In a pull request, click the Code tab, or press 5.
  • In a repository, click Code, or press 5. You can also click the Browse the code at this commit button next to a commit you picked under Commits.
  • From the diff, right-click a line and pick Reveal in code: the Code tab opens at that line. The changed-files list has Reveal in code too, for a file or a folder.

The first time, you see Downloading the source at 1a2b3c4… with a progress bar. After that the tab opens at once.

Want the code in your own tools instead? The Open in an editor, Open in a terminal, Open in an AI assistant and Open in your file manager buttons in the header open the same code (or your worktree of the branch). With the Code tab showing, the editor also opens the file you have open. See Clones, worktrees and opening in your tools.

Where the code comes from#

You don't need a clone. Revue downloads the code at that commit once and keeps it in its cache.

If you've set a local clone for the repository (see Clones, worktrees and opening in your tools), Revue downloads nothing. It checks the commit out of your clone instead, fetching the commit into it first when it's missing. When you already have the branch checked out somewhere, Revue reads the commit's files from there, as the commit has them: the line under the tree says From your checkout at … (branch), and Local changes not shown if you have uncommitted edits or local commits. Revue never changes, resets or writes to your own checkout.

Advanced: where the code is kept, and how much
  • Downloads and checkouts live in Revue's cache folder, under sources/<owner>-<repo>/:

    SystemCache folder
    Linux~/.cache/revue/ (or $XDG_CACHE_HOME/revue/)
    macOS~/Library/Caches/revue/
    Windows%LOCALAPPDATA%\revue\
  • Each checkout is a short folder: pr-12-my-branch-1a2b3c4d for a pull request's head, commit-1a2b3c4d for a commit browsed in a repository.

  • Revue keeps the 3 most recently used pull-request checkouts and the 3 most recently used commit checkouts per repository, and deletes older ones. Settings → Storage → Source checkouts by repository lists them; click one to open its folder.

  • With a local clone, a checkout in the cache is a git worktree of your clone (detached at the commit). Pruning a checkout removes the worktree from the clone too. A pull request's checkouts from your clone also go once it's merged or closed and when you close its tab, and any checkout from your clone goes after 7 days unused, but never while a Code tab shows it (see Clones, worktrees and opening in your tools).

  • A pull request from a fork works: the code is fetched from the fork when the main repository doesn't have the commit.

  • If checking out from your clone fails, the tab shows the error with Retry and Download the source instead (downloads that commit from the service, this once).

Large files#

Files over 2 MB are left out of downloaded code. They're still listed in the tree, dimmed, with skipped · 3.4 MB; click one to download just that file and open it. (Checkouts from your clone have every file.)

Per service: Bitbucket browser sign-ins

GitHub, Forgejo and Bitbucket with an API token send the code as one archive. Bitbucket accounts signed in through the browser (OAuth) can't download that archive, so Revue fetches the files one by one through Bitbucket's API instead:

  • Before the first download, Revue asks Skip large files?: non-text files over 1 MB (images, videos, fonts, archives…) can be left out and downloaded later with a click. Pick Keep them or Skip large files, and tick Remember for all repositories to stop asking. Change the answer later in Settings → Storage → Large files in sources (Ask, Skip them, Keep them).
  • A repository with more than 2,000 files is too big to fetch this way (Bitbucket allows about a thousand API requests an hour). Revue says so and suggests signing that account in with an API token instead (Settings → Accounts). See Bitbucket Cloud.

The file tree#

The left side lists the repository's folders and files. Click a folder to open or close it. Folders with only one folder inside are shown as one row (src/lib/utils).

At the top:

  • Go to file… opens the file picker.
  • Find in files… opens Find in Files.
  • Changed only (12) (in a pull request) lists only the files the pull request changed.
  • The target button shows the open file in the tree (Alt+F).
  • The eye button shows or hides ignored files (the ones in Settings → Ignored files, see Settings reference). Your choice is remembered.

In a pull request the tree marks the changes like the Files tab does: changed files take their status colour and icon, folders holding changes get a dot, renamed files show their old name struck through, and files the pull request deleted are listed struck through. Hover a file for how it changed (Changed in this PR: +12 −3). Clicking a deleted file shows its diff in the Files tab.

Right-click a file for Open in New Tab and Show history; right-click a folder for Show history.

Reading a file#

Click a file to open it: read-only, with syntax colours and line numbers. The bar above it shows the file's path, how the pull request changed it (Added in this PR, Renamed, Changed +12 −3), the commit (at 1a2b3c4), and buttons for Definition, History and References.

  • Ctrl+F (Cmd+F on macOS) searches the open file.
  • Put the cursor on a name and every other place it appears in the file lights up.
  • In a pull request, the gutter marks the lines it added, changed or removed. Ctrl+↓ / Ctrl+↑ jump to the next or previous change in the file. Right-click a changed line and pick Show in Files (the PR's diff) to see it in the diff.
  • Right-click anywhere for Go to Definition, Find References, Copy and Select All.

Tabs#

A single click opens a file in place of the previous one; its tab is in italics. Double-click a file (or its tab), or pick Open in New Tab, to keep it open as a tab. Each tab remembers where your cursor was. Close a tab with its × or a middle click.

Pictures, fonts and Markdown#

Some files show as something better than text:

  • Images show as the picture, with its size. SVG files show the image, with an Image / Source switch. With an SVG's source showing, its image can sit beside the code where there's room.
  • Markdown opens as source; switch to Preview to read it rendered. Revue remembers your choice for the session.
  • Fonts show a sample in their own face.
  • PDFs, videos, audio, archives and other binary files show a card with Open (opens it in your system's app) and a button to copy its path.

Go to a file#

Press Ctrl+P (Cmd+P on macOS), or click Go to file…, and type part of a name. Matching is fuzzy, and a space can stand for a /: order cloudformation finds infra/order/cloudformation.yaml. Use ↑ / ↓ and Enter to open, Esc to go back to the file you were in.

Advanced: how the picker ranks files
  • Matches in the file name rank above matches elsewhere in the path.
  • In a pull request, each row shows how the file changed, whether you marked it viewed, and its threads and drafts. A renamed file is also found by its old path.
  • With nothing typed, the first 500 files are listed; at most 500 matches are shown.
  • The picker opens empty every time.

Find in Files#

Press Ctrl+Shift+F (Cmd+Shift+F on macOS), or click Find in files…, and type. Results appear as you type, one row per matching line, with the selected match's file previewed below. Press Enter or click Open to go there.

It searches Revue's copy of the code, so it works for any commit on any service, no code search needed. If you had text selected in a file, the search starts with it.

OptionWhat it doesKey
Match caseUpper and lower case must matchAlt+C
WordsOnly whole wordsAlt+W
RegexThe text is a regular expressionAlt+X
File maskOnly files matching the mask (see below)
Include ignored filesAlso search the files in Settings → Ignored files
Changed files / Whole repositoryIn a pull request: its changed files (the default), or everything

The dialog keeps your query and options between openings.

Advanced: file masks, limits and where matches open
  • A file mask is a comma-separated list of patterns, for example *.rs, !*.lock. A ! in front excludes. With only exclusions, everything else is searched.
  • Patterns work like .gitignore: a pattern without / matches the file name in any folder (*.snap, package-lock.json); a pattern with / matches the whole path (src/*.gen.ts, dist/**). * matches within one folder, ** across folders, ? one character.
  • The search stops at 1,000 matching lines (shown as "1000+"). Binary files are skipped, and very long lines are cut around the match.
  • The summary says how many ignored files were skipped.
  • A bad regular expression shows Bad regular expression: … instead of results.
  • In a pull request, a match opens in the diff when the diff shows that line, else in the Code tab. In a repository it opens in the Code tab.
  • In a repository, the dialog searches the commit the Code tab shows (at 1a2b3c4, or main at 1a2b3c4).

Go to definition and find references#

Revue can take you from a name to where it's defined, and list everywhere it's used:

  • Go to definition: F12, the Definition button, or Ctrl+click the name (Cmd+click on macOS). Holding Ctrl (Cmd) underlines names you can follow. On an import, it opens the imported file.
  • Find references: Shift+F12 or the References button. The list opens in the Find in Files dialog, the definitions first. Ctrl+clicking a definition itself also lists its references.
  • From the diff: select or right-click a name and pick Go to definition of …. The Code tab opens at its definition in the pull request's head.

When several definitions fit, Revue lists them to pick from. When there's none, a note says No definition found for ….

What works without a language server#

Out of the box, Revue builds its own index of the code, with nothing to install. It understands TypeScript, JavaScript (with JSX), the scripts in Svelte and Vue files, Rust, Python and Go: definitions, imports (including tsconfig paths, workspace packages, Rust modules and crates, Python modules, Go packages) and re-exports. For other languages it falls back to finding declarations by text.

The index is a good guess, not a compiler. For exact answers in more languages, turn on language servers: Revue then asks the language server first and uses its own index when the server has no answer.

FeatureWithout a language serverWith one
Go to definitionBuilt-in index (5 languages) or text searchThe server's answer, the index as fallback
Find referencesWhole-word matches in files of the same languageThe server's answer
Highlight the name under the cursorWhole-word matches in the fileThe server's highlights (reads and writes in different colours)
Ctrl/Cmd+hover underlineBuilt-in indexBuilt-in index (the click then asks the server)

Hover information, symbol outlines and blame aren't part of the Code tab.

The status at the right of the file's bar shows each language server for the file, with a dot for its state. Click it to see them, start, stop or restart one, and open the settings. See Language servers.

Advanced: index limits
  • The index is built in the background when the code is ready; until then a lookup says Still indexing the code: try again in a moment.
  • Files over 1 MB are left out (minified and generated files), as are .min.js files. At most 40,000 files are parsed.
  • At most 50 definitions are offered for one name, and at most 2,000 references listed.
  • Revue keeps the indexes of the last 4 checkouts in memory.
  • Without a clone, the code has no dependencies installed: definitions inside libraries aren't found, by the index or by a server.

Going back and forth#

Every jump is remembered: definitions, references, files you opened, and long moves of the cursor within a file (10 lines or more). Walk back and forth through them with:

  • Alt+← / Alt+→ (Option+← / Option+→ on macOS),
  • the mouse's back and forward buttons over the code,
  • the Back and Forward arrows left of the file's name.

While you're in the code, these keys stay in the Code tab. Elsewhere, at the end of the Code tab's history they go back to the previous page of the app. Revue remembers the last 100 places.

File history#

To see the commits that changed a file, click History in the file's bar, or right-click a file or folder in the tree and pick Show history. The newest commits come first; pick one to see what it changed in that file. Load older fetches more.

In a repository's Code tab, a commit in the history has Open file at this commit (or Browse the code at this commit for a folder), which shows the code as it was then. A pull request's Code tab always shows its head commit.

Click the arrow at the top left (Back to the file) to return.

Advanced: where the history comes from
  • With a local clone, the history is read with git: fast, offline, and it follows the file across renames (from your clone, across renames). Entries from before a rename show the old path. Each commit shows its lines added and removed.
  • Without one, it comes from the service a page at a time (from the service).
  • The history runs back from the commit the Code tab shows.
  • The repository's very first commit can be compared only from a clone; the services have nothing to compare it with.

Guide: Find where a function in a pull request is defined#

  1. Open the pull request and find the function's name in the diff.
  2. Right-click the name and pick Go to definition of ….
  3. Read the definition in the Code tab.
  4. Press Shift+F12 to see everywhere it's used.
  5. Press Alt+← until you're back where you started.

Guide: Look at a file as it was last month#

  1. Open the repository and click Code.
  2. Open the file, then click History.
  3. Pick a commit from around that time to see what it changed.
  4. Click Open file at this commit.

Keyboard shortcuts#

Ctrl is Cmd on macOS for the first three. For every shortcut in the app, see Keyboard shortcuts.

KeysWhat it does
Ctrl+PGo to a file
Ctrl+FSearch the open file
Ctrl+Shift+FFind in Files
F12Go to definition
Shift+F12Find references
Ctrl+click (Cmd+click on macOS)Go to definition, or references from a definition
Alt+← / Alt+→Back / forward
Alt+FShow the open file in the tree
↑ / ↓, EnterMove and open in the tree (after Alt+F or a click on a folder)
Ctrl+↓ / Ctrl+↑Next / previous change in the file (pull requests)
Ctrl+Alt+Shift+↓ / ↑The same, for macOS, where Ctrl+↑ opens Mission Control
5Open the Code tab (when not typing)