There's a small typo in tests - causing that we aren't sending exit LSP message to clangd but crashing it instead with the last message not being valid JSON and clangd hitting unexpected EOF in runLanguageServerLoop() right after. Seems like this bug even managed to spawn some offsprings via copy-pasting. I just found it by accident since I am not closing stdin after the last message when using XPC adapter and my test was hanging - waiting for clangd to exit.
It's not a big deal but I got two ideas.
- Maybe we should somehow check stderr from clangd - in this case there was JSON parse error present but tests didn't notice.
- When fixing that I got surprised by shutdown-without-exit.test implementation. It seems more like exit-without-shutdown to me and makes sense that we still want to exit (with non-success return value) in such case. Was this the intention?
What do you think?