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(builtin): avoid duplicate LSP reference results #3353

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

Conversation

impankratov
Copy link

@impankratov impankratov commented Nov 4, 2024

Description

Hi! Thanks for the great neovim plugin!

I have a small (but unpleasant) problem.
In case of multiple LSP servers, making a request to each server can result in similar results.

For example:
In angular project, if both typescript & angular language server are setup and running, execution of "textDocument/references" resulting in telescope showing duplicate list of results.

Fix is to check if resulting table (items) contains similar item and don't add it.

I have small experience in Lua, so there's probably some improvements to be made to this fix.

Fixes # (issue) (haven't found any relevant issues)

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

Tested locally, with various combinations of LSP servers/languages.

Configuration:

  • Neovim version (nvim --version): v0.10.2
  • Operating system and version: Linux 6.11.5-arch1-1

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)

In case of multiple LSP servers, making a request to each server can
result in similar results.

For example:
If both typescript & angular language server are running
and request "textDocument/references" is executed, results from 2
servers are overlapping, resulting in telescope showing duplicate list
of results.

Fix is to check if resulting table (`items`) contains similar item and
don't add it.
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