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

fix(lsp.reference): Only filter the current line of the current filname #3154

Merged
merged 3 commits into from
Jun 8, 2024

Conversation

Lonzoghf
Copy link
Contributor

@Lonzoghf Lonzoghf commented Jun 4, 2024

fix(lsp.reference): Only filter the current line of the current filname when include_current_line=false

Description

Lsp references with the same number of lines in different files will be filtered when include_current_line=false

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Lsp references have the same number of lines in different files (with gopls)

Configuration:

  • Neovim version (nvim --version):
    NVIM v0.10.0
    Build type: Release
    LuaJIT 2.1.1713773202
    Run "nvim -V1 -v" for more info

  • Operating system and version:
    MacOs (14.5)

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

fix(lsp.reference): Only filter the current line of the current filname when include_current_line=false
Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch.
We're actually getting the current file path a little bit further done on line 158 (now 159).

local curr_filepath = vim.api.nvim_buf_get_name(opts.bufnr)

Maybe we can just stick that into opts (opts.curr_filepath = vim.api.nvim_buf_get_name(opts.bufnr)) and reuse that value in the tbl_filter function rather than re-fetching that.

@Lonzoghf
Copy link
Contributor Author

Lonzoghf commented Jun 7, 2024

Thanks, good catch. We're actually getting the current file path a little bit further done on line 158 (now 159).

local curr_filepath = vim.api.nvim_buf_get_name(opts.bufnr)

Maybe we can just stick that into opts (opts.curr_filepath = vim.api.nvim_buf_get_name(opts.bufnr)) and reuse that value in the tbl_filter function rather than re-fetching that.

Thank you, I have resubmitted the modifications

@jamestrew jamestrew merged commit 3a74349 into nvim-telescope:master Jun 8, 2024
12 checks passed
@jamestrew
Copy link
Contributor

Thanks!

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.

None yet

2 participants