Editors: write a comment on lines of a pull request in Revue, opened from your code editor #81

Closed
opened 2026-11-13 12:04:04 +01:00 by thatrichan · 0 comments
Owner

Some code editors can't ask for a comment's text themselves. Zed's extensions are headless (no input box, no panel), so the Zed companion (thatrichan/revue-companion#5) can only offer Revue: Add Pending Comment as a code action that hands the lines to Revue. Today revue LINK --file PATH --line N opens the pull request at that file and line, but the user then has to find the line and open the comment box themselves.

Ask

revue LINK --file PATH --line N [--start-line M] [--side LEFT|RIGHT] --write-comment opens the pull request at that file, scrolled to those lines, with the comment box open on them and focused, the same box Revue's own diff opens on those lines. What's written there becomes a pending comment (a draft / part of the pending review), as when written in Revue.

  • The lines are given as --comment gives them (--line, --start-line, --side), so a companion uses the same values for both.
  • A line the diff doesn't show (outside the hunks): the file opens at the nearest line with the comment box closed, and a note says why.
  • Revue comes forward, as for LINK --file … --line ….
  • A new editor N level in revue --version, so companions only offer it when Revue can do it.
  • docs/command-line.md → "What editors can ask" documents it.

Tests

The parsed request (lines, side), opening at a line in a hunk vs outside, and the editor level.

Some code editors can't ask for a comment's text themselves. Zed's extensions are headless (no input box, no panel), so the Zed companion (thatrichan/revue-companion#5) can only offer **Revue: Add Pending Comment** as a code action that hands the lines to Revue. Today `revue LINK --file PATH --line N` opens the pull request at that file and line, but the user then has to find the line and open the comment box themselves. ## Ask `revue LINK --file PATH --line N [--start-line M] [--side LEFT|RIGHT] --write-comment` opens the pull request at that file, scrolled to those lines, with the comment box open on them and focused, the same box Revue's own diff opens on those lines. What's written there becomes a pending comment (a draft / part of the pending review), as when written in Revue. - The lines are given as `--comment` gives them (`--line`, `--start-line`, `--side`), so a companion uses the same values for both. - A line the diff doesn't show (outside the hunks): the file opens at the nearest line with the comment box closed, and a note says why. - Revue comes forward, as for `LINK --file … --line …`. - A new `editor N` level in `revue --version`, so companions only offer it when Revue can do it. - `docs/command-line.md` → "What editors can ask" documents it. ## Tests The parsed request (lines, side), opening at a line in a hunk vs outside, and the editor level.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thatrichan/revue#81
No description provided.