Skip to content
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

Wrong line on goto_reference #6558

Closed
sillent opened this issue Apr 2, 2023 · 1 comment · Fixed by #6559
Closed

Wrong line on goto_reference #6558

sillent opened this issue Apr 2, 2023 · 1 comment · Fixed by #6559
Labels
C-bug Category: This is a bug

Comments

@sillent
Copy link
Contributor

sillent commented Apr 2, 2023

Summary

Hello,

The result of goto_reference gives an incorrect line number for the file it points to
Снимок экрана 2023-04-02 в 19 47 36

The problem is solving with this patch

   1   │ diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
   2   │ index f8e83a46..78dbc0be 100644
   3   │ --- a/helix-term/src/commands/lsp.rs
   4   │ +++ b/helix-term/src/commands/lsp.rs
   5   │ @@ -81,7 +81,7 @@ fn format(&self, cwdir: &Self::Data) -> Row {
   6   │
   7   │          // Most commonly, this will not allocate, especially on Unix systems where the root prefix
   8   │          // is a simple `/` and not `C:\` (with whatever drive letter)
   9   │ -        write!(&mut res, ":{}", self.range.start.line)
  10   │ +        write!(&mut res, ":{}", self.range.start.line + 1)
  11   │              .expect("Will only failed if allocating fail");
  12   │          res.into()
  13   │      }

Reproduction Steps

Open project, place cursor on symbol/function/method in normal mode and press g-r

Helix log

No response

Platform

macOs

Terminal Emulator

iTerm2

Helix Version

helix 23.03 (3cf0372)

@sillent sillent added the C-bug Category: This is a bug label Apr 2, 2023
@the-mikedavis
Copy link
Member

Good catch! Please open up a PR with that change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants