Skip to content

Commit

Permalink
feat(lsp): add lsplinks.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Mar 12, 2024
1 parent bc09e7e commit dd78f63
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/lsp/lsplinks-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# lsplinks.nvim

LSP `textDocument/documentLink` support for neovim

**Repository:** <https://github.com/icholy/lsplinks.nvim>
40 changes: 40 additions & 0 deletions lua/astrocommunity/lsp/lsplinks-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
"icholy/lsplinks.nvim",
lazy = true,
dependencies = {
{ -- lazy load when client is attached with `documentLink` support
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
autocmds = {
lsplinks_lazy_load = {
{
event = "LspAttach",
desc = "Lazy load `lsplinks.nvim`",
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client and client.supports_method and client.supports_method "textDocument/documentLink" then
require("lazy").load { plugins = { "lsplinks.nvim" } }
return true
end
end,
},
},
},
},
},
{ -- add buffer local mapping to buffers with documnetLink supporting clients
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
mappings = {
n = {
gx = { function() require("lsplinks").gx() end, cond = "textDocument/documentLink" },
},
},
},
},
},
config = true,
}

0 comments on commit dd78f63

Please sign in to comment.