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
48.12k stars 2.84k forks source link

Update buffer cursor to indicate pending language server work #13545

Open maxdeviant opened 3 months ago

maxdeviant commented 3 months ago

Check for existing issues

Describe the feature

Filing this on behalf of @fasterthanlime (link):

Screenshot 2024-06-26 at 10 17 09 AM

Textual version of the tweet, for searchability:

I suddenly find myself wishing that the cursor (text cursor, the block) went spinny / indicated loading state in some way when there's a pending LSP request (like "finding all references") — it feels too quiet right now, I have to check the status bar to make sure

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

No response

jamiebuilds commented 3 months ago

It would be nice if this was implemented with a slight delay before it changed the cursor so it didn't flash it for a just a couple frames when something runs quickly. If an LSP request takes more than say 200ms (which is hardly even a perceptible delay even though a flash of something is perceptible) you could then flip it to a loading state

GioPan04 commented 3 months ago

I was trying to implement this, the Linux part was fairly easy, the problem is with the macOS part. Turns out that you can't show the progress cursor via the NSCursor class. macOS will show the progress cursor only if the app froze. So I don't know if it make sense to implement this only on Linux (and maybe Windows) because it will create a feature disparity

fasterthanlime commented 3 months ago

To be clear, I really meant the text cursor, not the mouse cursor!

(since the text cursor is usually where my gaze actually is)

jackTabsCode commented 3 months ago

Yeah, I don't want my mouse cursor to change. Typically that indicates the app is hanging. Obviously, we're able to still interact with the editor while the LSP is working. I think animating the buffer cursor could be cool!