Autocompletions very slow
Summary
Autocompletions are very slow. I am testing with Python (both custom snippets and non-snippets)
I am aware that this was talked about in other issues and fixed in https://github.com/zed-industries/zed/pull/19013 although it is still happening.
Couple of examples:
Custom snippet:
this is my .config/zed/snippets/python.json file
{
"property": {
"prefix": "prop",
"body": ["@property", "def $1(self):", " return self.$1"],
"description": "property"
}
}
https://github.com/user-attachments/assets/7bdaa51c-f996-4886-a3ee-2e4592e62bf3
Normal Python autocomplete (not a snippet)
https://github.com/user-attachments/assets/2d7d19e1-9dff-4c2b-9511-d99f151baa3a
Steps to trigger the snippets problem:
- Define a code snippet 2.Try to use it in a file 3.See slow autocomplete
or for non-snippets:
- Just try to write some Python code like
classand check the slowness of the autocomplete.
Actual Behavior: Completions are taking >2 seconds
Expected Behavior: Autocompletions should be snappy
Below is my settings.json file where I tried to find a debounce that could be messing with the behaviour but I couldn't find it.
Zed Version and System Specs
Zed: v0.178.5 (Zed) OS: macOS 15.3.2 Memory: 32 GiB Architecture: x86_64
Oh, this is pretty gnarly. Does this happen for all Python projects on your end or just specific ones? Does it happen faithfully whenever you have code snippets available?
IKR?
To answer your questions:
Does this happen for all Python projects on your end or just specific ones?
It happens on all of the projects, I tried several.
Does it happen faithfully whenever you have code snippets available?
It happens with and without snippets defined.
After a lot of testing I managed to bypass the issue in a way that I am not happy but it works.
The issue is definitely coming from pylsp, I switched to pyright and boom, snappy as expected.
Snippets, autocompletion, all good.
Although pyright is not really what I am happy with so I just added a config for it to basically ignore the typing and just use it as a plain LSP.
Having said that, I am not sure why pylsp is that slow, or if it is my setup/config or if it is a Zed thing.
Any recommendations are welcome, maybe I can use yet another LSP for Python if you could recommend one although the issue with pylsp would still remain.
Hello! Can confirm, started happening after recent updates (updated from 177 to 179 today). LSP auto-completions for python are essentially unusable with pylsp. Works as expected with pyright.
Same issue here. To remove pylsp as a workaround:
"languages": {
"Python": {
"language_servers": ["!pylsp", "pyright", "ruff"]
}
}
"languages": { "Python": { "language_servers": ["!pylsp", "pyright", "ruff"] } }
I remember that the performance issue was solved in some previous versions. Thanks very much that it works!
"languages": { "Python": { "language_servers": ["!pylsp", "pyright", "ruff"] } }
I remember that the performance issue was solved in some previous versions. Thanks very much that it works!
Still on issue on my side (version 0.180.3)
Not sure if it's the same issue, but I am working on a TypeScript project (with Svelte) and autocompletions are very slow as well. When I start to type a component name that is in my project it can take up to like 5 seconds to show any import suggestions.
I wanted to share that I'm using now https://github.com/astral-sh/ty and zed works much better now for me
Hey @yabirgb
Looks interesting, would you mind sharing your setup?
I would like to give it a go. I am trying to make it work but not sure how to configure and run it properly in Zed.
Thank you for sharing
I'm going to go ahead and close this as unactionable. In general slow auto complete it usually because the underlying LSP is slow at returning completions. This may be system / environment / project specific.
If you run into this in the future it may be helpful to open dev: language server logs, select the LSP in question, click "RPC messages" from the dropdown. Then you can see the request coming from Zed and the response from the LSP and you can see the delay. This may also help narrow down which LSP is providing the slow textDocument/completion.
Thanks all.