zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.69k stars 3.14k forks source link

truncated language server suggestions - missing parameters (clangd) #16057

Open Emc2356 opened 3 months ago

Emc2356 commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

as the title said zed kept suggesting mVertBin over and over again for some reason

image

Environment

Zed: v0.147.2 (Zed Preview)
OS: Linux X11 endeavouros unknown
Memory: 7.6 GiB
Architecture: x86_64
GPU: Intel(R) UHD Graphics 620 (WHL GT2) || Intel open-source Mesa driver || Mesa 24.1.5-arch1.1
notpeter commented 3 months ago

Which language / language server are you using that is triggering this? Can you provide a minimal file/repo which demonstrates this issue?

Emc2356 commented 3 months ago

@notpeter sorry just saw your message

#include <string>

class VulkanShader {
public:
    VulkanShader(const std::string& vert, const std::string& frag) :
private:
    std::string mVertBin;
    std::string mFragBin;
};

after the semicolon in like 6 when i type the letter m the problem appears. i am using clangd

notpeter commented 3 months ago

The suggestion that I'm getting is similar, but appears to include more context as how the multiple suggestions differ:

Screenshot 2024-08-13 at 17 47 18

Which version of clangd are you using? Mine is: Apple clangd version 15.0.0 (clang-1500.3.9.4)

Emc2356 commented 3 months ago
[emc@Vroom ~]$ clangd --version
clangd version 18.1.8
Features: linux
Platform: x86_64-pc-linux-gnu

if it is using the clangd that i have installed in my system, not sure how to check it from zed

notpeter commented 3 months ago

I can reproduce. Running Ubuntu Linux 22. Current Zed Nightly. Zed clangd.

# ~/.local/share/zed/languages/clangd/clangd_18.1.3/bin/clangd --version
clangd version 18.1.3 (https://github.com/llvm/llvm-project c13b7485b87909fcf739f62cfa382b55407433c0)
Features: linux+grpc
Platform: x86_64-unknown-linux-gnu

Screenshot_20240814_142449

Works on MacOS, broken on Linux. Great reproduction steps @Emc2356! Thanks!