Skip to content

[RFC] Treat locate command response as path:line:column #3895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

captbaritone
Copy link
Contributor

Our intention in Relay was for the response from the locate command to be treated as path:line:column to match the convention of path strings in CLI output used by most tools. For example, paths in stack traces or errors in compiler output.

This convention is a de facto standard understood by many terminal emulators. This means if a server implements a locate command it should be useful in GraphQL LSPs (like this one or Relay's) and also at the CLI, where a user could manually invoke the command and then cmd+click the result to jump to the correct location in their editor.

I'm not sure what if any tests/docs etc will need to change here, but I figured this PR could start the conversation.

Screen.Recording.2025-04-25.at.9.25.20.AM.mov

Our intention in Relay was for the response from the locate command to be treated as `path:line:column` to match the convention of path strings in CLI output used by most tools. For example, paths in stack traces or errors in compiler output.

This convention is a de facto standard understood by many terminal emulators. This means if a server implements a locate command it should be useful in GraphQL LSPs (like this one or Relay's) and also at the CLI, where a user could manually invoke the command and then cmd+click the result to jump to the correct location in their editor.
Copy link

changeset-bot bot commented Apr 25, 2025

⚠️ No Changeset found

Latest commit: b817e0d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hayes
Copy link

hayes commented Apr 25, 2025

I opened a similar PR here: #3891

I think there is still a discrepancy here between 1 and 0 indexed line numbers

@captbaritone
Copy link
Contributor Author

Lol, I'm too slow. You even cced me. I'll close this in favor of yours.

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.

2 participants