telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

[Idea] Add scope information to `Telescope` pickers

Open pidgeon777 opened this issue 2 years ago • 4 comments

It would be great to add a Scope column to any Telescope picker as follows, to show the scope of each listed item:

┌───────────────────────────────────────────────────────┐
│                        Previewer                      │
├───────────────────────────────────────────────────────┤
│                                                       │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│   *************************************************   │
│                                                       │
├─────────────────┬────────────────┬────────────────────┤
│ Filepath        │ Scope          │ Text               │
├─────────────────┼────────────────┼────────────────────┤
│ C:\path\file_1  │ A > B > C >    │ X                  │
│ C:\path\file_2  │ A >            │ Y                  │
│ C:\path\file_2  │ D >            │ Z                  │
│ C:\path\file_2  │ E >            │ W                  │
└─────────────────┴────────────────┴────────────────────┘

Filepath:

  • Optional display.
  • Relative/Absolute etc.

Scope:

  • The scope information may come from LSP (if available on the buffer) or tags (if scope information is available).
  • May be C++ classes, functions, Markdown sections.
  • Display only parent scope or full hierarchy.
  • Plugin based? (e.g. nvim-navic).

Text:

  • Any kind of searched text (LSP Symbol, visual string, diagnostic, etc.).

pidgeon777 avatar Oct 13 '23 09:10 pidgeon777

Personally, I don't love the idea of having this in telescope core and would rather rely on telescope extensions to do more specialized pickers.

jamestrew avatar Oct 13 '23 20:10 jamestrew

Yes, probably this should fit better as a telescope extension / plugin.

I asked nvim-navic author what he may think about it.

Anyway, it should be very useful to me.

pidgeon777 avatar Oct 13 '23 21:10 pidgeon777

Yeah I agree I would probably use it if it existed. Just need someone willing to create it and maintain it :grin:

jamestrew avatar Oct 13 '23 23:10 jamestrew

@jamestrew yes, that's a little detail, eheh.

pidgeon777 avatar Oct 14 '23 09:10 pidgeon777