nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.45k stars 286 forks source link

Add option to have outline open in fully collapsed mode #1487

Open cwinsnes opened 1 month ago

cwinsnes commented 1 month ago

Is your feature request related to a problem? Please describe. When I use the LspSaga outline feature, I commonly want all collapsible objects to be collapsed to get a high level overview of the current file.

I have tried setting detail=false in my lspsaga setup which does not seem to do this action and I don't see any other available option in the documentation (https://nvimdev.github.io/lspsaga/outline/) that looks applicable.

Describe the solution you'd like I would like to see an option to open the outline with every collapsable object in the collapsed state by default. It could for example look like

require('lspsaga').setup({
    -- The default value of collapsed could be false to align with current behaviour
    outline = { collapsed = true }
})

Describe alternatives you've considered An alternative solution could be the already requested feature (https://github.com/nvimdev/lspsaga.nvim/issues/1435) where one has to press the "collapse all" button when using the outline.

Another possible solution would be to add a keybind which lets you jump to the next collapsible object in the list so that one can jump between high level objects in an easy way. This keybind would be useful for getting a slightly better high level overview of the file, but I belive it to be less useful for the problem at hand.

Additional context To me, it sounds similar in scope to the already mentioned feature request of being able to collapse all items in the outline (https://github.com/nvimdev/lspsaga.nvim/issues/1435) so the two features could probably be implemented in tandem.

TheNoeTrevino commented 2 weeks ago

this would be a great addition! i would love to have this