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

Improvements from symbols-outline.nvim and ⚠️ breaking changes #12

Closed
hedyhli opened this issue Nov 12, 2023 · 2 comments
Closed

Improvements from symbols-outline.nvim and ⚠️ breaking changes #12

hedyhli opened this issue Nov 12, 2023 · 2 comments

Comments

@hedyhli
Copy link
Owner

hedyhli commented Nov 12, 2023

This comment documents changes from upstream before github detaches the fork into a proper repo.


Fixes

🛑 Breaking changes

The fork has been renamed to outline.nvim for the following reasons:

  1. While symbols-outline is a great name, using SymbolsOutline* everywhere as a prefix for commands and highlight groups is quite long to type.
  2. I did not find existing plugins that use the outline import path.
  3. The only plugin I could find named outline.nvim does not use this import path.
  4. This is a fork starting anew, it makes sense to undergo a rename.

Regardless of this rename, I am eternally grateful to @simrat39 for their work in the original symbols-outline.nvim. This plugin would not exist without it.

What this means for you:

  • Commands and highlights that had the SymbolsOutline* prefix should now use Outline*
  • The import path should be changed from symbols-outline to outline
:s/FocusedSymbol/OutlineCurrent/g
:s/SymbolsOutlineConnector/OutlineGuides/g
:%s/SymbolsOutline/Outline/g
:%s/symbols-outline/outline/g

Here are other breaking changes:

