Skip to content

Use Cursor --goto for file targets with line/column suffixes#91

Merged
juliusmarminge merged 2 commits intomainfrom
codething/a38b78be
Feb 27, 2026
Merged

Use Cursor --goto for file targets with line/column suffixes#91
juliusmarminge merged 2 commits intomainfrom
codething/a38b78be

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Feb 26, 2026

Summary

  • update resolveEditorLaunch to detect :line and :line:column suffixes in file targets
  • pass --goto when launching Cursor with line/column-qualified targets
  • keep existing launch behavior unchanged for other editors and plain file paths
  • add tests covering Cursor launches for both :line and :line:column target formats

Testing

  • Added unit test: apps/server/src/open.test.ts verifies Cursor uses --goto for /tmp/workspace/AGENTS.md:48
  • Added unit test: apps/server/src/open.test.ts verifies Cursor uses --goto for /tmp/workspace/src/open.ts:71:5
  • Existing behavior check: non-Cursor/editor paths remain unchanged by logic in resolveEditorLaunch
  • Not run: full project lint/test suite in this environment

Note

Low Risk
Low risk: small, isolated change to resolveEditorLaunch argument construction for the cursor editor plus a couple of unit tests; main risk is edge-case mis-detection of :line[:col] suffixes affecting launch args.

Overview
Updates resolveEditorLaunch to detect :<line> / :<line>:<column> suffixes and, when launching the cursor editor, prepend --goto so Cursor jumps to the specified position.

Adds unit coverage for both line-only and line+column Cursor targets, and tweaks chat markdown code styling by explicitly setting font sizes for inline and block code.

Written by Cursor Bugbot for commit 76b290d. This will update automatically on new commits. Configure here.

Note

Prefix '--goto' to 'cursor' editor launch args in apps/server/src/open.ts when targets include ':' or '::' to honor file position on darwin

Add LINE_COLUMN_SUFFIX_PATTERN and shouldUseGotoFlag and modify resolveEditorLaunch to insert --goto for 'cursor' when the target includes a line or line:column suffix; add a test in open.test.ts; adjust chat code font sizes in index.css.

📍Where to Start

Start with the resolveEditorLaunch logic in open.ts, then review the regex in LINE_COLUMN_SUFFIX_PATTERN and the shouldUseGotoFlag helper; validate with the new test in open.test.ts.

Macroscope summarized 76b290d.

Summary by CodeRabbit

  • Bug Fixes

    • Improved cursor-based editor launches so opening files jumps reliably to specified line and column positions.
  • Tests

    • Added test coverage validating navigation to line and column targets when using the cursor editor.
  • Style

    • Adjusted typography for code blocks and inline code to improve readability in chats and forms.

- detect `:line` and `:line:column` suffixes in open targets
- pass `--goto` when launching Cursor so it jumps to the cursor location
- add tests covering both line-only and line+column targets
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5770004 and 76b290d.

📒 Files selected for processing (1)
  • apps/web/src/index.css

Walkthrough

Adds a regex and helper to detect line/column suffixes and conditionally pass a --goto flag when launching the cursor editor for positional targets; adds tests for both line and line+column cases; also applies small CSS font-size tweaks for code elements.

Changes

Cohort / File(s) Summary
Editor launch logic
apps/server/src/open.ts
Adds LINE_COLUMN_SUFFIX_PATTERN and shouldUseGotoFlag(); resolveEditorLaunch() now conditionally includes --goto for cursor editor when target contains line/column suffix.
Test coverage
apps/server/src/open.test.ts
Adds tests asserting --goto is used for cursor editor when cwd/target contains :line and :line:column suffixes.
Styling tweaks
apps/web/src/index.css
Adjusts font-size for select within a label, code blocks, and inline code in chat markdown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the primary change: adding Cursor --goto flag support for file targets with line/column suffixes, which is the main focus across the modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codething/a38b78be

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge juliusmarminge merged commit 29a632c into main Feb 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant