Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support devicons in lsp_references picker #3086

Open
joeveiga opened this issue May 2, 2024 · 0 comments
Open

Support devicons in lsp_references picker #3086

joeveiga opened this issue May 2, 2024 · 0 comments
Labels
enhancement Enhancement to performance, inner workings or existent features good first issue Good for newcomers

Comments

@joeveiga
Copy link
Contributor

joeveiga commented May 2, 2024

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Currently, the file pickers support devicons (with an option disable_devicons to disable them), but lsp references picker do not:
image
image
It'd be nice to have that option for lsp references as well.

Describe alternatives you've considered
I tried using a custom entry_maker for the lsp references picker. However, I wanted to only override the display function, but I'm not quite sure how to do this. I thought about reusing the current entry maker used for this picker, but I don't know how to access the opts from within the entry_maker function (probably a dumb question).

-- ...
  pickers = {
	  -- ...
	  lsp_references = {
		  entry_maker = function(entry)
			  local opts = {} -- TODO: how can i access these form here?
  
			  -- reuse the builtin entry maker
			  local entry_maker = require("telescope.make_entry").gen_from_quickfix(opts)
  
			  -- TODO: return new entry maker that only overrides the display function
		  end,
	  },
 -- ...

If this is something we can add, I can submit a PR to support devicons and the option to disable them. These are the proposed changes (roughly):
image

Additional context
I assume in most cases lsp references will all be the same file type (whatever the language you're working on is), however, in the case of Angular, you can have references to a symbol from both typescript and html files. Usually the file names are pretty similar and it can be difficult to differentiate them (see screenshot above).

Another example would be *.spec.ts files, which would be easier to identify by the icon rather than scanning down the line to look at the file extension.

Thank you!

@joeveiga joeveiga added the enhancement Enhancement to performance, inner workings or existent features label May 2, 2024
@jamestrew jamestrew added the good first issue Good for newcomers label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants