mirror of https://github.com/wlcx/home.git
vim: Add rustopendocs command
This commit is contained in:
parent
96396f67a7
commit
9017475528
|
@ -62,6 +62,20 @@ require'lspconfig'.rnix.setup{
|
|||
require'lspconfig'.rust_analyzer.setup{
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
commands = {
|
||||
RustOpenDocs = {
|
||||
function()
|
||||
vim.lsp.buf_request(vim.api.nvim_get_current_buf(), 'experimental/externalDocs', vim.lsp.util.make_position_params(), function(err, url)
|
||||
if err then
|
||||
error(tostring(err))
|
||||
else
|
||||
vim.fn['netrw#BrowseX'](url, 0)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
description = 'Open documentation for the symbol under the cursor in default browser',
|
||||
},
|
||||
},
|
||||
}
|
||||
require'lspconfig'.dhall_lsp_server.setup{
|
||||
on_attach = on_attach,
|
||||
|
|
Loading…
Reference in New Issue