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

[Idea] Add scope information to Telescope pickers #136

Open
pidgeon777 opened this issue Oct 13, 2023 · 3 comments
Open

[Idea] Add scope information to Telescope pickers #136

pidgeon777 opened this issue Oct 13, 2023 · 3 comments

Comments

@pidgeon777
Copy link

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
Copy link
Author

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.

nvim-telescope/telescope.nvim#2740

@SmiteshP
Copy link
Owner

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

@Dooez
Copy link

Dooez commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants