Skip to content

Commit

Permalink
Copy RustOpenDocs command
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Jun 15, 2022
1 parent c5107b7 commit 4d583f7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ lspconfig.cmake.setup({
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
on_attach = on_attach,
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',
},
},
})
lspconfig.pylsp.setup({
capabilities = capabilities,
Expand Down

0 comments on commit 4d583f7

Please sign in to comment.