If your existing config uses the mentioned features, you can convert the setup opts using this script.

  • Config: Configuration options have been significantly restructured to
    provide better consistency and understandability. Please see the default config for an example of the full list.

    • Options that control the looks and behaviour of outline window is now moved to outline_window table;
    • Options that control the items that show up are now in outline_items
    • Options for the preview window is in preview_window.
    • Symbol icons are now in symbols.icons, symbol blacklists are in symbols.blacklist
    • Lsp blacklists are now in providers.lsp.blacklist_clients.
    • Fold options are now in symbol_folding with fold_markers being symbol_folding.markers, consistent to guides.markers.

    The reasoning for the above is simple. When you see 'border' under preview_window you can directly infer it controls the border for the preview window. Previously, for example, when you see winblend or wrap: is it for the outline window or the preview window? Furthermore, this change also aids extensibility to the configuration, and avoids cluttering the root setup opts namespace.

    If you disagree with this decision, you are always free to switch back to the original symbols-outline.nvim, or you could pin a commit in this fork if you still want to use the features and fixes from here.

  • Config: keymaps.focus_location RENAMED to keymaps.peek_location to avoid confusion with focus window commands.

  • Config: Marker icons used for guides can now be customized. show_guides REMOVED in favor of guides.enabled.

    You can set guides = false to disable guides altogether, or set guides = true to enable it but use default configuration for the guides. Otherwise, please use guides.enabled if your configuration for guides is a table.

  • Behaviour: Removed hover floating window from toggle_preview.

    • Instead, you can set open_hover_on_preview=true (false by default) so that the hover_symbol action can be triggered when toggle_previewis triggered.
    • The preview window's size changed to half of neovim height (rather than a third). This is planned to be configurable.
    • The preview window is positioned to be vertically center-aligned (rather than fixed to the top). This is planned to be configurable.
  • Behaviour: When auto_close=true only auto close if goto_location is used (where focus changed), and not for focus_location (Do not close outline when focus_location occurs simrat39/symbols-outline.nvim#119).

  • Behaviour: For auto_preview=true, previously preview is only shown after some delay. Now preview is shown instantly every time the cursor moves.

  • (66aecc7) Algorithms in parser and writer modules have been rewritten for better performance. Various exported functions have been removed. Everything seems to work the same but because of this major rewrite some things may break which I've missed

Features

Below is a list of features I've included in this fork which, at the time of writing, has not been included upstream (in the original repo). I try my best to keep this list up to date.

Features/Changes:

Screen recordings/shots of some of the features is shown at the bottom of the readme.

PRs

Key:

✅ = Either merged superseded
📮 = Planned for merge
  • Distinguish between public and private function display in Elixir
    (#187 by scottming)

  • Floating window (Draft)
    (#101 by druskus20)

Show completed PRs
  • ✅ center view on goto symbol
    (#239 by skomposzczet)

    Superseded by adding config option

  • ✅ Open handler checks if view is not already open
    (#235 by eyalz800)

  • ✅ auto_jump config param
    (#229 by stickperson)

    Renamed to auto_goto for consistency

  • ✅ Update nerd fonts to 3.0
    (#225 by anstadnik)

  • ✅ fix(folding): optimize fold/unfold all
    (#223 by wjdwndud0114)

  • ✅ Support markdown setext-style headers
    (#222 by msr1k)

  • ✅ fix(icons): replace obsolete icons
    (#219 by loichyan)

    Superseded by #225

  • ✅ Support ccls symbols
    (#218 by rqdmap)

  • ✅ fix: replace newlines with spaces in writer
    (#204 by tbung)

  • ✅ Make close_outline idempotent
    (#200 by showermat)

    Superseded by #163

  • ✅ Fix some options
    (#180 by cljoly)

  • ✅ fix: Invalid buffer id error
    (#177 by snowair)

  • ✅ fix(code_actions): use the builtin code_action
    (#168 by zjp-CN)

  • ✅ fix: plugin crashes when SymbolOutlineClose used
    (#163 by beauwilliams)

  • ✅ feat: Add window_bg_highlight to config
    (#137 by Zane-)

    Improved implementation

  • ✅ Added preview width and relative size
    (#130 by Freyskeyd)

    Improved upon and refactored with new config structure

  • ✅ Improve preview, hover windows configurability and looks
    (#128 by toppair)

    Improved upon and refactored with new config structure

  • ✅ Do not close outline when focus_location occurs
    (#119 by M1Sports20)

  • ✅ feat: instant_preview
    (#116 by axieax)

    Superseded with an improved implementation

  • ✅ check if code_win is nill
    (#110 by i3Cheese)

    Superseded before this fork was created

    (perhaps the PR was forgotten to be closed)

@hedyhli hedyhli pinned this issue Nov 12, 2023
@hedyhli hedyhli changed the title List of changes to original symbols-outline before fork detach List of changes from original symbols-outline before fork detach, and related issues from upstream Nov 12, 2023
@hedyhli
Copy link
Owner Author

hedyhli commented Nov 13, 2023

It looks there are a lot more people migrating from symbols-outline.nvim to outline.nvim than elsewhere, I've included a script that can convert the setup opts into the new structure.

@hedyhli hedyhli changed the title List of changes from original symbols-outline before fork detach, and related issues from upstream Improvements from symbols-outline.nvim and ⚠️ breaking changes Nov 15, 2023
@hedyhli
Copy link
Owner Author

hedyhli commented Nov 18, 2023

Since github support has now detached my fork from symbols-outline.nvim, new changes from now on will be in CHANGELOG.md.

@hedyhli hedyhli closed this as completed Nov 18, 2023
folke pushed a commit to LazyVim/LazyVim that referenced this issue Jul 5, 2024
## What is this PR for?

The symbols-outline extra was removed in favor of outline.nvim in #2535
(thanks!), but the configuration for symbols in outline.nvim [is not
backwards-compatible](hedyhli/outline.nvim#12).

This fixes the configuration for the symbols icons and filter to be
usable by outline.nvim.

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Does this PR fix an existing issue?

<!--
  If this PR fixes any issues, please link to the issue here.
  Fixes #<issue_number>
-->

It doesn't seem like anyone has encountered this issue, but I can
confirm that the config currently used by LazyVim is incorrect. The
symbols table is at `symbols` for symbols-outline.nvim, but it's now at
`symbols.icons` for outline.nvim.

There is no such `symbols_blacklist` key. Instead, `symbols.filter` is
used, which is a kind of "whitelist".

Coincidentally, outline.nvim fully supports the LazyVim `kind_filter`
config table structure. It can either be a list of strings (kinds), or a
list of strings for each filetype key. Setting to nil or false makes it
so all symbols are included, just like in LazyVim.

See [the docs on the
`symbols.filter`](https://github.com/hedyhli/outline.nvim?tab=readme-ov-file#symbols-table)
structure.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant