Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/VidocqH/lsp-lens.nvim
Neovim plugin for displaying references and difinition infos upon functions like JB's IDEA.
https://github.com/VidocqH/lsp-lens.nvim
lsp lua neovim neovim-plugin nvim
Last synced: about 2 months ago
JSON representation
Neovim plugin for displaying references and difinition infos upon functions like JB's IDEA.
- Host: GitHub
- URL: https://github.com/VidocqH/lsp-lens.nvim
- Owner: VidocqH
- License: mit
- Created: 2023-02-08T15:46:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-07T11:27:06.000Z (6 months ago)
- Last Synced: 2024-01-24T08:05:14.881Z (4 months ago)
- Topics: lsp, lua, neovim, neovim-plugin, nvim
- Language: Lua
- Homepage:
- Size: 67.4 KB
- Stars: 210
- Watchers: 4
- Forks: 13
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-neovim - VidocqH/lsp-lens.nvim - Display function references above function definition like IDEA codelens. (LSP / (requires Neovim 0.5))
- awesome-stars - VidocqH/lsp-lens.nvim - Neovim plugin for displaying references and difinition infos upon functions like JB's IDEA. (Lua)
- awesome-neovim - VidocqH/lsp-lens.nvim - Display function references above function definition like IDEA codelens. (LSP / (requires Neovim 0.5))
- awesome-neovim - VidocqH/lsp-lens.nvim - Display function references above function definition like IDEA codelens. (LSP / (requires Neovim 0.5))
README
# lsp-lens.nvim
Neovim plugin for displaying reference and definition info upon functions like JB's IDEA.
## Installation
### Prerequisite
neovim >= 0.8
lsp server correctly setup
### Lazy
```lua
require("lazy").setup({
'VidocqH/lsp-lens.nvim'
})
```### Usage
```lua
require'lsp-lens'.setup({})
```## Configs
Below is the default config
```lua
local SymbolKind = vim.lsp.protocol.SymbolKindrequire'lsp-lens'.setup({
enable = true,
include_declaration = false, -- Reference include declaration
sections = { -- Enable / Disable specific request, formatter example looks 'Format Requests'
definition = false,
references = true,
implements = true,
git_authors = true,
},
ignore_filetype = {
"prisma",
},
-- Target Symbol Kinds to show lens information
target_symbol_kinds = { SymbolKind.Function, SymbolKind.Method, SymbolKind.Interface },
-- Symbol Kinds that may have target symbol kinds as children
wrapper_symbol_kinds = { SymbolKind.Class, SymbolKind.Struct },
})
```### Format Requests
```lua
require'lsp-lens'.setup({
sections = {
definition = function(count)
return "Definitions: " .. count
end,
references = function(count)
return "References: " .. count
end,
implements = function(count)
return "Implements: " .. count
end,
git_authors = function(latest_author, count)
return " " .. latest_author .. (count - 1 == 0 and "" or (" + " .. count - 1))
end,
}
})```
## Commands
```
:LspLensOn
:LspLensOff
:LspLensToggle
```## Highlight
```lua
{
LspLens = { link = "Comment" },
}
```## Known Bug
- Due to a [known issue](https://github.com/neovim/neovim/issues/16166) with the neovim `nvim_buf_set_extmark()` api, the function and method defined on the first line of the code may cause the len to display at the -1 index line, which is not visible.
## Thanks
[lspsaga by glepnir](https://github.com/glepnir/lspsaga.nvim#customize-appearance)