Giter Site home page Giter Site logo

lsp-lens.nvim's Introduction

lsp-lens.nvim

Neovim plugin for displaying reference and definition info upon functions like JB's IDEA.

image

Installation

Prerequisite

neovim >= 0.8

lsp server correctly setup

Lazy

require("lazy").setup({
  'VidocqH/lsp-lens.nvim'
})

Usage

require'lsp-lens'.setup({})

Configs

Below is the default config

local SymbolKind = vim.lsp.protocol.SymbolKind

require'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

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

{
  LspLens = { link = "LspCodeLens" },
}

Known Bug

  • Due to a known issue 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

lsp-lens.nvim's People

Contributors

vidocqh avatar github-actions[bot] avatar aymanalqadhi avatar asc11cat avatar barrett-ruth avatar dsully avatar catgoose avatar olimorris avatar ofseed avatar centsent avatar polirritmico avatar xiantang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.