bergercookie / asm-lsp

Language server for NASM/GAS/GO Assembly
https://crates.io/crates/asm-lsp
BSD 2-Clause "Simplified" License
272 stars 18 forks source link

asm-lsp keeps running when the buffer is closed #106

Closed ChillerDragon closed 4 months ago

ChillerDragon commented 4 months ago

I use neovim BTW. Not sure if the issue is in my setup. But it works with other lsps. For example if I open a go lang file I can see one gopls process being spawned which shuts down when I close neovim again. If I open an assembly file there is a new asm-lsp process which does not get shutdown when neovim is closed.

My neovim config: https://github.com/ChillerDragon/kickstart.nvim/ My system: debian 12 (Linux 6.1.0-16-amd64) My neovim version: nightly tag built from source (NVIM v0.11.0-dev-512+gfe5030c05)

How it looks like when I open a go file and close neovim again I ran pgrep once before neovim was opend then while it was opend and then when it was closed again:

main@debian:~$ pgrep gopls
main@debian:~$ pgrep gopls
368547
main@debian:~$ pgrep gopls
main@debian:~$ 

I did the same but this time opening an assembly file. And in the end I reopend neovim a bunch of times.

main@debian:~$ pgrep asm-lsp
main@debian:~$ pgrep asm-lsp
369292
main@debian:~$ pgrep asm-lsp
369292
main@debian:~$ pgrep asm-lsp
369292
369388
369471
369561
369639
369718
369806
369872
369948
370024
main@debian:~$ 

For now I changed my neovim aliases to include pkill -f asm-lsp and that saves me from running out of ram after a day of developing but there has to be a better way :laughing:

WillLillis commented 4 months ago

Interesting. Not sure what's causing this but I will look into it!

WillLillis commented 4 months ago

Quick update:

It looks like the server is receiving the shutdown request, exits the main loop, but blocks on the call to join its threads here:

https://github.com/bergercookie/asm-lsp/blob/15324b3d83375fbf9c99eedca6ee9953db1111b8/src/bin/main.rs#L280

I'm not sure what's causing this, and will have to continue investigating later.