Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewing File.close autocomplete causes editor to completely lock/freeze #2139

Closed
Mr-Nobody99 opened this issue Jan 9, 2025 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@Mr-Nobody99
Copy link

Mr-Nobody99 commented Jan 9, 2025

Zig Version

0.13.0

ZLS Version

0.13.0

Client / Code Editor / Extensions

nvim 0.10.3 with Lazyvim lsp-config/mason

Steps to Reproduce and Observed Behavior

Start typing .close() on anything of type File and try selecting the auto-completion suggestion from drop-down.

zls-bug.mp4

It may not be visually obvious in the video clip, but the moment the auto-complete suggestion for .close() pops up my entire terminal locks completely and I am unable to do anything except re-start or launch a new tab.

This seems to be very specific to the File.close() as this is the only auto-complete that has caused the issue for me. Otherwise everything works fine.

Expected Behavior

Editor to not crash/freeze

Relevant log output

No response

@Mr-Nobody99 Mr-Nobody99 added the bug Something isn't working label Jan 9, 2025
@Techatrix
Copy link
Member

I am unable to reproduce this issue with windows, nvim 0.10.3, Zig 0.13.0, ZLS 0.13.0 (installed through mason)

Could you add vim.lsp.set_log_level("debug") to your config and then post the content of the lsp.log file (open with :LspLog) after nvim freezes.

Could you also check your Task Manager to see whether ZLS is running and using CPU resources. It may not be ZLS that caused the issue.

@Mr-Nobody99
Copy link
Author

Mr-Nobody99 commented Jan 18, 2025

I suppose there is the possibility that the issue is in some config or environment factor or something other than ZLS...Although I find that difficult to accept given how specific the issue is to the ZLS provided completion list and that no issue like this has ever happened with any other LSP I've used with the same neovim setup/environment.

I tried again with the process manager open and lsp log level set to "debug" it looks like there is a very small CPU usage from ZLS right up until the issue happens.

zls-issue.mp4

Here is lsp.log file, I tried to keep it to just triggering the issue.
2025-01-18_zls_lsp.log

@NicoElbers
Copy link

NicoElbers commented Jan 21, 2025

I experience the same issue. I observed that neovim was running at 100% CPU and seemed to slowly leak memory.

> nvim --version
NVIM v0.11.0-nightly+2b07b14
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info
> zig version                                                             
0.14.0-dev.2837+f38d7a92c 
> zls --version
0.14.0-dev

@NicoElbers
Copy link

@Mr-Nobody99 do you use blink.cmp, it seems that with neovim's default omnifunc I don't experience this issue

@NicoElbers
Copy link

Saghen/blink.cmp#1039 seems to be the cause

@Mr-Nobody99
Copy link
Author

Thanks @NicoElbers It looks like the issue is blink.cmp. Looks like Lazyvim switch to that one over nvim-cmp in recent versions. I configured to use nvim-cmp instead of blink.cmp and it resolved the issue. Will follow the issue you linked to, hopefully root cause will be fixed in a reasonable time frame.

@Mr-Nobody99
Copy link
Author

And thanks @Techatrix for taking a look at this. Looks like you were right that issue was not with ZLS. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants