VidocqH / lsp-lens.nvim

Neovim plugin for displaying references and difinition infos upon functions like JB's IDEA.
MIT License
252 stars 15 forks source link

Feature Request: Allow for custom sections #28

Open mcauley-penney opened 8 months ago

mcauley-penney commented 8 months ago

Introduction

VSCode's codelens functionalities are extensive, and users who want to mimic parts of them cannot because sections are restricted to certain defaults. Allowing the user to define custom sections would be useful for achieving pieces of information that lsp-lens should not have to maintain.

Example

For example, I personally would like to implement something like in the below image, where the user can see how many tests for the current function/method exist and how many are passing. Tools like Neotest may be able to provide the information (if it has an API), but I'd like to display it in the codelens format instead of in the sign or diagnostic columns.

image Image Source

Idea

Much like statuscol.nvim, lsp-lens.nvim could use a table of sections with some defaults that are built-in, such as "references", "definitions", and so on (it already does this πŸ‘πŸ»). It could also allow the user to define custom sections that will be evaluated and return a string.

If this is interesting, I'd be interested in working on it. Maybe lsp-lens could expand to more than just LSP, like you are doing with the git author provider you mentioned here.

VidocqH commented 8 months ago

It's really interesting! This will made the plugin more useful and I think it need to split some current code that I also want to do.

mcauley-penney commented 8 months ago

Awesome! If it is okay with you, I would like to work on a basic implementation and discuss it here. This implementation will include setting up a process that turns a table of sections into the codelens string. I am decently familiar with this codebase, but I don't know yet how much work would be required for this. To be honest, I think most of it is already done.

VidocqH commented 8 months ago

It's okay. Just do it. 😊