JCWasmx86 / mesonlsp

An unofficial, unendorsed language server for meson written in C++
GNU General Public License v3.0
64 stars 8 forks source link

Duplicate entries in completions #92

Closed hqnna closed 4 months ago

hqnna commented 4 months ago

Describe the bug The language server generates duplicate entries when providing completions.

To Reproduce Steps to reproduce the behavior:

  1. Install vscode or any other editor with LSP support
  2. Install mesonlsp to the $HOME/.local/bin directory
  3. Ensure $HOME/.local/bin is in your $PATH first
  4. Install the official meson extension and type out the project line
  5. Notice how when typing version you see duplicate entries

Expected behavior There should only be one entry for each lsp completion item when typing.

Screenshots/Screencasts

image

image

System info

Additional context I was writing an extension for the Zed editor to add lsp and higlighting support for meson, when working on a hobby project with my own extension I noticed duplicates in that editor as well. I thought this might be some code in my extension so I commented out the bit of code used for adding color to suggestions, however even after removing said code and rebuilding the duplicate entry persisted. Given this seems to be persistent across multiple editors, extensions, and environments it seems to be a bug.

It should also be noted the first and second entries act different, with the first one being bugged.

https://github.com/JCWasmx86/mesonlsp/assets/46457601/0ccdbfd3-25e6-486c-aeba-10c1989999d1

JCWasmx86 commented 4 months ago

Thanks for the bugreport. Weird, because for me it works on VSCode :(

Screencast from 2024-05-30 13-57-31.webm

image

JCWasmx86 commented 4 months ago

I will try to setup Zed on Linux and checkout what happens

JCWasmx86 commented 4 months ago

I think I could reproduce it, even with VSCode

hqnna commented 4 months ago

Completely unsure what's causing this, my extension literally just downloads and runs the language server with the --lsp flag.. This is an extremely odd bug.

hqnna commented 4 months ago

So it appears the duplicate only appears in zed when im typing it on the same line.

https://github.com/JCWasmx86/mesonlsp/assets/46457601/660998de-5855-4906-b1ac-0f77b8c925ac

JCWasmx86 commented 4 months ago

I think a fix will be there in the next few weeks, as I currently have a lot of other work to do :/ But feel free to investigate it yourself