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.97k stars 3.16k forks source link

LSP suggestions with long type definitions (i.e. C function pointers) are not helpful #17270

Open jansol opened 3 months ago

jansol commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

E.g. ONNXRuntime has a C API that puts all entry points as function pointers into an OrtApi struct. Clangd dutifully provides suggestions for these, but since this results in very long lines and Zed limits the displayed length of suggestions, they end up not being particularly useful.

image

(I think I've seen a somewhat similar issue before but couldn't find it now)

Environment

Zed: v0.152.0 (Zed Dev 1c6dbe02ae5277caebea61929485ae4b9250a0bd) OS: Linux Wayland ubuntu 24.04 Memory: 31.3 GiB Architecture: x86_64 GPU: Radeon Vega Frontier Edition (RADV VEGA10) || radv || Mesa 24.0.9-0ubuntu0.1

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

notpeter commented 3 months ago

Eeek! Any idea what these look like in other editors? Do they just show completion pop-up as wide as your screen? Horizontal scroll ball? Soft wrap into multiple lines? Would love to see how others are handling this.

jansol commented 3 months ago

Neovim is being a lot more useful: image

Kate has ALL the scrollbars and doesn't mind the popup breaking out of the main window, but still extracts the actual name to the start of each line: image

I don't have other LSP-capable editors at hand right now.

XDeme1 commented 3 months ago

Would something like this be better?

completion_cpp

The identifier is displayed first

jansol commented 3 months ago

Would something like this be better?

Much better, yes