Closed tsukimizake closed 2 years ago
Seems like I should have investigated https://github.com/ebkalderon/tower-lsp/blob/master/examples/stdio.rs at first hand...
No, that's a perfectly valid point! The rustdoc
example code was intentionally made simplistic to avoid taking up too much vertical space in docs.rs, drawing attention away from the actual documentation. But it is indeed misleading, so I agree it should be updated.
Perhaps something like this?
async fn initialize(&self, _: InitializeParams) -> Result<InitializeResult> {
Ok(InitializeResult {
hover_provider: Some(HoverProviderCapability::Simple(true)),
completion_provider: Some(CompletionOptions::default()),
..Default::default()
})
}
I'd be happy to accept a pull request, if you're down for it!
Hi. I tried to make a mock lsp server following the example in https://github.com/ebkalderon/tower-lsp/blob/4cf39815e7e9e82c96bb267144f17e7b25415db3/src/lib.rs , but its hover and completion didn't work at first.
I tried to update the capabilities in the initialize function, and it works.
Seems like the doc should be updated? (Perhaps also the example on README.md?)
My environment is macOS catalina10.15.7 neovim v0.6.1 lsp client is
nvim-lspconfig