Open davidgranstrom opened 2 years ago
Apart from my comments, this looks good! Hopefully the LSPProvider API is clear to implement things, I'm open to feedback.
I agree, I think shutdown should probably be owned by LSPConnection, and the provider should just signal to it somehow. In the future maybe we add ShutdownProvider as a "default" provider in addition to InitializeProvider, and then listen for changes via addDependant
. But this is fine for now, it's very clean as it is.
Hi!
This is an attempt to implement shutdown requests.
This is useful for the stdio adapter that communicates with the nvim LSP client so that we can shut down the node process on nvim exit and thus freeing the open ports.
I did not implement this part of the spec:
We could perhaps set a flag in
LSPConnection
to signal when ashutdown
request has been received, but I did not want to complicate the code until I get to know the code base a bit better.