SmiteshP / nvim-navic

Simple winbar/statusline plugin that shows your current code context
Apache License 2.0
1.43k stars 50 forks source link

[Idea] Add scope information to `Telescope` pickers #136

Open pidgeon777 opened 1 year ago

pidgeon777 commented 1 year ago

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:

Scope:

Text:

pidgeon777 commented 1 year ago

Maybe a Telescope extension / action could be developed?

An example of possible action:

telescope.actions.send_to_navic

So that all of the telescope results are formatted as suggested above.

https://github.com/nvim-telescope/telescope.nvim/issues/2740

SmiteshP commented 1 year ago

Not sure I understand the idea here? Are you suggesting something like Navbuddy?

Dooez commented 9 months ago

As far as i understand, it's not the same as Navbuddy.

Navbuddy's telescope() command searches symbols in a single scope. This solution would search symbols in all scopes same as default telescope lsp_document_symbols(), but in addition to symbol name and type would also show the enclosing scope.

I would also like to see the enclosing scope when searching through all symbols.